diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-09-18 08:31:55 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-09-18 08:31:55 (GMT) |
commit | a187f65cfd5964971d7ed52f09e18fdbb4bf51cc (patch) | |
tree | 6b7bbde03122d1571d4543d10eccfe88610bd680 /libtommath/bn_mp_sqr.c | |
parent | 0faaca01de4e9fa2039c7fdd34f60b138f665249 (diff) | |
parent | 30f7e69b182d1267056ee2628a860891f6555aa3 (diff) | |
download | tcl-a187f65cfd5964971d7ed52f09e18fdbb4bf51cc.zip tcl-a187f65cfd5964971d7ed52f09e18fdbb4bf51cc.tar.gz tcl-a187f65cfd5964971d7ed52f09e18fdbb4bf51cc.tar.bz2 |
Merge libtommath upstream changes (astyle formatting only). No functional changes. All Tcl-specific modifications are kept.
Diffstat (limited to 'libtommath/bn_mp_sqr.c')
-rw-r--r-- | libtommath/bn_mp_sqr.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/libtommath/bn_mp_sqr.c b/libtommath/bn_mp_sqr.c index a61f506..0fd077c 100644 --- a/libtommath/bn_mp_sqr.c +++ b/libtommath/bn_mp_sqr.c @@ -17,41 +17,41 @@ /* computes b = a*a */ int -mp_sqr (const mp_int * a, mp_int * b) +mp_sqr(const mp_int *a, mp_int *b) { - int res; + int res; #ifdef BN_MP_TOOM_SQR_C - /* use Toom-Cook? */ - if (a->used >= TOOM_SQR_CUTOFF) { - res = mp_toom_sqr(a, b); - /* Karatsuba? */ - } else + /* use Toom-Cook? */ + if (a->used >= TOOM_SQR_CUTOFF) { + res = mp_toom_sqr(a, b); + /* Karatsuba? */ + } else #endif #ifdef BN_MP_KARATSUBA_SQR_C - if (a->used >= KARATSUBA_SQR_CUTOFF) { - res = mp_karatsuba_sqr (a, b); - } else + if (a->used >= KARATSUBA_SQR_CUTOFF) { + res = mp_karatsuba_sqr(a, b); + } else #endif - { + { #ifdef BN_FAST_S_MP_SQR_C - /* can we use the fast comba multiplier? */ - if ((((a->used * 2) + 1) < MP_WARRAY) && - (a->used < - (1 << (((sizeof(mp_word) * CHAR_BIT) - (2 * DIGIT_BIT)) - 1)))) { - res = fast_s_mp_sqr (a, b); - } else + /* can we use the fast comba multiplier? */ + if ((((a->used * 2) + 1) < MP_WARRAY) && + (a->used < + (1 << (((sizeof(mp_word) * CHAR_BIT) - (2 * DIGIT_BIT)) - 1)))) { + res = fast_s_mp_sqr(a, b); + } else #endif - { + { #ifdef BN_S_MP_SQR_C - res = s_mp_sqr (a, b); + res = s_mp_sqr(a, b); #else - res = MP_VAL; + res = MP_VAL; #endif - } - } - b->sign = MP_ZPOS; - return res; + } + } + b->sign = MP_ZPOS; + return res; } #endif |