Further style changes to curve448 code
authorMatt Caswell <matt@openssl.org>
Mon, 12 Feb 2018 13:56:50 +0000 (13:56 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 20 Feb 2018 12:59:31 +0000 (12:59 +0000)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5105)

crypto/ec/curve448/curve448.c
crypto/ec/curve448/word.h

index f34dfcce6c2538adf5a7e7a2f5370bac5fc7ba98..14599769815227e924c20c8f28d3638cb1ced8f7 100644 (file)
@@ -22,7 +22,8 @@
 #define C448_WNAF_FIXED_TABLE_BITS 5
 #define C448_WNAF_VAR_TABLE_BITS 3
 
-static const int EDWARDS_D = -39081;
+#define EDWARDS_D       (-39081)
+
 static const curve448_scalar_t precomputed_scalarmul_adjustment = {
     {
         {
index 01c977993890dbd7cf8700ecc6faa61ab521ca7e..179d70b853c00bb4aa740c32b06346836046ee5c 100644 (file)
 # define HEADER_WORD_H
 
 # include <string.h>
-
 # include <assert.h>
+# include <stdlib.h>
 # include <openssl/e_os2.h>
 # include "arch_intrinsics.h"
-
 # include "curve448utils.h"
-# include <stdlib.h>
 
 # if defined(__ARM_NEON__)
 #  include <arm_neon.h>
@@ -56,7 +54,7 @@ typedef int64_t dsword_t;
 # if C448_WORD_BITS == 64
 #  define SC_LIMB(x) (x)
 # elif C448_WORD_BITS == 32
-#  define SC_LIMB(x) ((uint32_t)x),(x >> 32)
+#  define SC_LIMB(x) ((uint32_t)(x)),((x) >> 32)
 # else
 #  error "For now we only support 32- and 64-bit architectures."
 # endif