mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Correct sc25519_reduce() prototype
This commit is contained in:
@@ -68,7 +68,7 @@ crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r)
|
||||
return - ge25519_has_small_order(p);
|
||||
}
|
||||
|
||||
int
|
||||
void
|
||||
crypto_core_ed25519_scalar_random(unsigned char *r)
|
||||
{
|
||||
do {
|
||||
@@ -86,13 +86,13 @@ crypto_core_ed25519_scalar_invert(unsigned char *recip, const unsigned char *s)
|
||||
}
|
||||
|
||||
void
|
||||
crypto_core_ed25519_scalar_reduce(unsigned char *r, const unsigned char *s)
|
||||
crypto_core_ed25519_scalar_reduce(unsigned char *r, const unsigned char s[64])
|
||||
{
|
||||
unsigned char t[crypto_core_ed25519_SCALARBYTES];
|
||||
unsigned char t[64];
|
||||
|
||||
memcpy(t, s, sizeof t);
|
||||
sc25519_reduce(t);
|
||||
memcpy(r, t, sizeof t);
|
||||
memcpy(r, t, crypto_core_ed25519_SCALARBYTES);
|
||||
sodium_memzero(t, sizeof t);
|
||||
}
|
||||
|
||||
|
||||
@@ -2108,7 +2108,7 @@ sc25519_invert(unsigned char recip[32], const unsigned char s[32])
|
||||
*/
|
||||
|
||||
void
|
||||
sc25519_reduce(unsigned char s[32])
|
||||
sc25519_reduce(unsigned char s[64])
|
||||
{
|
||||
int64_t s0 = 2097151 & load_3(s);
|
||||
int64_t s1 = 2097151 & (load_4(s + 2) >> 5);
|
||||
|
||||
@@ -39,15 +39,15 @@ int crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r)
|
||||
__attribute__ ((nonnull));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_core_ed25519_scalar_random(unsigned char *r)
|
||||
void crypto_core_ed25519_scalar_random(unsigned char *r)
|
||||
__attribute__ ((nonnull));
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_core_ed25519_scalar_invert(unsigned char *recip, const unsigned char *s)
|
||||
int crypto_core_ed25519_scalar_invert(unsigned char *recip, const unsigned char s[64])
|
||||
__attribute__ ((nonnull));
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_core_ed25519_scalar_reduce(unsigned char *r, const unsigned char *s)
|
||||
void crypto_core_ed25519_scalar_reduce(unsigned char *r, const unsigned char s[64])
|
||||
__attribute__ ((nonnull));
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -117,7 +117,7 @@ void ge25519_from_uniform(unsigned char s[32], const unsigned char r[32]);
|
||||
|
||||
void sc25519_invert(unsigned char recip[32], const unsigned char s[32]);
|
||||
|
||||
void sc25519_reduce(unsigned char s[32]);
|
||||
void sc25519_reduce(unsigned char s[64]);
|
||||
|
||||
void sc25519_muladd(unsigned char s[32], const unsigned char a[32],
|
||||
const unsigned char b[32], const unsigned char c[32]);
|
||||
|
||||
Reference in New Issue
Block a user