randombytes() -> randombytes_buf()

Since randombytes() wraps randombytes_buf(), that's one more function
the linker can strip out until it's actually used by the app.
This commit is contained in:
Frank Denis
2014-08-27 11:39:45 -07:00
parent 7c7f1cfacc
commit c6ca4c6ef8
3 changed files with 3 additions and 3 deletions
@@ -22,6 +22,6 @@ int crypto_box_keypair(
unsigned char *sk unsigned char *sk
) )
{ {
randombytes(sk,32); randombytes_buf(sk,32);
return crypto_scalarmult_curve25519_base(pk,sk); return crypto_scalarmult_curve25519_base(pk,sk);
} }
@@ -32,7 +32,7 @@ int crypto_sign_keypair(unsigned char *pk, unsigned char *sk)
unsigned char seed[32]; unsigned char seed[32];
int ret; int ret;
randombytes(seed, sizeof seed); randombytes_buf(seed, sizeof seed);
ret = crypto_sign_seed_keypair(pk, sk, seed); ret = crypto_sign_seed_keypair(pk, sk, seed);
sodium_memzero(seed, sizeof seed); sodium_memzero(seed, sizeof seed);
@@ -13,7 +13,7 @@ int crypto_sign_keypair(
sc25519 scsk; sc25519 scsk;
ge25519 gepk; ge25519 gepk;
randombytes(sk, 32); randombytes_buf(sk, 32);
crypto_hash_sha512(sk, sk, 32); crypto_hash_sha512(sk, sk, 32);
sk[0] &= 248; sk[0] &= 248;
sk[31] &= 127; sk[31] &= 127;