From c6ca4c6ef8e7638e97012e330bb734bc2b24a8f2 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 27 Aug 2014 11:39:45 -0700 Subject: [PATCH] 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. --- .../ref/keypair_curve25519xsalsa20poly1305.c | 2 +- src/libsodium/crypto_sign/ed25519/ref10/keypair.c | 2 +- .../edwards25519sha512batch/ref/sign_edwards25519sha512batch.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c b/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c index 88183ea6..e2a03faa 100644 --- a/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c +++ b/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c @@ -22,6 +22,6 @@ int crypto_box_keypair( unsigned char *sk ) { - randombytes(sk,32); + randombytes_buf(sk,32); return crypto_scalarmult_curve25519_base(pk,sk); } diff --git a/src/libsodium/crypto_sign/ed25519/ref10/keypair.c b/src/libsodium/crypto_sign/ed25519/ref10/keypair.c index 920cf0f0..2268cd60 100644 --- a/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +++ b/src/libsodium/crypto_sign/ed25519/ref10/keypair.c @@ -32,7 +32,7 @@ int crypto_sign_keypair(unsigned char *pk, unsigned char *sk) unsigned char seed[32]; int ret; - randombytes(seed, sizeof seed); + randombytes_buf(seed, sizeof seed); ret = crypto_sign_seed_keypair(pk, sk, seed); sodium_memzero(seed, sizeof seed); diff --git a/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c b/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c index 885d7b1a..9c548dcf 100644 --- a/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c +++ b/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c @@ -13,7 +13,7 @@ int crypto_sign_keypair( sc25519 scsk; ge25519 gepk; - randombytes(sk, 32); + randombytes_buf(sk, 32); crypto_hash_sha512(sk, sk, 32); sk[0] &= 248; sk[31] &= 127;