From 590f3e1ca04c54ddc1604cf1f6b453e17df03cbd Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 6 Aug 2015 08:50:16 -0700 Subject: [PATCH] Merge pull request #113 from lfcrypto/wolfssl add check of ret value --- wolfcrypt/src/ed25519.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index 7ddfc3af2..e3d6d06db 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -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