format with astyle (step 6)

This commit is contained in:
Francois Perrad 2017-08-30 20:23:46 +02:00
parent e2cd147a46
commit 2344bcea3a
20 changed files with 1742 additions and 1742 deletions

View File

@ -100,7 +100,7 @@ LBL_ERR:
* The overall algorithm is as described as * The overall algorithm is as described as
* 14.20 from HAC but fixed to treat these cases. * 14.20 from HAC but fixed to treat these cases.
*/ */
int mp_div (mp_int * a, mp_int * b, mp_int * c, mp_int * d) int mp_div(mp_int *a, mp_int *b, mp_int *c, mp_int *d)
{ {
mp_int q, x, y, t1, t2; mp_int q, x, y, t1, t2;
int res, n, t, i, norm, neg; int res, n, t, i, norm, neg;

View File

@ -39,7 +39,7 @@ int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int redmode)
* one of many reduction algorithms without modding the guts of * one of many reduction algorithms without modding the guts of
* the code with if statements everywhere. * the code with if statements everywhere.
*/ */
int (*redux)(mp_int*,mp_int*,mp_digit); int (*redux)(mp_int *,mp_int *,mp_digit);
/* find window size */ /* find window size */
x = mp_count_bits(X); x = mp_count_bits(X);

View File

@ -86,7 +86,7 @@ int mp_jacobi(mp_int *a, mp_int *n, int *c)
} }
/* step 5. if p == 3 (mod 4) *and* a1 == 3 (mod 4) then s = -s */ /* step 5. if p == 3 (mod 4) *and* a1 == 3 (mod 4) then s = -s */
if ( ((n->dp[0] & 3) == 3) && ((a1.dp[0] & 3) == 3)) { if (((n->dp[0] & 3) == 3) && ((a1.dp[0] & 3) == 3)) {
s = -s; s = -s;
} }

View File

@ -16,13 +16,13 @@
*/ */
#if MP_GEN_RANDOM_MAX == 0xffffffff #if MP_GEN_RANDOM_MAX == 0xffffffff
#define MP_GEN_RANDOM_SHIFT 32 #define MP_GEN_RANDOM_SHIFT 32
#elif MP_GEN_RANDOM_MAX == 32767 #elif MP_GEN_RANDOM_MAX == 32767
/* SHRT_MAX */ /* SHRT_MAX */
#define MP_GEN_RANDOM_SHIFT 15 #define MP_GEN_RANDOM_SHIFT 15
#elif MP_GEN_RANDOM_MAX == 2147483647 #elif MP_GEN_RANDOM_MAX == 2147483647
/* INT_MAX */ /* INT_MAX */
#define MP_GEN_RANDOM_SHIFT 31 #define MP_GEN_RANDOM_SHIFT 31
#elif !defined(MP_GEN_RANDOM_SHIFT) #elif !defined(MP_GEN_RANDOM_SHIFT)
#error Thou shalt define their own valid MP_GEN_RANDOM_SHIFT #error Thou shalt define their own valid MP_GEN_RANDOM_SHIFT
#endif #endif

View File

@ -25,7 +25,7 @@ int s_mp_exptmod(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int redmode)
mp_int M[TAB_SIZE], res, mu; mp_int M[TAB_SIZE], res, mu;
mp_digit buf; mp_digit buf;
int err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize; int err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize;
int (*redux)(mp_int*,mp_int*,mp_int*); int (*redux)(mp_int *,mp_int *,mp_int *);
/* find window size */ /* find window size */
x = mp_count_bits(X); x = mp_count_bits(X);