diff options
author | Felix Laurie von Massenbach <felix@erbridge.co.uk> | 2014-05-27 13:55:20 +0200 |
---|---|---|
committer | Ben Laurie <ben@links.org> | 2014-06-01 16:31:26 +0200 |
commit | 982c42cb20f6a6797ea0ce5c5a8c1a040b170d65 (patch) | |
tree | dca3621096bc190f754ae8e1621f1d92d7c0e9cc /tools | |
parent | Remove editor barf on updating copyright. (diff) | |
download | openssl-982c42cb20f6a6797ea0ce5c5a8c1a040b170d65.tar.xz openssl-982c42cb20f6a6797ea0ce5c5a8c1a040b170d65.zip |
Try skipping over the adding and just picking a new random number.
Generates a number coprime to 2, 3, 5, 7, 11.
Speed:
Trial div (add) : trial div (retry) : coprime
1 : 0.42 : 0.84
Diffstat (limited to 'tools')
-rw-r--r-- | tools/primes.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/primes.py b/tools/primes.py index c4be13baae..61de99f000 100644 --- a/tools/primes.py +++ b/tools/primes.py @@ -1,7 +1,7 @@ -primes = [2, 3, 5, 7] -safe = True +primes = [2, 3, 5, 7, 11] +safe = False # Not sure if the period's right on safe primes. -muliplier = 1 +muliplier = 1 if not safe else 2 for p in primes: muliplier *= p |