summaryrefslogtreecommitdiffhomepage
path: root/libtommath/bn_mp_prime_random_ex.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2007-02-03 08:20:30 +0000
committerMatt Johnston <matt@ucc.asn.au>2007-02-03 08:20:30 +0000
commitc5fd7dd5548f28e32d846e39d17e5c4de4e769af (patch)
tree81b522e272facfb27ff614936b4988bf6569ef2d /libtommath/bn_mp_prime_random_ex.c
parent5092e30605dfc5c45990d91cf606990e5c768255 (diff)
parent4a5208512ba02f735acbf7e948ed02353583581e (diff)
merge of '1250b8af44b62d8f4fe0f8d9fc7e7a1cc34e7e1c'
and '7f8670ac3bb975f40967f3979d09d2199b7e90c8' --HG-- extra : convert_revision : 6b61c50f4cf888bea302ac8fcf5dbb573b443251
Diffstat (limited to 'libtommath/bn_mp_prime_random_ex.c')
-rw-r--r--libtommath/bn_mp_prime_random_ex.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libtommath/bn_mp_prime_random_ex.c b/libtommath/bn_mp_prime_random_ex.c
index 78c0583..cde7a38 100644
--- a/libtommath/bn_mp_prime_random_ex.c
+++ b/libtommath/bn_mp_prime_random_ex.c
@@ -12,7 +12,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org
+ * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
*/
/* makes a truly random prime of a given size (bits),
@@ -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: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */
+/* $Revision: 1.4 $ */
+/* $Date: 2006/03/31 14:18:44 $ */