diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-16 13:04:26 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-16 13:04:26 (GMT) |
commit | 2adcff3e5ba6e09366ef4208ab81768803ba15bd (patch) | |
tree | 963ed4c25de0f3f0b60d2392c5fd0e7441e548e5 /libtommath/bn_mp_is_square.c | |
parent | fac003f85aeba679d1cc6bea4eb8a84fc0ebd9f0 (diff) | |
download | tcl-2adcff3e5ba6e09366ef4208ab81768803ba15bd.zip tcl-2adcff3e5ba6e09366ef4208ab81768803ba15bd.tar.gz tcl-2adcff3e5ba6e09366ef4208ab81768803ba15bd.tar.bz2 |
import libtommath 1.0
Diffstat (limited to 'libtommath/bn_mp_is_square.c')
-rw-r--r-- | libtommath/bn_mp_is_square.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libtommath/bn_mp_is_square.c b/libtommath/bn_mp_is_square.c index 12b9ec7..9f065ef 100644 --- a/libtommath/bn_mp_is_square.c +++ b/libtommath/bn_mp_is_square.c @@ -1,4 +1,4 @@ -#include <tommath.h> +#include <tommath_private.h> #ifdef BN_MP_IS_SQUARE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + * Tom St Denis, tstdenis82@gmail.com, http://libtom.org */ /* Check if remainders are possible squares - fast exclude non-squares */ @@ -82,13 +82,13 @@ int mp_is_square(mp_int *arg,int *ret) * free "t" so the easiest way is to goto ERR. We know that res * is already equal to MP_OKAY from the mp_mod call */ - if ( (1L<<(r%11)) & 0x5C4L ) goto ERR; - if ( (1L<<(r%13)) & 0x9E4L ) goto ERR; - if ( (1L<<(r%17)) & 0x5CE8L ) goto ERR; - if ( (1L<<(r%19)) & 0x4F50CL ) goto ERR; - if ( (1L<<(r%23)) & 0x7ACCA0L ) goto ERR; - if ( (1L<<(r%29)) & 0xC2EDD0CL ) goto ERR; - if ( (1L<<(r%31)) & 0x6DE2B848L ) goto ERR; + if (((1L<<(r%11)) & 0x5C4L) != 0L) goto ERR; + if (((1L<<(r%13)) & 0x9E4L) != 0L) goto ERR; + if (((1L<<(r%17)) & 0x5CE8L) != 0L) goto ERR; + if (((1L<<(r%19)) & 0x4F50CL) != 0L) goto ERR; + if (((1L<<(r%23)) & 0x7ACCA0L) != 0L) goto ERR; + if (((1L<<(r%29)) & 0xC2EDD0CL) != 0L) goto ERR; + if (((1L<<(r%31)) & 0x6DE2B848L) != 0L) goto ERR; /* Final check - is sqr(sqrt(arg)) == arg ? */ if ((res = mp_sqrt(arg,&t)) != MP_OKAY) { @@ -105,5 +105,5 @@ ERR:mp_clear(&t); #endif /* $Source$ */ -/* $Revision: 0.41 $ */ -/* $Date: 2007-04-18 09:58:18 +0000 $ */ +/* $Revision$ */ +/* $Date$ */ |