Mercurial > dropbear
diff libtommath/bn_mp_prime_random_ex.c @ 398:59c7938af2bd
merge of '1250b8af44b62d8f4fe0f8d9fc7e7a1cc34e7e1c'
and '7f8670ac3bb975f40967f3979d09d2199b7e90c8'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 03 Feb 2007 08:20:30 +0000 |
parents | 5ff8218bcee9 |
children | 60fc6476e044 |
line wrap: on
line diff
--- a/libtommath/bn_mp_prime_random_ex.c Sat Feb 03 08:09:55 2007 +0000 +++ b/libtommath/bn_mp_prime_random_ex.c Sat Feb 03 08:20:30 2007 +0000 @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, [email protected], http://math.libtomcrypt.org + * Tom St Denis, [email protected], http://math.libtomcrypt.com */ /* makes a truly random prime of a given size (bits), @@ -62,10 +62,8 @@ 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 @@ #endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/03/31 14:18:44 $ */