Remove a strict aliasing issue with pre-computed curve448 constants
[openssl.git] / crypto / ec / curve448 / f_generic.c
index 2fa97e5aa50285def6aecd09844548a7f3f6fe17..341eb3f3b04940df958a1f939fab528b1e60ab0a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright 2015-2016 Cryptography Research, Inc.
  *
  * Licensed under the OpenSSL license (the "License").  You may not use
@@ -46,6 +46,7 @@ void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_hibit)
 mask_t gf_hibit(const gf x)
 {
     gf y;
+
     gf_add(y, x, x);
     gf_strong_reduce(y);
     return 0 - (y->limb[0] & 1);
@@ -55,6 +56,7 @@ mask_t gf_hibit(const gf x)
 mask_t gf_lobit(const gf x)
 {
     gf y;
+
     gf_copy(y, x);
     gf_strong_reduce(y);
     return 0 - (y->limb[0] & 1);
@@ -159,9 +161,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);
 }
@@ -169,6 +170,7 @@ mask_t gf_eq(const gf a, const gf b)
 mask_t gf_isr(gf a, const gf x)
 {
     gf L0, L1, L2;
+
     gf_sqr(L1, x);
     gf_mul(L2, x, L1);
     gf_sqr(L1, L2);