1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 12:36:01 -07:00

Export constants

This commit is contained in:
Frank Denis 2017-11-15 01:47:54 +01:00
parent 1e06b32f45
commit 3d8889560e
3 changed files with 20 additions and 0 deletions

View File

@ -65,3 +65,15 @@ crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r)
return - ge25519_has_small_order(p); 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;
}

View File

@ -9,7 +9,12 @@ extern "C" {
#endif #endif
#define crypto_core_ed25519_BYTES 32 #define crypto_core_ed25519_BYTES 32
SODIUM_EXPORT
size_t crypto_core_ed25519_bytes(void);
#define crypto_core_ed25519_UNIFORMBYTES 32 #define crypto_core_ed25519_UNIFORMBYTES 32
SODIUM_EXPORT
size_t crypto_core_ed25519_uniformbytes(void);
SODIUM_EXPORT SODIUM_EXPORT
int crypto_core_ed25519_is_valid_point(const unsigned char *p); int crypto_core_ed25519_is_valid_point(const unsigned char *p);

View File

@ -103,6 +103,9 @@ main(void)
sodium_free(p); sodium_free(p);
sodium_free(h); sodium_free(h);
assert(crypto_core_ed25519_BYTES == crypto_core_ed25519_bytes());
assert(crypto_core_ed25519_UNIFORMBYTES == crypto_core_ed25519_uniformbytes());
printf("OK\n"); printf("OK\n");
return 0; return 0;