Merge pull request #113 from lfcrypto/wolfssl

add check of ret value
pull/124/head
Jacob Barthelmeh 2015-08-06 08:50:16 -07:00
parent aa0852bf71
commit 590f3e1ca0
1 changed files with 3 additions and 1 deletions

View File

@ -112,6 +112,8 @@ int wc_ed25519_sign_msg(const byte* in, word32 inlen, byte* out,
/* step 1: create nonce to use where nonce is r in
r = H(h_b, ... ,h_2b-1,M) */
ret = wc_Sha512Hash(key->k, ED25519_KEY_SIZE, az);
if (ret != 0)
return ret;
/* apply clamp */
az[0] &= 248;
@ -130,7 +132,7 @@ int wc_ed25519_sign_msg(const byte* in, word32 inlen, byte* out,
ret = wc_Sha512Final(&sha, nonce);
if (ret != 0)
return ret;
sc_reduce(nonce);
/* step 2: computing R = rB where rB is the scalar multiplication of