Add crypto_core_{ed25519,ristretto255}_scalar_is_canonical()

This commit is contained in:
Frank Denis
2020-05-13 22:59:08 +02:00
parent d39dd88301
commit c2efce113d
7 changed files with 25 additions and 1 deletions
+2
View File
@@ -166,6 +166,7 @@ _crypto_core_ed25519_random 0 1
_crypto_core_ed25519_scalar_add 0 1
_crypto_core_ed25519_scalar_complement 0 1
_crypto_core_ed25519_scalar_invert 0 1
_crypto_core_ed25519_scalar_is_canonical 0 1
_crypto_core_ed25519_scalar_mul 0 1
_crypto_core_ed25519_scalar_negate 0 1
_crypto_core_ed25519_scalar_random 0 1
@@ -194,6 +195,7 @@ _crypto_core_ristretto255_random 0 1
_crypto_core_ristretto255_scalar_add 0 1
_crypto_core_ristretto255_scalar_complement 0 1
_crypto_core_ristretto255_scalar_invert 0 1
_crypto_core_ristretto255_scalar_is_canonical 0 1
_crypto_core_ristretto255_scalar_mul 0 1
_crypto_core_ristretto255_scalar_negate 0 1
_crypto_core_ristretto255_scalar_random 0 1
File diff suppressed because one or more lines are too long
@@ -271,6 +271,12 @@ crypto_core_ed25519_scalar_reduce(unsigned char *r,
sodium_memzero(t, sizeof t);
}
int
crypto_core_ed25519_scalar_is_canonical(const unsigned char *s)
{
return sc25519_is_canonical(s);
}
size_t
crypto_core_ed25519_bytes(void)
{
@@ -131,6 +131,12 @@ crypto_core_ristretto255_scalar_reduce(unsigned char *r,
crypto_core_ed25519_scalar_reduce(r, s);
}
int
crypto_core_ristretto255_scalar_is_canonical(const unsigned char *s)
{
return sc25519_is_canonical(s);
}
size_t
crypto_core_ristretto255_bytes(void)
{
@@ -101,6 +101,10 @@ SODIUM_EXPORT
void crypto_core_ed25519_scalar_reduce(unsigned char *r, const unsigned char *s)
__attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_core_ed25519_scalar_is_canonical(const unsigned char *s)
__attribute__ ((nonnull));
#ifdef __cplusplus
}
#endif
@@ -93,6 +93,10 @@ void crypto_core_ristretto255_scalar_reduce(unsigned char *r,
const unsigned char *s)
__attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_core_ristretto255_scalar_is_canonical(const unsigned char *s)
__attribute__ ((nonnull));
#ifdef __cplusplus
}
#endif
+2
View File
@@ -200,6 +200,7 @@ crypto_core_ed25519_random
crypto_core_ed25519_scalar_add
crypto_core_ed25519_scalar_complement
crypto_core_ed25519_scalar_invert
crypto_core_ed25519_scalar_is_canonical
crypto_core_ed25519_scalar_mul
crypto_core_ed25519_scalar_negate
crypto_core_ed25519_scalar_random
@@ -228,6 +229,7 @@ crypto_core_ristretto255_random
crypto_core_ristretto255_scalar_add
crypto_core_ristretto255_scalar_complement
crypto_core_ristretto255_scalar_invert
crypto_core_ristretto255_scalar_is_canonical
crypto_core_ristretto255_scalar_mul
crypto_core_ristretto255_scalar_negate
crypto_core_ristretto255_scalar_random