From 45771cc91c37b876e60d775cffb8e5b91a3d1f3f Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Wed, 30 Aug 2017 19:07:12 +0200 Subject: [PATCH] format with astyle (step 1) --- astylerc | 27 +++++++++++++++++++++++++++ bn_fast_mp_invmod.c | 2 +- bn_fast_mp_montgomery_reduce.c | 2 +- bn_fast_s_mp_mul_digs.c | 2 +- bn_fast_s_mp_mul_high_digs.c | 2 +- bn_fast_s_mp_sqr.c | 2 +- bn_mp_2expt.c | 2 +- bn_mp_abs.c | 2 +- bn_mp_add.c | 2 +- bn_mp_add_d.c | 2 +- bn_mp_addmod.c | 2 +- bn_mp_and.c | 2 +- bn_mp_clamp.c | 2 +- bn_mp_clear.c | 2 +- bn_mp_cmp.c | 2 +- bn_mp_cmp_d.c | 2 +- bn_mp_cmp_mag.c | 2 +- bn_mp_copy.c | 2 +- bn_mp_count_bits.c | 2 +- bn_mp_div.c | 2 +- bn_mp_div_2.c | 2 +- bn_mp_div_2d.c | 2 +- bn_mp_div_3.c | 2 +- bn_mp_div_d.c | 2 +- bn_mp_dr_reduce.c | 2 +- bn_mp_exch.c | 2 +- bn_mp_export.c | 5 +++-- bn_mp_expt_d.c | 2 +- bn_mp_expt_d_ex.c | 2 +- bn_mp_exptmod.c | 2 +- bn_mp_exptmod_fast.c | 2 +- bn_mp_gcd.c | 2 +- bn_mp_get_int.c | 2 +- bn_mp_get_long.c | 2 +- bn_mp_get_long_long.c | 2 +- bn_mp_grow.c | 2 +- bn_mp_import.c | 5 +++-- bn_mp_init.c | 2 +- bn_mp_init_copy.c | 2 +- bn_mp_init_set.c | 2 +- bn_mp_init_set_int.c | 2 +- bn_mp_init_size.c | 2 +- bn_mp_invmod.c | 2 +- bn_mp_invmod_slow.c | 2 +- bn_mp_jacobi.c | 2 +- bn_mp_karatsuba_mul.c | 2 +- bn_mp_karatsuba_sqr.c | 2 +- bn_mp_lcm.c | 2 +- bn_mp_lshd.c | 2 +- bn_mp_mod.c | 2 +- bn_mp_mod_2d.c | 2 +- bn_mp_mod_d.c | 2 +- bn_mp_montgomery_calc_normalization.c | 2 +- bn_mp_montgomery_reduce.c | 2 +- bn_mp_montgomery_setup.c | 2 +- bn_mp_mul.c | 2 +- bn_mp_mul_2.c | 2 +- bn_mp_mul_2d.c | 2 +- bn_mp_mul_d.c | 2 +- bn_mp_mulmod.c | 2 +- bn_mp_n_root.c | 2 +- bn_mp_n_root_ex.c | 2 +- bn_mp_neg.c | 2 +- bn_mp_or.c | 2 +- bn_mp_prime_fermat.c | 2 +- bn_mp_prime_is_divisible.c | 2 +- bn_mp_prime_is_prime.c | 2 +- bn_mp_prime_miller_rabin.c | 2 +- bn_mp_radix_size.c | 2 +- bn_mp_rand.c | 2 +- bn_mp_read_radix.c | 2 +- bn_mp_read_signed_bin.c | 2 +- bn_mp_read_unsigned_bin.c | 2 +- bn_mp_reduce.c | 2 +- bn_mp_reduce_setup.c | 2 +- bn_mp_rshd.c | 2 +- bn_mp_set.c | 2 +- bn_mp_set_int.c | 2 +- bn_mp_shrink.c | 2 +- bn_mp_signed_bin_size.c | 2 +- bn_mp_sqr.c | 2 +- bn_mp_sqrmod.c | 2 +- bn_mp_sub.c | 2 +- bn_mp_sub_d.c | 2 +- bn_mp_submod.c | 2 +- bn_mp_to_signed_bin.c | 2 +- bn_mp_to_signed_bin_n.c | 2 +- bn_mp_to_unsigned_bin.c | 2 +- bn_mp_to_unsigned_bin_n.c | 2 +- bn_mp_toradix.c | 2 +- bn_mp_toradix_n.c | 2 +- bn_mp_unsigned_bin_size.c | 2 +- bn_mp_xor.c | 2 +- bn_mp_zero.c | 2 +- bn_reverse.c | 2 +- bn_s_mp_add.c | 2 +- bn_s_mp_exptmod.c | 2 +- bn_s_mp_mul_digs.c | 2 +- bn_s_mp_mul_high_digs.c | 2 +- bn_s_mp_sqr.c | 2 +- bn_s_mp_sub.c | 2 +- 101 files changed, 131 insertions(+), 102 deletions(-) create mode 100644 astylerc diff --git a/astylerc b/astylerc new file mode 100644 index 0000000..5d63f7a --- /dev/null +++ b/astylerc @@ -0,0 +1,27 @@ +# Artistic Style, see http://astyle.sourceforge.net/ +# full documentation, see: http://astyle.sourceforge.net/astyle.html +# +# usage: +# astyle --options=astylerc *.[ch] + +## Bracket Style Options +style=kr + +## Tab Options +indent=spaces=3 + +## Bracket Modify Options + +## Indentation Options +min-conditional-indent=0 + +## Padding Options +pad-header +unpad-paren +align-pointer=name + +## Formatting Options +break-after-logical +max-code-length=120 +convert-tabs +mode=c diff --git a/bn_fast_mp_invmod.c b/bn_fast_mp_invmod.c index 884e4b8..561ca11 100644 --- a/bn_fast_mp_invmod.c +++ b/bn_fast_mp_invmod.c @@ -21,7 +21,7 @@ * Based on slow invmod except this is optimized for the case where b is * odd as per HAC Note 14.64 on pp. 610 */ -int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c) +int fast_mp_invmod(mp_int *a, mp_int *b, mp_int *c) { mp_int x, y, u, v, B, D; int res, neg; diff --git a/bn_fast_mp_montgomery_reduce.c b/bn_fast_mp_montgomery_reduce.c index d3309d1..b80e9db 100644 --- a/bn_fast_mp_montgomery_reduce.c +++ b/bn_fast_mp_montgomery_reduce.c @@ -23,7 +23,7 @@ * * Based on Algorithm 14.32 on pp.601 of HAC. */ -int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) +int fast_mp_montgomery_reduce(mp_int *x, mp_int *n, mp_digit rho) { int ix, res, olduse; mp_word W[MP_WARRAY]; diff --git a/bn_fast_s_mp_mul_digs.c b/bn_fast_s_mp_mul_digs.c index a96af85..0088346 100644 --- a/bn_fast_s_mp_mul_digs.c +++ b/bn_fast_s_mp_mul_digs.c @@ -31,7 +31,7 @@ * Based on Algorithm 14.12 on pp.595 of HAC. * */ -int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) +int fast_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs) { int olduse, res, pa, ix, iz; mp_digit W[MP_WARRAY]; diff --git a/bn_fast_s_mp_mul_high_digs.c b/bn_fast_s_mp_mul_high_digs.c index c5cd902..c97c40b 100644 --- a/bn_fast_s_mp_mul_high_digs.c +++ b/bn_fast_s_mp_mul_high_digs.c @@ -24,7 +24,7 @@ * * Based on Algorithm 14.12 on pp.595 of HAC. */ -int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) +int fast_s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs) { int olduse, res, pa, ix, iz; mp_digit W[MP_WARRAY]; diff --git a/bn_fast_s_mp_sqr.c b/bn_fast_s_mp_sqr.c index 6905311..5e4e0de 100644 --- a/bn_fast_s_mp_sqr.c +++ b/bn_fast_s_mp_sqr.c @@ -25,7 +25,7 @@ After that loop you do the squares and add them in. */ -int fast_s_mp_sqr (mp_int * a, mp_int * b) +int fast_s_mp_sqr(mp_int *a, mp_int *b) { int olduse, res, pa, ix, iz; mp_digit W[MP_WARRAY], *tmpx; diff --git a/bn_mp_2expt.c b/bn_mp_2expt.c index 1e74337..1d2fa8a 100644 --- a/bn_mp_2expt.c +++ b/bn_mp_2expt.c @@ -20,7 +20,7 @@ * Simple algorithm which zeroes the int, grows it then just sets one bit * as required. */ -int mp_2expt (mp_int * a, int b) +int mp_2expt(mp_int *a, int b) { int res; diff --git a/bn_mp_abs.c b/bn_mp_abs.c index d50ecfe..26b55bb 100644 --- a/bn_mp_abs.c +++ b/bn_mp_abs.c @@ -19,7 +19,7 @@ * * Simple function copies the input and fixes the sign to positive */ -int mp_abs (mp_int * a, mp_int * b) +int mp_abs(mp_int *a, mp_int *b) { int res; diff --git a/bn_mp_add.c b/bn_mp_add.c index 6151395..59a19f3 100644 --- a/bn_mp_add.c +++ b/bn_mp_add.c @@ -16,7 +16,7 @@ */ /* high level addition (handles signs) */ -int mp_add (mp_int * a, mp_int * b, mp_int * c) +int mp_add(mp_int *a, mp_int *b, mp_int *c) { int sa, sb, res; diff --git a/bn_mp_add_d.c b/bn_mp_add_d.c index a355339..86bd761 100644 --- a/bn_mp_add_d.c +++ b/bn_mp_add_d.c @@ -16,7 +16,7 @@ */ /* single digit addition */ -int mp_add_d (mp_int * a, mp_digit b, mp_int * c) +int mp_add_d(mp_int *a, mp_digit b, mp_int *c) { int res, ix, oldused; mp_digit *tmpa, *tmpc, mu; diff --git a/bn_mp_addmod.c b/bn_mp_addmod.c index d71c08b..23656cb 100644 --- a/bn_mp_addmod.c +++ b/bn_mp_addmod.c @@ -16,7 +16,7 @@ */ /* d = a + b (mod c) */ -int mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) +int mp_addmod(mp_int *a, mp_int *b, mp_int *c, mp_int *d) { int res; mp_int t; diff --git a/bn_mp_and.c b/bn_mp_and.c index 48956fb..c02939e 100644 --- a/bn_mp_and.c +++ b/bn_mp_and.c @@ -16,7 +16,7 @@ */ /* AND two ints together */ -int mp_and (mp_int * a, mp_int * b, mp_int * c) +int mp_and(mp_int *a, mp_int *b, mp_int *c) { int res, ix, px; mp_int t, *x; diff --git a/bn_mp_clamp.c b/bn_mp_clamp.c index 2fbed7b..ff11e9c 100644 --- a/bn_mp_clamp.c +++ b/bn_mp_clamp.c @@ -22,7 +22,7 @@ * Typically very fast. Also fixes the sign if there * are no more leading digits */ -void mp_clamp (mp_int * a) +void mp_clamp(mp_int *a) { /* decrease used while the most significant digit is * zero. diff --git a/bn_mp_clear.c b/bn_mp_clear.c index ebb42ee..ecba74e 100644 --- a/bn_mp_clear.c +++ b/bn_mp_clear.c @@ -16,7 +16,7 @@ */ /* clear one (frees) */ -void mp_clear (mp_int * a) +void mp_clear(mp_int *a) { int i; diff --git a/bn_mp_cmp.c b/bn_mp_cmp.c index b9477a8..eabd922 100644 --- a/bn_mp_cmp.c +++ b/bn_mp_cmp.c @@ -16,7 +16,7 @@ */ /* compare two ints (signed)*/ -int mp_cmp (mp_int * a, mp_int * b) +int mp_cmp(mp_int *a, mp_int *b) { /* compare based on sign */ if (a->sign != b->sign) { diff --git a/bn_mp_cmp_d.c b/bn_mp_cmp_d.c index 3f5ebae..b685130 100644 --- a/bn_mp_cmp_d.c +++ b/bn_mp_cmp_d.c @@ -16,7 +16,7 @@ */ /* compare a digit */ -int mp_cmp_d(mp_int * a, mp_digit b) +int mp_cmp_d(mp_int *a, mp_digit b) { /* compare based on sign */ if (a->sign == MP_NEG) { diff --git a/bn_mp_cmp_mag.c b/bn_mp_cmp_mag.c index 70e3fef..2ce3fd2 100644 --- a/bn_mp_cmp_mag.c +++ b/bn_mp_cmp_mag.c @@ -16,7 +16,7 @@ */ /* compare maginitude of two ints (unsigned) */ -int mp_cmp_mag (mp_int * a, mp_int * b) +int mp_cmp_mag(mp_int *a, mp_int *b) { int n; mp_digit *tmpa, *tmpb; diff --git a/bn_mp_copy.c b/bn_mp_copy.c index e9ef6f4..de21997 100644 --- a/bn_mp_copy.c +++ b/bn_mp_copy.c @@ -16,7 +16,7 @@ */ /* copy, b = a */ -int mp_copy (mp_int * a, mp_int * b) +int mp_copy(mp_int *a, mp_int *b) { int res, n; diff --git a/bn_mp_count_bits.c b/bn_mp_count_bits.c index 5fa47ff..a57a167 100644 --- a/bn_mp_count_bits.c +++ b/bn_mp_count_bits.c @@ -16,7 +16,7 @@ */ /* returns the number of bits in an int */ -int mp_count_bits (mp_int * a) +int mp_count_bits(mp_int *a) { int r; mp_digit q; diff --git a/bn_mp_div.c b/bn_mp_div.c index df61e63..ed4f5d6 100644 --- a/bn_mp_div.c +++ b/bn_mp_div.c @@ -18,7 +18,7 @@ #ifdef BN_MP_DIV_SMALL /* slower bit-bang division... also smaller */ -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 ta, tb, tq, q; int res, n, n2; diff --git a/bn_mp_div_2.c b/bn_mp_div_2.c index cf43106..b900f67 100644 --- a/bn_mp_div_2.c +++ b/bn_mp_div_2.c @@ -16,7 +16,7 @@ */ /* b = a/2 */ -int mp_div_2(mp_int * a, mp_int * b) +int mp_div_2(mp_int *a, mp_int *b) { int x, res, oldused; diff --git a/bn_mp_div_2d.c b/bn_mp_div_2d.c index 4523737..2af5603 100644 --- a/bn_mp_div_2d.c +++ b/bn_mp_div_2d.c @@ -16,7 +16,7 @@ */ /* shift right by a certain bit count (store quotient in c, optional remainder in d) */ -int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) +int mp_div_2d(mp_int *a, int b, mp_int *c, mp_int *d) { mp_digit D, r, rr; int x, res; diff --git a/bn_mp_div_3.c b/bn_mp_div_3.c index 4721f77..20e1ceb 100644 --- a/bn_mp_div_3.c +++ b/bn_mp_div_3.c @@ -16,7 +16,7 @@ */ /* divide by three (based on routine from MPI and the GMP manual) */ -int mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) +int mp_div_3(mp_int *a, mp_int *c, mp_digit *d) { mp_int q; mp_word w, t; diff --git a/bn_mp_div_d.c b/bn_mp_div_d.c index fa80a65..9e3366e 100644 --- a/bn_mp_div_d.c +++ b/bn_mp_div_d.c @@ -34,7 +34,7 @@ static int s_is_power_of_two(mp_digit b, int *p) } /* single digit division (based on routine from MPI) */ -int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) +int mp_div_d(mp_int *a, mp_digit b, mp_int *c, mp_digit *d) { mp_int q; mp_word w; diff --git a/bn_mp_dr_reduce.c b/bn_mp_dr_reduce.c index bca4bdc..23e7d17 100644 --- a/bn_mp_dr_reduce.c +++ b/bn_mp_dr_reduce.c @@ -29,7 +29,7 @@ * * Input x must be in the range 0 <= x <= (n-1)**2 */ -int mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k) +int mp_dr_reduce(mp_int *x, mp_int *n, mp_digit k) { int err, i, m; mp_word r; diff --git a/bn_mp_exch.c b/bn_mp_exch.c index 3b023c8..fec0e7f 100644 --- a/bn_mp_exch.c +++ b/bn_mp_exch.c @@ -18,7 +18,7 @@ /* swap the elements of two integers, for cases where you can't simply swap the * mp_int pointers around */ -void mp_exch (mp_int * a, mp_int * b) +void mp_exch(mp_int *a, mp_int *b) { mp_int t; diff --git a/bn_mp_export.c b/bn_mp_export.c index 95cf87d..b69a4fb 100644 --- a/bn_mp_export.c +++ b/bn_mp_export.c @@ -18,8 +18,9 @@ /* based on gmp's mpz_export. * see http://gmplib.org/manual/Integer-Import-and-Export.html */ -int mp_export(void* rop, size_t* countp, int order, size_t size, - int endian, size_t nails, mp_int* op) { +int mp_export(void *rop, size_t *countp, int order, size_t size, + int endian, size_t nails, mp_int *op) +{ int result; size_t odd_nails, nail_bytes, i, j, bits, count; unsigned char odd_nail_mask; diff --git a/bn_mp_expt_d.c b/bn_mp_expt_d.c index a311926..a33ad52 100644 --- a/bn_mp_expt_d.c +++ b/bn_mp_expt_d.c @@ -16,7 +16,7 @@ */ /* wrapper function for mp_expt_d_ex() */ -int mp_expt_d (mp_int * a, mp_digit b, mp_int * c) +int mp_expt_d(mp_int *a, mp_digit b, mp_int *c) { return mp_expt_d_ex(a, b, c, 0); } diff --git a/bn_mp_expt_d_ex.c b/bn_mp_expt_d_ex.c index 1ac916c..c524d91 100644 --- a/bn_mp_expt_d_ex.c +++ b/bn_mp_expt_d_ex.c @@ -16,7 +16,7 @@ */ /* calculate c = a**b using a square-multiply algorithm */ -int mp_expt_d_ex (mp_int * a, mp_digit b, mp_int * c, int fast) +int mp_expt_d_ex(mp_int *a, mp_digit b, mp_int *c, int fast) { int res; unsigned int x; diff --git a/bn_mp_exptmod.c b/bn_mp_exptmod.c index 0c45444..4d3d23c 100644 --- a/bn_mp_exptmod.c +++ b/bn_mp_exptmod.c @@ -21,7 +21,7 @@ * embedded in the normal function but that wasted alot of stack space * for nothing (since 99% of the time the Montgomery code would be called) */ -int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) +int mp_exptmod(mp_int *G, mp_int *X, mp_int *P, mp_int *Y) { int dr; diff --git a/bn_mp_exptmod_fast.c b/bn_mp_exptmod_fast.c index ed3b4e4..c92df6a 100644 --- a/bn_mp_exptmod_fast.c +++ b/bn_mp_exptmod_fast.c @@ -29,7 +29,7 @@ # define TAB_SIZE 256 #endif -int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode) +int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int redmode) { mp_int M[TAB_SIZE], res; mp_digit buf, mp; diff --git a/bn_mp_gcd.c b/bn_mp_gcd.c index 8e45cb2..f2b26c7 100644 --- a/bn_mp_gcd.c +++ b/bn_mp_gcd.c @@ -16,7 +16,7 @@ */ /* Greatest Common Divisor using the binary method */ -int mp_gcd (mp_int * a, mp_int * b, mp_int * c) +int mp_gcd(mp_int *a, mp_int *b, mp_int *c) { mp_int u, v; int k, u_lsb, v_lsb, res; diff --git a/bn_mp_get_int.c b/bn_mp_get_int.c index 07da758..987b73b 100644 --- a/bn_mp_get_int.c +++ b/bn_mp_get_int.c @@ -16,7 +16,7 @@ */ /* get the lower 32-bits of an mp_int */ -unsigned long mp_get_int(mp_int * a) +unsigned long mp_get_int(mp_int *a) { int i; mp_min_u32 res; diff --git a/bn_mp_get_long.c b/bn_mp_get_long.c index e9ff4d4..7c7a9f8 100644 --- a/bn_mp_get_long.c +++ b/bn_mp_get_long.c @@ -16,7 +16,7 @@ */ /* get the lower unsigned long of an mp_int, platform dependent */ -unsigned long mp_get_long(mp_int * a) +unsigned long mp_get_long(mp_int *a) { int i; unsigned long res; diff --git a/bn_mp_get_long_long.c b/bn_mp_get_long_long.c index 1e194d0..d6bae59 100644 --- a/bn_mp_get_long_long.c +++ b/bn_mp_get_long_long.c @@ -16,7 +16,7 @@ */ /* get the lower unsigned long long of an mp_int, platform dependent */ -unsigned long long mp_get_long_long (mp_int * a) +unsigned long long mp_get_long_long(mp_int *a) { int i; unsigned long long res; diff --git a/bn_mp_grow.c b/bn_mp_grow.c index 445476e..199fd59 100644 --- a/bn_mp_grow.c +++ b/bn_mp_grow.c @@ -16,7 +16,7 @@ */ /* grow as required */ -int mp_grow (mp_int * a, int size) +int mp_grow(mp_int *a, int size) { int i; mp_digit *tmp; diff --git a/bn_mp_import.c b/bn_mp_import.c index f748fab..afd735e 100644 --- a/bn_mp_import.c +++ b/bn_mp_import.c @@ -18,8 +18,9 @@ /* based on gmp's mpz_import. * see http://gmplib.org/manual/Integer-Import-and-Export.html */ -int mp_import(mp_int* rop, size_t count, int order, size_t size, - int endian, size_t nails, const void* op) { +int mp_import(mp_int *rop, size_t count, int order, size_t size, + int endian, size_t nails, const void *op) +{ int result; size_t odd_nails, nail_bytes, i, j; unsigned char odd_nail_mask; diff --git a/bn_mp_init.c b/bn_mp_init.c index d15a573..36c40f8 100644 --- a/bn_mp_init.c +++ b/bn_mp_init.c @@ -16,7 +16,7 @@ */ /* init a new mp_int */ -int mp_init (mp_int * a) +int mp_init(mp_int *a) { int i; diff --git a/bn_mp_init_copy.c b/bn_mp_init_copy.c index 9a5ae72..9e5e9c4 100644 --- a/bn_mp_init_copy.c +++ b/bn_mp_init_copy.c @@ -16,7 +16,7 @@ */ /* creates "a" then copies b into it */ -int mp_init_copy (mp_int * a, mp_int * b) +int mp_init_copy(mp_int *a, mp_int *b) { int res; diff --git a/bn_mp_init_set.c b/bn_mp_init_set.c index ed4955c..8e7d11f 100644 --- a/bn_mp_init_set.c +++ b/bn_mp_init_set.c @@ -16,7 +16,7 @@ */ /* initialize and set a digit */ -int mp_init_set (mp_int * a, mp_digit b) +int mp_init_set(mp_int *a, mp_digit b) { int err; if ((err = mp_init(a)) != MP_OKAY) { diff --git a/bn_mp_init_set_int.c b/bn_mp_init_set_int.c index 1bc1942..ca69716 100644 --- a/bn_mp_init_set_int.c +++ b/bn_mp_init_set_int.c @@ -16,7 +16,7 @@ */ /* initialize and set a digit */ -int mp_init_set_int (mp_int * a, unsigned long b) +int mp_init_set_int(mp_int *a, unsigned long b) { int err; if ((err = mp_init(a)) != MP_OKAY) { diff --git a/bn_mp_init_size.c b/bn_mp_init_size.c index 444c680..fa332ee 100644 --- a/bn_mp_init_size.c +++ b/bn_mp_init_size.c @@ -16,7 +16,7 @@ */ /* init an mp_init for a given size */ -int mp_init_size (mp_int * a, int size) +int mp_init_size(mp_int *a, int size) { int x; diff --git a/bn_mp_invmod.c b/bn_mp_invmod.c index 67ae0a4..db17761 100644 --- a/bn_mp_invmod.c +++ b/bn_mp_invmod.c @@ -16,7 +16,7 @@ */ /* hac 14.61, pp608 */ -int mp_invmod (mp_int * a, mp_int * b, mp_int * c) +int mp_invmod(mp_int *a, mp_int *b, mp_int *c) { /* b cannot be negative */ if ((b->sign == MP_NEG) || (mp_iszero(b) == MP_YES)) { diff --git a/bn_mp_invmod_slow.c b/bn_mp_invmod_slow.c index d3b6949..1f138dd 100644 --- a/bn_mp_invmod_slow.c +++ b/bn_mp_invmod_slow.c @@ -16,7 +16,7 @@ */ /* hac 14.61, pp608 */ -int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c) +int mp_invmod_slow(mp_int *a, mp_int *b, mp_int *c) { mp_int x, y, u, v, A, B, C, D; int res; diff --git a/bn_mp_jacobi.c b/bn_mp_jacobi.c index a476bd4..57ed735 100644 --- a/bn_mp_jacobi.c +++ b/bn_mp_jacobi.c @@ -20,7 +20,7 @@ * HAC is wrong here, as the special case of (0 | 1) is not * handled correctly. */ -int mp_jacobi (mp_int * a, mp_int * n, int *c) +int mp_jacobi(mp_int *a, mp_int *n, int *c) { mp_int a1, p1; int k, s, r, res; diff --git a/bn_mp_karatsuba_mul.c b/bn_mp_karatsuba_mul.c index 635cee2..61aa2f5 100644 --- a/bn_mp_karatsuba_mul.c +++ b/bn_mp_karatsuba_mul.c @@ -44,7 +44,7 @@ * Generally though the overhead of this method doesn't pay off * until a certain size (N ~ 80) is reached. */ -int mp_karatsuba_mul (mp_int * a, mp_int * b, mp_int * c) +int mp_karatsuba_mul(mp_int *a, mp_int *b, mp_int *c) { mp_int x0, x1, y0, y1, t1, x0y0, x1y1; int B, err; diff --git a/bn_mp_karatsuba_sqr.c b/bn_mp_karatsuba_sqr.c index a5cd2ec..3c330ba 100644 --- a/bn_mp_karatsuba_sqr.c +++ b/bn_mp_karatsuba_sqr.c @@ -22,7 +22,7 @@ * is essentially the same algorithm but merely * tuned to perform recursive squarings. */ -int mp_karatsuba_sqr (mp_int * a, mp_int * b) +int mp_karatsuba_sqr(mp_int *a, mp_int *b) { mp_int x0, x1, t1, t2, x0x0, x1x1; int B, err; diff --git a/bn_mp_lcm.c b/bn_mp_lcm.c index b9643a7..c814428 100644 --- a/bn_mp_lcm.c +++ b/bn_mp_lcm.c @@ -16,7 +16,7 @@ */ /* computes least common multiple as |a*b|/(a, b) */ -int mp_lcm (mp_int * a, mp_int * b, mp_int * c) +int mp_lcm(mp_int *a, mp_int *b, mp_int *c) { int res; mp_int t1, t2; diff --git a/bn_mp_lshd.c b/bn_mp_lshd.c index ece2d63..646a140 100644 --- a/bn_mp_lshd.c +++ b/bn_mp_lshd.c @@ -16,7 +16,7 @@ */ /* shift left a certain amount of digits */ -int mp_lshd (mp_int * a, int b) +int mp_lshd(mp_int *a, int b) { int x, res; diff --git a/bn_mp_mod.c b/bn_mp_mod.c index 79c46af..4c7639b 100644 --- a/bn_mp_mod.c +++ b/bn_mp_mod.c @@ -16,7 +16,7 @@ */ /* c = a mod b, 0 <= c < b if b > 0, b < c <= 0 if b < 0 */ -int mp_mod (mp_int * a, mp_int * b, mp_int * c) +int mp_mod(mp_int *a, mp_int *b, mp_int *c) { mp_int t; int res; diff --git a/bn_mp_mod_2d.c b/bn_mp_mod_2d.c index fb39887..ced5181 100644 --- a/bn_mp_mod_2d.c +++ b/bn_mp_mod_2d.c @@ -16,7 +16,7 @@ */ /* calc a value mod 2**b */ -int mp_mod_2d (mp_int * a, int b, mp_int * c) +int mp_mod_2d(mp_int *a, int b, mp_int *c) { int x, res; diff --git a/bn_mp_mod_d.c b/bn_mp_mod_d.c index 42fa063..d2d6b88 100644 --- a/bn_mp_mod_d.c +++ b/bn_mp_mod_d.c @@ -15,7 +15,7 @@ * Tom St Denis, tstdenis82@gmail.com, http://libtom.org */ -int mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) +int mp_mod_d(mp_int *a, mp_digit b, mp_digit *c) { return mp_div_d(a, b, NULL, c); } diff --git a/bn_mp_montgomery_calc_normalization.c b/bn_mp_montgomery_calc_normalization.c index 62a7d81..9acd1db 100644 --- a/bn_mp_montgomery_calc_normalization.c +++ b/bn_mp_montgomery_calc_normalization.c @@ -21,7 +21,7 @@ * The method is slightly modified to shift B unconditionally upto just under * the leading bit of b. This saves alot of multiple precision shifting. */ -int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) +int mp_montgomery_calc_normalization(mp_int *a, mp_int *b) { int x, bits, res; diff --git a/bn_mp_montgomery_reduce.c b/bn_mp_montgomery_reduce.c index 207fa74..7e83d2e 100644 --- a/bn_mp_montgomery_reduce.c +++ b/bn_mp_montgomery_reduce.c @@ -16,7 +16,7 @@ */ /* computes xR**-1 == x (mod N) via Montgomery Reduction */ -int mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) +int mp_montgomery_reduce(mp_int *x, mp_int *n, mp_digit rho) { int ix, res, digs; mp_digit mu; diff --git a/bn_mp_montgomery_setup.c b/bn_mp_montgomery_setup.c index 12330d0..078339b 100644 --- a/bn_mp_montgomery_setup.c +++ b/bn_mp_montgomery_setup.c @@ -16,7 +16,7 @@ */ /* setups the montgomery reduction stuff */ -int mp_montgomery_setup (mp_int * n, mp_digit * rho) +int mp_montgomery_setup(mp_int *n, mp_digit *rho) { mp_digit x, b; diff --git a/bn_mp_mul.c b/bn_mp_mul.c index ee6bbf2..92683ec 100644 --- a/bn_mp_mul.c +++ b/bn_mp_mul.c @@ -16,7 +16,7 @@ */ /* high level multiplication (handles sign) */ -int mp_mul (mp_int * a, mp_int * b, mp_int * c) +int mp_mul(mp_int *a, mp_int *b, mp_int *c) { int res, neg; neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; diff --git a/bn_mp_mul_2.c b/bn_mp_mul_2.c index 4d63e83..84c3daa 100644 --- a/bn_mp_mul_2.c +++ b/bn_mp_mul_2.c @@ -16,7 +16,7 @@ */ /* b = a*2 */ -int mp_mul_2(mp_int * a, mp_int * b) +int mp_mul_2(mp_int *a, mp_int *b) { int x, res, oldused; diff --git a/bn_mp_mul_2d.c b/bn_mp_mul_2d.c index 811c2c5..ed8850d 100644 --- a/bn_mp_mul_2d.c +++ b/bn_mp_mul_2d.c @@ -16,7 +16,7 @@ */ /* shift left by a certain bit count */ -int mp_mul_2d (mp_int * a, int b, mp_int * c) +int mp_mul_2d(mp_int *a, int b, mp_int *c) { mp_digit d; int res; diff --git a/bn_mp_mul_d.c b/bn_mp_mul_d.c index 2fcee05..dcda5e4 100644 --- a/bn_mp_mul_d.c +++ b/bn_mp_mul_d.c @@ -16,7 +16,7 @@ */ /* multiply by a digit */ -int mp_mul_d (mp_int * a, mp_digit b, mp_int * c) +int mp_mul_d(mp_int *a, mp_digit b, mp_int *c) { mp_digit u, *tmpa, *tmpc; mp_word r; diff --git a/bn_mp_mulmod.c b/bn_mp_mulmod.c index 0ff8861..f003635 100644 --- a/bn_mp_mulmod.c +++ b/bn_mp_mulmod.c @@ -16,7 +16,7 @@ */ /* d = a * b (mod c) */ -int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) +int mp_mulmod(mp_int *a, mp_int *b, mp_int *c, mp_int *d) { int res; mp_int t; diff --git a/bn_mp_n_root.c b/bn_mp_n_root.c index f717f17..7b07b30 100644 --- a/bn_mp_n_root.c +++ b/bn_mp_n_root.c @@ -18,7 +18,7 @@ /* wrapper function for mp_n_root_ex() * computes c = (a)**(1/b) such that (c)**b <= a and (c+1)**b > a */ -int mp_n_root (mp_int * a, mp_digit b, mp_int * c) +int mp_n_root(mp_int *a, mp_digit b, mp_int *c) { return mp_n_root_ex(a, b, c, 0); } diff --git a/bn_mp_n_root_ex.c b/bn_mp_n_root_ex.c index 8b3b00f..19a8bb8 100644 --- a/bn_mp_n_root_ex.c +++ b/bn_mp_n_root_ex.c @@ -25,7 +25,7 @@ * each step involves a fair bit. This is not meant to * find huge roots [square and cube, etc]. */ -int mp_n_root_ex (mp_int * a, mp_digit b, mp_int * c, int fast) +int mp_n_root_ex(mp_int *a, mp_digit b, mp_int *c, int fast) { mp_int t1, t2, t3; int res, neg; diff --git a/bn_mp_neg.c b/bn_mp_neg.c index 72ddcda..036862a 100644 --- a/bn_mp_neg.c +++ b/bn_mp_neg.c @@ -16,7 +16,7 @@ */ /* b = -a */ -int mp_neg (mp_int * a, mp_int * b) +int mp_neg(mp_int *a, mp_int *b) { int res; if (a != b) { diff --git a/bn_mp_or.c b/bn_mp_or.c index e47a1db..13df339 100644 --- a/bn_mp_or.c +++ b/bn_mp_or.c @@ -16,7 +16,7 @@ */ /* OR two ints together */ -int mp_or (mp_int * a, mp_int * b, mp_int * c) +int mp_or(mp_int *a, mp_int *b, mp_int *c) { int res, ix, px; mp_int t, *x; diff --git a/bn_mp_prime_fermat.c b/bn_mp_prime_fermat.c index 1a327d7..d3b422f 100644 --- a/bn_mp_prime_fermat.c +++ b/bn_mp_prime_fermat.c @@ -23,7 +23,7 @@ * * Sets result to 1 if the congruence holds, or zero otherwise. */ -int mp_prime_fermat (mp_int * a, mp_int * b, int *result) +int mp_prime_fermat(mp_int *a, mp_int *b, int *result) { mp_int t; int err; diff --git a/bn_mp_prime_is_divisible.c b/bn_mp_prime_is_divisible.c index 57a3082..89a535f 100644 --- a/bn_mp_prime_is_divisible.c +++ b/bn_mp_prime_is_divisible.c @@ -20,7 +20,7 @@ * * sets result to 0 if not, 1 if yes */ -int mp_prime_is_divisible (mp_int * a, int *result) +int mp_prime_is_divisible(mp_int *a, int *result) { int err, ix; mp_digit res; diff --git a/bn_mp_prime_is_prime.c b/bn_mp_prime_is_prime.c index beb2e02..429f5fd 100644 --- a/bn_mp_prime_is_prime.c +++ b/bn_mp_prime_is_prime.c @@ -22,7 +22,7 @@ * * Sets result to 1 if probably prime, 0 otherwise */ -int mp_prime_is_prime (mp_int * a, int t, int *result) +int mp_prime_is_prime(mp_int *a, int t, int *result) { mp_int b; int ix, err, res; diff --git a/bn_mp_prime_miller_rabin.c b/bn_mp_prime_miller_rabin.c index ae00241..90e1507 100644 --- a/bn_mp_prime_miller_rabin.c +++ b/bn_mp_prime_miller_rabin.c @@ -22,7 +22,7 @@ * Randomly the chance of error is no more than 1/4 and often * very much lower. */ -int mp_prime_miller_rabin (mp_int * a, mp_int * b, int *result) +int mp_prime_miller_rabin(mp_int *a, mp_int *b, int *result) { mp_int n1, y, r; int s, j, err; diff --git a/bn_mp_radix_size.c b/bn_mp_radix_size.c index 3a0c482..555a8a0 100644 --- a/bn_mp_radix_size.c +++ b/bn_mp_radix_size.c @@ -16,7 +16,7 @@ */ /* returns size of ASCII reprensentation */ -int mp_radix_size (mp_int * a, int radix, int *size) +int mp_radix_size(mp_int *a, int radix, int *size) { int res, digs; mp_int t; diff --git a/bn_mp_rand.c b/bn_mp_rand.c index b9da051..f81255e 100644 --- a/bn_mp_rand.c +++ b/bn_mp_rand.c @@ -41,7 +41,7 @@ static mp_digit s_gen_random(void) return d; } -int mp_rand (mp_int * a, int digits) +int mp_rand(mp_int *a, int digits) { int res; mp_digit d; diff --git a/bn_mp_read_radix.c b/bn_mp_read_radix.c index 1d8b423..5669e05 100644 --- a/bn_mp_read_radix.c +++ b/bn_mp_read_radix.c @@ -16,7 +16,7 @@ */ /* read a string [ASCII] in a given radix */ -int mp_read_radix (mp_int * a, const char *str, int radix) +int mp_read_radix(mp_int *a, const char *str, int radix) { int y, res, neg; char ch; diff --git a/bn_mp_read_signed_bin.c b/bn_mp_read_signed_bin.c index 4aa3237..fba1d51 100644 --- a/bn_mp_read_signed_bin.c +++ b/bn_mp_read_signed_bin.c @@ -16,7 +16,7 @@ */ /* read signed bin, big endian, first byte is 0==positive or 1==negative */ -int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) +int mp_read_signed_bin(mp_int *a, const unsigned char *b, int c) { int res; diff --git a/bn_mp_read_unsigned_bin.c b/bn_mp_read_unsigned_bin.c index ca12f25..8a9ee8b 100644 --- a/bn_mp_read_unsigned_bin.c +++ b/bn_mp_read_unsigned_bin.c @@ -16,7 +16,7 @@ */ /* reads a unsigned char array, assumes the msb is stored first [big endian] */ -int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) +int mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c) { int res; diff --git a/bn_mp_reduce.c b/bn_mp_reduce.c index 4700c3b..6ddcb71 100644 --- a/bn_mp_reduce.c +++ b/bn_mp_reduce.c @@ -19,7 +19,7 @@ * precomputed via mp_reduce_setup. * From HAC pp.604 Algorithm 14.42 */ -int mp_reduce (mp_int * x, mp_int * m, mp_int * mu) +int mp_reduce(mp_int *x, mp_int *m, mp_int *mu) { mp_int q; int res, um = m->used; diff --git a/bn_mp_reduce_setup.c b/bn_mp_reduce_setup.c index 1c9ce10..ee2bda6 100644 --- a/bn_mp_reduce_setup.c +++ b/bn_mp_reduce_setup.c @@ -18,7 +18,7 @@ /* pre-calculate the value required for Barrett reduction * For a given modulus "b" it calulates the value required in "a" */ -int mp_reduce_setup (mp_int * a, mp_int * b) +int mp_reduce_setup(mp_int *a, mp_int *b) { int res; diff --git a/bn_mp_rshd.c b/bn_mp_rshd.c index 8768751..dcd58ce 100644 --- a/bn_mp_rshd.c +++ b/bn_mp_rshd.c @@ -16,7 +16,7 @@ */ /* shift right a certain amount of digits */ -void mp_rshd (mp_int * a, int b) +void mp_rshd(mp_int *a, int b) { int x; diff --git a/bn_mp_set.c b/bn_mp_set.c index 85e1bfe..6be217f 100644 --- a/bn_mp_set.c +++ b/bn_mp_set.c @@ -16,7 +16,7 @@ */ /* set to a digit */ -void mp_set (mp_int * a, mp_digit b) +void mp_set(mp_int *a, mp_digit b) { mp_zero(a); a->dp[0] = b & MP_MASK; diff --git a/bn_mp_set_int.c b/bn_mp_set_int.c index 9ced0ab..90a3097 100644 --- a/bn_mp_set_int.c +++ b/bn_mp_set_int.c @@ -16,7 +16,7 @@ */ /* set a 32-bit const */ -int mp_set_int (mp_int * a, unsigned long b) +int mp_set_int(mp_int *a, unsigned long b) { int x, res; diff --git a/bn_mp_shrink.c b/bn_mp_shrink.c index 0e14320..1df3a46 100644 --- a/bn_mp_shrink.c +++ b/bn_mp_shrink.c @@ -16,7 +16,7 @@ */ /* shrink a bignum */ -int mp_shrink (mp_int * a) +int mp_shrink(mp_int *a) { mp_digit *tmp; int used = 1; diff --git a/bn_mp_signed_bin_size.c b/bn_mp_signed_bin_size.c index e94a396..90b50ca 100644 --- a/bn_mp_signed_bin_size.c +++ b/bn_mp_signed_bin_size.c @@ -16,7 +16,7 @@ */ /* get the size for an signed equivalent */ -int mp_signed_bin_size (mp_int * a) +int mp_signed_bin_size(mp_int *a) { return 1 + mp_unsigned_bin_size(a); } diff --git a/bn_mp_sqr.c b/bn_mp_sqr.c index ef91ff0..46cd99e 100644 --- a/bn_mp_sqr.c +++ b/bn_mp_sqr.c @@ -16,7 +16,7 @@ */ /* computes b = a*a */ -int mp_sqr (mp_int * a, mp_int * b) +int mp_sqr(mp_int *a, mp_int *b) { int res; diff --git a/bn_mp_sqrmod.c b/bn_mp_sqrmod.c index 3f12fec..5b24cb9 100644 --- a/bn_mp_sqrmod.c +++ b/bn_mp_sqrmod.c @@ -16,7 +16,7 @@ */ /* c = a * a (mod b) */ -int mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) +int mp_sqrmod(mp_int *a, mp_int *b, mp_int *c) { int res; mp_int t; diff --git a/bn_mp_sub.c b/bn_mp_sub.c index 7a5f490..f83618b 100644 --- a/bn_mp_sub.c +++ b/bn_mp_sub.c @@ -16,7 +16,7 @@ */ /* high level subtraction (handles signs) */ -int mp_sub (mp_int * a, mp_int * b, mp_int * c) +int mp_sub(mp_int *a, mp_int *b, mp_int *c) { int sa, sb, res; diff --git a/bn_mp_sub_d.c b/bn_mp_sub_d.c index 34ace3e..83a107a 100644 --- a/bn_mp_sub_d.c +++ b/bn_mp_sub_d.c @@ -16,7 +16,7 @@ */ /* single digit subtraction */ -int mp_sub_d (mp_int * a, mp_digit b, mp_int * c) +int mp_sub_d(mp_int *a, mp_digit b, mp_int *c) { mp_digit *tmpa, *tmpc, mu; int res, ix, oldused; diff --git a/bn_mp_submod.c b/bn_mp_submod.c index 52c282b..ad7cb1b 100644 --- a/bn_mp_submod.c +++ b/bn_mp_submod.c @@ -16,7 +16,7 @@ */ /* d = a - b (mod c) */ -int mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) +int mp_submod(mp_int *a, mp_int *b, mp_int *c, mp_int *d) { int res; mp_int t; diff --git a/bn_mp_to_signed_bin.c b/bn_mp_to_signed_bin.c index f5568be..e7d35f5 100644 --- a/bn_mp_to_signed_bin.c +++ b/bn_mp_to_signed_bin.c @@ -16,7 +16,7 @@ */ /* store in signed [big endian] format */ -int mp_to_signed_bin (mp_int * a, unsigned char *b) +int mp_to_signed_bin(mp_int *a, unsigned char *b) { int res; diff --git a/bn_mp_to_signed_bin_n.c b/bn_mp_to_signed_bin_n.c index dc5ec26..501f849 100644 --- a/bn_mp_to_signed_bin_n.c +++ b/bn_mp_to_signed_bin_n.c @@ -16,7 +16,7 @@ */ /* store in signed [big endian] format */ -int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) +int mp_to_signed_bin_n(mp_int *a, unsigned char *b, unsigned long *outlen) { if (*outlen < (unsigned long)mp_signed_bin_size(a)) { return MP_VAL; diff --git a/bn_mp_to_unsigned_bin.c b/bn_mp_to_unsigned_bin.c index bb03818..0b94983 100644 --- a/bn_mp_to_unsigned_bin.c +++ b/bn_mp_to_unsigned_bin.c @@ -16,7 +16,7 @@ */ /* store in unsigned [big endian] format */ -int mp_to_unsigned_bin (mp_int * a, unsigned char *b) +int mp_to_unsigned_bin(mp_int *a, unsigned char *b) { int x, res; mp_int t; diff --git a/bn_mp_to_unsigned_bin_n.c b/bn_mp_to_unsigned_bin_n.c index f671621..5ee28f1 100644 --- a/bn_mp_to_unsigned_bin_n.c +++ b/bn_mp_to_unsigned_bin_n.c @@ -16,7 +16,7 @@ */ /* store in unsigned [big endian] format */ -int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) +int mp_to_unsigned_bin_n(mp_int *a, unsigned char *b, unsigned long *outlen) { if (*outlen < (unsigned long)mp_unsigned_bin_size(a)) { return MP_VAL; diff --git a/bn_mp_toradix.c b/bn_mp_toradix.c index 766aa6d..4c51198 100644 --- a/bn_mp_toradix.c +++ b/bn_mp_toradix.c @@ -16,7 +16,7 @@ */ /* stores a bignum as a ASCII string in a given radix (2..64) */ -int mp_toradix (mp_int * a, char *str, int radix) +int mp_toradix(mp_int *a, char *str, int radix) { int res, digs; mp_int t; diff --git a/bn_mp_toradix_n.c b/bn_mp_toradix_n.c index c394e92..c94b0ba 100644 --- a/bn_mp_toradix_n.c +++ b/bn_mp_toradix_n.c @@ -19,7 +19,7 @@ * * Stores upto maxlen-1 chars and always a NULL byte */ -int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) +int mp_toradix_n(mp_int *a, char *str, int radix, int maxlen) { int res, digs; mp_int t; diff --git a/bn_mp_unsigned_bin_size.c b/bn_mp_unsigned_bin_size.c index 9cc0d8c..c765155 100644 --- a/bn_mp_unsigned_bin_size.c +++ b/bn_mp_unsigned_bin_size.c @@ -16,7 +16,7 @@ */ /* get the size for an unsigned equivalent */ -int mp_unsigned_bin_size (mp_int * a) +int mp_unsigned_bin_size(mp_int *a) { int size = mp_count_bits(a); return (size / 8) + (((size & 7) != 0) ? 1 : 0); diff --git a/bn_mp_xor.c b/bn_mp_xor.c index e49b7d2..1278af9 100644 --- a/bn_mp_xor.c +++ b/bn_mp_xor.c @@ -16,7 +16,7 @@ */ /* XOR two ints together */ -int mp_xor (mp_int * a, mp_int * b, mp_int * c) +int mp_xor(mp_int *a, mp_int *b, mp_int *c) { int res, ix, px; mp_int t, *x; diff --git a/bn_mp_zero.c b/bn_mp_zero.c index a7d59e4..f569f3a 100644 --- a/bn_mp_zero.c +++ b/bn_mp_zero.c @@ -16,7 +16,7 @@ */ /* set to zero */ -void mp_zero (mp_int * a) +void mp_zero(mp_int *a) { int n; mp_digit *tmp; diff --git a/bn_reverse.c b/bn_reverse.c index 781b00d..9ba4a67 100644 --- a/bn_reverse.c +++ b/bn_reverse.c @@ -16,7 +16,7 @@ */ /* reverse an array, used for radix code */ -void bn_reverse (unsigned char *s, int len) +void bn_reverse(unsigned char *s, int len) { int ix, iy; unsigned char t; diff --git a/bn_s_mp_add.c b/bn_s_mp_add.c index 7dbcfa4..54cd16f 100644 --- a/bn_s_mp_add.c +++ b/bn_s_mp_add.c @@ -16,7 +16,7 @@ */ /* low level addition, based on HAC pp.594, Algorithm 14.7 */ -int s_mp_add (mp_int * a, mp_int * b, mp_int * c) +int s_mp_add(mp_int *a, mp_int *b, mp_int *c) { mp_int *x; int olduse, res, min, max; diff --git a/bn_s_mp_exptmod.c b/bn_s_mp_exptmod.c index 638599f..4108946 100644 --- a/bn_s_mp_exptmod.c +++ b/bn_s_mp_exptmod.c @@ -20,7 +20,7 @@ # define TAB_SIZE 256 #endif -int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode) +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_digit buf; diff --git a/bn_s_mp_mul_digs.c b/bn_s_mp_mul_digs.c index 47ddb5f..293e760 100644 --- a/bn_s_mp_mul_digs.c +++ b/bn_s_mp_mul_digs.c @@ -19,7 +19,7 @@ * HAC pp. 595, Algorithm 14.12 Modified so you can control how * many digits of output are created. */ -int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) +int s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs) { mp_int t; int res, pa, pb, ix, iy; diff --git a/bn_s_mp_mul_high_digs.c b/bn_s_mp_mul_high_digs.c index af0f0ba..36911a8 100644 --- a/bn_s_mp_mul_high_digs.c +++ b/bn_s_mp_mul_high_digs.c @@ -18,7 +18,7 @@ /* multiplies |a| * |b| and does not compute the lower digs digits * [meant to get the higher part of the product] */ -int s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) +int s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs) { mp_int t; int res, pa, pb, ix, iy; diff --git a/bn_s_mp_sqr.c b/bn_s_mp_sqr.c index 382a9cf..d32a477 100644 --- a/bn_s_mp_sqr.c +++ b/bn_s_mp_sqr.c @@ -16,7 +16,7 @@ */ /* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */ -int s_mp_sqr (mp_int * a, mp_int * b) +int s_mp_sqr(mp_int *a, mp_int *b) { mp_int t; int res, ix, iy, pa; diff --git a/bn_s_mp_sub.c b/bn_s_mp_sub.c index a39e923..4828e2b 100644 --- a/bn_s_mp_sub.c +++ b/bn_s_mp_sub.c @@ -16,7 +16,7 @@ */ /* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */ -int s_mp_sub (mp_int * a, mp_int * b, mp_int * c) +int s_mp_sub(mp_int *a, mp_int *b, mp_int *c) { int olduse, res, min, max;