Zero the nonce in crypto_sign()

This commit is contained in:
Frank Denis 2014-08-05 14:08:00 -07:00
parent eae4add8de
commit b06951dd20

View File

@ -5,6 +5,7 @@
#include "crypto_hash_sha512.h"
#include "ge.h"
#include "sc.h"
#include "utils.h"
int
crypto_sign_detached(unsigned char *sig, unsigned long long *siglen,
@ -44,6 +45,8 @@ crypto_sign_detached(unsigned char *sig, unsigned long long *siglen,
sc_reduce(hram);
sc_muladd(sig + 32, hram, az, nonce);
sodium_memzero(nonce, sizeof nonce);
if (siglen != NULL) {
*siglen = 64U;
}