summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_prime_random_ex.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-09-26 16:31:55 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-09-26 16:31:55 (GMT)
commit36537913f69228c5a11335a42637feba36c96677 (patch)
treee0c3d30912f2b67d620d935f3dead47ac4f3533d /libtommath/bn_mp_prime_random_ex.c
parentd2b645df1ab7b43093f7553808c64fedaa3b3a49 (diff)
downloadtcl-36537913f69228c5a11335a42637feba36c96677.zip
tcl-36537913f69228c5a11335a42637feba36c96677.tar.gz
tcl-36537913f69228c5a11335a42637feba36c96677.tar.bz2
Import of libtommath 0.36
Diffstat (limited to 'libtommath/bn_mp_prime_random_ex.c')
-rw-r--r--libtommath/bn_mp_prime_random_ex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libtommath/bn_mp_prime_random_ex.c b/libtommath/bn_mp_prime_random_ex.c
index 78c0583..daca61c 100644
--- a/libtommath/bn_mp_prime_random_ex.c
+++ b/libtommath/bn_mp_prime_random_ex.c
@@ -62,10 +62,8 @@ int mp_prime_random_ex(mp_int *a, int t, int size, int flags, ltm_prime_callback
maskOR_msb = 0;
maskOR_msb_offset = ((size & 7) == 1) ? 1 : 0;
if (flags & LTM_PRIME_2MSB_ON) {
- maskOR_msb |= 1 << ((size - 2) & 7);
- } else if (flags & LTM_PRIME_2MSB_OFF) {
- maskAND &= ~(1 << ((size - 2) & 7));
- }
+ maskOR_msb |= 0x80 >> ((9 - size) & 7);
+ }
/* get the maskOR_lsb */
maskOR_lsb = 1;
@@ -121,3 +119,7 @@ error:
#endif
+
+/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_random_ex.c,v $ */
+/* $Revision: 1.1.1.3 $ */
+/* $Date: 2005/09/26 16:31:56 $ */