summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-02-12 14:03:36 +0000
committerMatt Caswell <matt@openssl.org>2018-02-20 12:59:30 +0000
commit04ebd4e17e1de9a5baa65113cce57817b05ae6f8 (patch)
tree689889f2dccd3deb4f5f536f382154163cd2fb15
parente4118223184e0ea421fdfa38868c3f2ed16648c9 (diff)
Some style fixes
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/5105)
-rw-r--r--crypto/ec/curve448/eddsa.c19
-rw-r--r--crypto/ec/curve448/f_generic.c3
2 files changed, 11 insertions, 11 deletions
diff --git a/crypto/ec/curve448/eddsa.c b/crypto/ec/curve448/eddsa.c
index 22b70c3c5a..aac8a9e728 100644
--- a/crypto/ec/curve448/eddsa.c
+++ b/crypto/ec/curve448/eddsa.c
@@ -29,8 +29,8 @@ static c448_error_t oneshot_hash(uint8_t *out, size_t outlen,
return C448_FAILURE;
if (!EVP_DigestInit_ex(hashctx, EVP_shake256(), NULL)
- || !EVP_DigestUpdate(hashctx, in, inlen)
- || !EVP_DigestFinalXOF(hashctx, out, outlen)) {
+ || !EVP_DigestUpdate(hashctx, in, inlen)
+ || !EVP_DigestFinalXOF(hashctx, out, outlen)) {
EVP_MD_CTX_free(hashctx);
return C448_FAILURE;
}
@@ -69,9 +69,9 @@ static c448_error_t hash_init_with_dom(EVP_MD_CTX *hashctx, uint8_t prehashed,
return C448_FAILURE;
if (!EVP_DigestInit_ex(hashctx, EVP_shake256(), NULL)
- || !EVP_DigestUpdate(hashctx, dom_s, strlen(dom_s))
- || !EVP_DigestUpdate(hashctx, dom, sizeof(dom))
- || !EVP_DigestUpdate(hashctx, context, context_len))
+ || !EVP_DigestUpdate(hashctx, dom_s, strlen(dom_s))
+ || !EVP_DigestUpdate(hashctx, dom, sizeof(dom))
+ || !EVP_DigestUpdate(hashctx, context, context_len))
return C448_FAILURE;
return C448_SUCCESS;
@@ -165,10 +165,11 @@ c448_error_t c448_ed448_sign(
/* Hash to create the nonce */
if (!hash_init_with_dom(hashctx, prehashed, 0, context, context_len)
- || !EVP_DigestUpdate(hashctx, expanded + EDDSA_448_PRIVATE_BYTES,
- EDDSA_448_PRIVATE_BYTES)
- || !EVP_DigestUpdate(hashctx, message, message_len)) {
- OPENSSL_cleanse(expanded, sizeof(expanded));
+ || !EVP_DigestUpdate(hashctx,
+ expanded + EDDSA_448_PRIVATE_BYTES,
+ EDDSA_448_PRIVATE_BYTES)
+ || !EVP_DigestUpdate(hashctx, message, message_len)) {
+ OPENSSL_cleanse(expanded, sizeof(expanded));
goto err;
}
OPENSSL_cleanse(expanded, sizeof(expanded));
diff --git a/crypto/ec/curve448/f_generic.c b/crypto/ec/curve448/f_generic.c
index e779f22335..81c75761a8 100644
--- a/crypto/ec/curve448/f_generic.c
+++ b/crypto/ec/curve448/f_generic.c
@@ -159,9 +159,8 @@ mask_t gf_eq(const gf a, const gf b)
gf_sub(c, a, b);
gf_strong_reduce(c);
- for (i = 0; i < NLIMBS; i++) {
+ for (i = 0; i < NLIMBS; i++)
ret |= c->limb[LIMBPERM(i)];
- }
return word_is_zero(ret);
}