diff --git a/src/libsodium/crypto_core/ed25519/core_ed25519.c b/src/libsodium/crypto_core/ed25519/core_ed25519.c index 430ee75f..1bcf5022 100644 --- a/src/libsodium/crypto_core/ed25519/core_ed25519.c +++ b/src/libsodium/crypto_core/ed25519/core_ed25519.c @@ -65,3 +65,15 @@ crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r) return - ge25519_has_small_order(p); } + +size_t +crypto_core_ed25519_bytes(void) +{ + return crypto_core_ed25519_BYTES; +} + +size_t +crypto_core_ed25519_uniformbytes(void) +{ + return crypto_core_ed25519_UNIFORMBYTES; +} diff --git a/src/libsodium/include/sodium/crypto_core_ed25519.h b/src/libsodium/include/sodium/crypto_core_ed25519.h index f6b5820f..1536294b 100644 --- a/src/libsodium/include/sodium/crypto_core_ed25519.h +++ b/src/libsodium/include/sodium/crypto_core_ed25519.h @@ -9,7 +9,12 @@ extern "C" { #endif #define crypto_core_ed25519_BYTES 32 +SODIUM_EXPORT +size_t crypto_core_ed25519_bytes(void); + #define crypto_core_ed25519_UNIFORMBYTES 32 +SODIUM_EXPORT +size_t crypto_core_ed25519_uniformbytes(void); SODIUM_EXPORT int crypto_core_ed25519_is_valid_point(const unsigned char *p); diff --git a/test/default/core_ed25519.c b/test/default/core_ed25519.c index ed7aeff2..cdd82199 100644 --- a/test/default/core_ed25519.c +++ b/test/default/core_ed25519.c @@ -103,6 +103,9 @@ main(void) sodium_free(p); sodium_free(h); + assert(crypto_core_ed25519_BYTES == crypto_core_ed25519_bytes()); + assert(crypto_core_ed25519_UNIFORMBYTES == crypto_core_ed25519_uniformbytes()); + printf("OK\n"); return 0;