add missing space after comma
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
diff --git a/bn_mp_exteuclid.c b/bn_mp_exteuclid.c
index 3c9612e..c238b7e 100644
--- a/bn_mp_exteuclid.c
+++ b/bn_mp_exteuclid.c
@@ -20,7 +20,7 @@
*/
int mp_exteuclid(mp_int *a, mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3)
{
- mp_int u1,u2,u3,v1,v2,v3,t1,t2,t3,q,tmp;
+ mp_int u1, u2, u3, v1, v2, v3, t1, t2, t3, q, tmp;
int err;
if ((err = mp_init_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL)) != MP_OKAY) {
diff --git a/bn_mp_get_int.c b/bn_mp_get_int.c
index 5c820f8..07da758 100644
--- a/bn_mp_get_int.c
+++ b/bn_mp_get_int.c
@@ -26,13 +26,13 @@ unsigned long mp_get_int(mp_int * a)
}
/* get number of digits of the lsb we have to read */
- i = MIN(a->used,(int)(((sizeof(unsigned long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
+ i = MIN(a->used, (int)(((sizeof(unsigned long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
/* get most significant digit of result */
- res = DIGIT(a,i);
+ res = DIGIT(a, i);
while (--i >= 0) {
- res = (res << DIGIT_BIT) | DIGIT(a,i);
+ res = (res << DIGIT_BIT) | DIGIT(a, i);
}
/* force result to 32-bits always so it is consistent on non 32-bit platforms */
diff --git a/bn_mp_get_long.c b/bn_mp_get_long.c
index 7c3d0fe..e9ff4d4 100644
--- a/bn_mp_get_long.c
+++ b/bn_mp_get_long.c
@@ -26,14 +26,14 @@ unsigned long mp_get_long(mp_int * a)
}
/* get number of digits of the lsb we have to read */
- i = MIN(a->used,(int)(((sizeof(unsigned long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
+ i = MIN(a->used, (int)(((sizeof(unsigned long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
/* get most significant digit of result */
- res = DIGIT(a,i);
+ res = DIGIT(a, i);
#if (ULONG_MAX != 0xffffffffuL) || (DIGIT_BIT < 32)
while (--i >= 0) {
- res = (res << DIGIT_BIT) | DIGIT(a,i);
+ res = (res << DIGIT_BIT) | DIGIT(a, i);
}
#endif
return res;
diff --git a/bn_mp_get_long_long.c b/bn_mp_get_long_long.c
index 4b959e6..1e194d0 100644
--- a/bn_mp_get_long_long.c
+++ b/bn_mp_get_long_long.c
@@ -26,14 +26,14 @@ unsigned long long mp_get_long_long (mp_int * a)
}
/* get number of digits of the lsb we have to read */
- i = MIN(a->used,(int)(((sizeof(unsigned long long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
+ i = MIN(a->used, (int)(((sizeof(unsigned long long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
/* get most significant digit of result */
- res = DIGIT(a,i);
+ res = DIGIT(a, i);
#if DIGIT_BIT < 64
while (--i >= 0) {
- res = (res << DIGIT_BIT) | DIGIT(a,i);
+ res = (res << DIGIT_BIT) | DIGIT(a, i);
}
#endif
return res;
diff --git a/bn_mp_is_square.c b/bn_mp_is_square.c
index 10f8816..8666b0b 100644
--- a/bn_mp_is_square.c
+++ b/bn_mp_is_square.c
@@ -38,7 +38,7 @@ static const char rem_105[105] = {
};
/* Store non-zero to ret if arg is square, and zero if not */
-int mp_is_square(mp_int *arg,int *ret)
+int mp_is_square(mp_int *arg, int *ret)
{
int res;
mp_digit c;
@@ -58,12 +58,12 @@ int mp_is_square(mp_int *arg,int *ret)
}
/* First check mod 128 (suppose that DIGIT_BIT is at least 7) */
- if (rem_128[127 & DIGIT(arg,0)] == 1) {
+ if (rem_128[127 & DIGIT(arg, 0)] == 1) {
return MP_OKAY;
}
/* Next check mod 105 (3*5*7) */
- if ((res = mp_mod_d(arg,105,&c)) != MP_OKAY) {
+ if ((res = mp_mod_d(arg, 105, &c)) != MP_OKAY) {
return res;
}
if (rem_105[c] == 1) {
@@ -71,10 +71,10 @@ int mp_is_square(mp_int *arg,int *ret)
}
- if ((res = mp_init_set_int(&t,11L*13L*17L*19L*23L*29L*31L)) != MP_OKAY) {
+ if ((res = mp_init_set_int(&t, 11L*13L*17L*19L*23L*29L*31L)) != MP_OKAY) {
return res;
}
- if ((res = mp_mod(arg,&t,&t)) != MP_OKAY) {
+ if ((res = mp_mod(arg, &t, &t)) != MP_OKAY) {
goto ERR;
}
r = mp_get_int(&t);
@@ -91,14 +91,14 @@ int mp_is_square(mp_int *arg,int *ret)
if (((1L<<(r%31)) & 0x6DE2B848L) != 0L) goto ERR;
/* Final check - is sqr(sqrt(arg)) == arg ? */
- if ((res = mp_sqrt(arg,&t)) != MP_OKAY) {
+ if ((res = mp_sqrt(arg, &t)) != MP_OKAY) {
goto ERR;
}
- if ((res = mp_sqr(&t,&t)) != MP_OKAY) {
+ if ((res = mp_sqr(&t, &t)) != MP_OKAY) {
goto ERR;
}
- *ret = (mp_cmp_mag(&t,arg) == MP_EQ) ? MP_YES : MP_NO;
+ *ret = (mp_cmp_mag(&t, arg) == MP_EQ) ? MP_YES : MP_NO;
ERR:mp_clear(&t);
return res;
}
diff --git a/bn_mp_sqrt.c b/bn_mp_sqrt.c
index 31ab214..6adb2fb 100644
--- a/bn_mp_sqrt.c
+++ b/bn_mp_sqrt.c
@@ -19,7 +19,7 @@
int mp_sqrt(mp_int *arg, mp_int *ret)
{
int res;
- mp_int t1,t2;
+ mp_int t1, t2;
/* must be positive */
if (arg->sign == MP_NEG) {
@@ -41,33 +41,33 @@ int mp_sqrt(mp_int *arg, mp_int *ret)
}
/* First approx. (not very bad for large arg) */
- mp_rshd (&t1,t1.used/2);
+ mp_rshd (&t1, t1.used/2);
/* t1 > 0 */
- if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) {
+ if ((res = mp_div(arg, &t1, &t2, NULL)) != MP_OKAY) {
goto E1;
}
- if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) {
+ if ((res = mp_add(&t1, &t2, &t1)) != MP_OKAY) {
goto E1;
}
- if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) {
+ if ((res = mp_div_2(&t1, &t1)) != MP_OKAY) {
goto E1;
}
/* And now t1 > sqrt(arg) */
do {
- if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) {
+ if ((res = mp_div(arg, &t1, &t2, NULL)) != MP_OKAY) {
goto E1;
}
- if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) {
+ if ((res = mp_add(&t1, &t2, &t1)) != MP_OKAY) {
goto E1;
}
- if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) {
+ if ((res = mp_div_2(&t1, &t1)) != MP_OKAY) {
goto E1;
}
/* t1 >= sqrt(arg) >= t2 at this point */
- } while (mp_cmp_mag(&t1,&t2) == MP_GT);
+ } while (mp_cmp_mag(&t1, &t2) == MP_GT);
- mp_exch(&t1,ret);
+ mp_exch(&t1, ret);
E1: mp_clear(&t2);
E2: mp_clear(&t1);
diff --git a/tommath.h b/tommath.h
index 80bae69..ff57218 100644
--- a/tommath.h
+++ b/tommath.h
@@ -169,9 +169,9 @@ typedef struct {
typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
-#define USED(m) ((m)->used)
-#define DIGIT(m,k) ((m)->dp[(k)])
-#define SIGN(m) ((m)->sign)
+#define USED(m) ((m)->used)
+#define DIGIT(m, k) ((m)->dp[(k)])
+#define SIGN(m) ((m)->sign)
/* error code to char* string */
const char *mp_error_to_string(int code);
diff --git a/tommath_private.h b/tommath_private.h
index aeda684..b4c2d89 100644
--- a/tommath_private.h
+++ b/tommath_private.h
@@ -19,11 +19,11 @@
#include <ctype.h>
#ifndef MIN
- #define MIN(x,y) (((x) < (y)) ? (x) : (y))
+ #define MIN(x, y) (((x) < (y)) ? (x) : (y))
#endif
#ifndef MAX
- #define MAX(x,y) (((x) > (y)) ? (x) : (y))
+ #define MAX(x, y) (((x) > (y)) ? (x) : (y))
#endif
#ifdef __cplusplus