projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c09ec5d
)
Add python script to generate the bits needed for the prime generator.
author
Felix Laurie von Massenbach
<felix@erbridge.co.uk>
Tue, 27 May 2014 01:13:33 +0000
(
02:13
+0100)
committer
Ben Laurie
<ben@links.org>
Sun, 1 Jun 2014 14:31:26 +0000
(15:31 +0100)
tools/primes.py
[new file with mode: 0644]
patch
|
blob
diff --git a/tools/primes.py
b/tools/primes.py
new file mode 100644
(file)
index 0000000..
c4be13b
--- /dev/null
+++ b/
tools/primes.py
@@ -0,0
+1,21
@@
+primes = [2, 3, 5, 7]
+safe = True
+
+muliplier = 1
+for p in primes:
+ muliplier *= p
+
+offsets = []
+for x in range(3, muliplier + 3, 2):
+ prime = True
+ for p in primes:
+ if not x % p or (safe and not ((x - 1) / 2) % p):
+ prime = False
+ break
+
+ if prime:
+ offsets.append(x)
+
+print(offsets)
+print(len(offsets))
+print(muliplier)