diff options
Diffstat (limited to 'crypto/ec/curve448/eddsa.c')
-rw-r--r-- | crypto/ec/curve448/eddsa.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/ec/curve448/eddsa.c b/crypto/ec/curve448/eddsa.c index 85565a8dfb..909413a535 100644 --- a/crypto/ec/curve448/eddsa.c +++ b/crypto/ec/curve448/eddsa.c @@ -63,8 +63,7 @@ static c448_error_t hash_init_with_dom(EVP_MD_CTX *hashctx, uint8_t prehashed, if (!EVP_DigestInit_ex(hashctx, EVP_shake256(), NULL) || !EVP_DigestUpdate(hashctx, dom_s, strlen(dom_s)) || !EVP_DigestUpdate(hashctx, dom, sizeof(dom)) - || (context_len > 0 - && !EVP_DigestUpdate(hashctx, context, context_len))) + || !EVP_DigestUpdate(hashctx, context, context_len)) return C448_FAILURE; return C448_SUCCESS; @@ -161,8 +160,7 @@ c448_error_t c448_ed448_sign( || !EVP_DigestUpdate(hashctx, expanded + EDDSA_448_PRIVATE_BYTES, EDDSA_448_PRIVATE_BYTES) - || (message_len > 0 - && !EVP_DigestUpdate(hashctx, message, message_len))) { + || !EVP_DigestUpdate(hashctx, message, message_len)) { OPENSSL_cleanse(expanded, sizeof(expanded)); goto err; } @@ -202,8 +200,7 @@ c448_error_t c448_ed448_sign( if (!hash_init_with_dom(hashctx, prehashed, 0, context, context_len) || !EVP_DigestUpdate(hashctx, nonce_point, sizeof(nonce_point)) || !EVP_DigestUpdate(hashctx, pubkey, EDDSA_448_PUBLIC_BYTES) - || (message_len > 0 - && !EVP_DigestUpdate(hashctx, message, message_len)) + || !EVP_DigestUpdate(hashctx, message, message_len) || !EVP_DigestFinalXOF(hashctx, challenge, sizeof(challenge))) goto err; |