Commit cdbb9ca9250041e757345657a537a46027d7a916

Francois Perrad 2017-08-30T19:03:58

fix format

diff --git a/bn_mp_dr_setup.c b/bn_mp_dr_setup.c
index 6d3f76d..97f31ba 100644
--- a/bn_mp_dr_setup.c
+++ b/bn_mp_dr_setup.c
@@ -21,8 +21,7 @@ void mp_dr_setup(mp_int *a, mp_digit *d)
    /* the casts are required if DIGIT_BIT is one less than
     * the number of bits in a mp_digit [e.g. DIGIT_BIT==31]
     */
-   *d = (mp_digit)((((mp_word)1) << ((mp_word)DIGIT_BIT)) -
-        ((mp_word)a->dp[0]));
+   *d = (mp_digit)((((mp_word)1) << ((mp_word)DIGIT_BIT)) - ((mp_word)a->dp[0]));
 }
 
 #endif
diff --git a/bn_mp_export.c b/bn_mp_export.c
index d86a7f6..95cf87d 100644
--- a/bn_mp_export.c
+++ b/bn_mp_export.c
@@ -52,11 +52,9 @@ int mp_export(void* rop, size_t* countp, int order, size_t size,
 
    for (i = 0; i < count; ++i) {
       for (j = 0; j < size; ++j) {
-         unsigned char* byte = (
-            (unsigned char*)rop +
-            (((order == -1) ? i : ((count - 1) - i)) * size) +
-            ((endian == -1) ? j : ((size - 1) - j))
-         );
+         unsigned char *byte = (unsigned char *)rop +
+                               (((order == -1) ? i : ((count - 1) - i)) * size) +
+                               ((endian == -1) ? j : ((size - 1) - j));
 
          if (j >= (size - nail_bytes)) {
             *byte = 0;
diff --git a/bn_mp_import.c b/bn_mp_import.c
index 968a286..f748fab 100644
--- a/bn_mp_import.c
+++ b/bn_mp_import.c
@@ -45,14 +45,11 @@ int mp_import(mp_int* rop, size_t count, int order, size_t size,
 
    for (i = 0; i < count; ++i) {
       for (j = 0; j < (size - nail_bytes); ++j) {
-         unsigned char byte = *(
-               (unsigned char*)op +
-               (((order == 1) ? i : ((count - 1) - i)) * size) +
-               ((endian == 1) ? (j + nail_bytes) : (((size - 1) - j) - nail_bytes))
-            );
+         unsigned char byte = *((unsigned char *)op +
+                                (((order == 1) ? i : ((count - 1) - i)) * size) +
+                                ((endian == 1) ? (j + nail_bytes) : (((size - 1) - j) - nail_bytes)));
 
-         if (
-            (result = mp_mul_2d(rop, ((j == 0) ? (8 - odd_nails) : 8), rop)) != MP_OKAY) {
+         if ((result = mp_mul_2d(rop, ((j == 0) ? (8 - odd_nails) : 8), rop)) != MP_OKAY) {
             return result;
          }