Commit Graph

11 Commits

Author SHA1 Message Date
Chris Martin
f77994a729 Various documentation copy editing 2017-11-18 14:27:44 -05:00
Colin Atkinson
345f4cd141 Fix bug in isProbablyPrime for small numbers
Fix bug in isProbablyPrime where too many iterations were specified for numbers less than 100

Add clause to isProbablyPrime to use hardcoded values <= 2903
2017-01-19 00:11:39 -05:00
Colin Atkinson
0cec622ddf Fix generate(Safe)Prime to guarantee prime size
Add check for size in generatePrime

Add size test in generateSafePrime

Require only that top bit is set, instead of top 2

This is the general standard, see e.g. OpenSSL

Add an error for too few bits being supplied to prime generator, and add documentation

Add some documentation and require highest two bits set

Simplify return syntax in generatePrime and generateSafePrime

Switch exponent to bit-shift for small performance boost
2017-01-19 00:10:50 -05:00
Vincent Hanquez
bc4a55ff74 [number] further cleanup random generation 2015-05-23 13:44:26 +01:00
Vincent Hanquez
c0e50547ad [number] remove the need for a random generator for testing primality
a DRG is implicitely created when calling the non gmp primality test
2015-05-23 12:55:29 +01:00
Vincent Hanquez
228f1ab938 [number] further push the compat cleanup 2015-05-11 07:32:13 +01:00
Vincent Hanquez
ee3e5e69bf [number] move some number primitive to use compat without CPP 2015-05-11 07:11:38 +01:00
Vincent Hanquez
4bcf193a12 [number] further remove gcde_binary 2015-05-11 07:10:38 +01:00
Vincent Hanquez
b487aef898 cleanup module imports 2015-04-20 07:36:51 +01:00
Vincent Hanquez
c3d9570881 re-add the primitives to generate primes and test for prime. 2015-03-29 10:55:46 +01:00
Vincent Hanquez
90d02607ba merge crypto-numbers minus all the random parts 2015-02-09 05:47:11 +00:00