Some style fixes
authorMatt Caswell <matt@openssl.org>
Mon, 12 Feb 2018 14:03:36 +0000 (14:03 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 20 Feb 2018 12:59:30 +0000 (12:59 +0000)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5105)

crypto/ec/curve448/eddsa.c
crypto/ec/curve448/f_generic.c

index 22b70c3c5aa95155622320e0a94525e9b3a9da09..aac8a9e728669908b92d48b2bef61bfa8b2eb308 100644 (file)
@@ -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));
index e779f223355eda9573735742992960e8fd434c2d..81c75761a8fddc34d19243b5bf34f8db8653c36c 100644 (file)
@@ -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);
 }