summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_prime.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_prime.pl')
-rw-r--r--src/lib/libcrypto/bn/bn_prime.pl56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/lib/libcrypto/bn/bn_prime.pl b/src/lib/libcrypto/bn/bn_prime.pl
deleted file mode 100644
index 979385a334..0000000000
--- a/src/lib/libcrypto/bn/bn_prime.pl
+++ /dev/null
@@ -1,56 +0,0 @@
1#!/usr/local/bin/perl
2# bn_prime.pl
3
4$num=2048;
5$num=$ARGV[0] if ($#ARGV >= 0);
6
7push(@primes,2);
8$p=1;
9loop: while ($#primes < $num-1)
10 {
11 $p+=2;
12 $s=int(sqrt($p));
13
14 for ($i=0; $primes[$i]<=$s; $i++)
15 {
16 next loop if (($p%$primes[$i]) == 0);
17 }
18 push(@primes,$p);
19 }
20
21print <<"EOF";
22/* Auto generated by bn_prime.pl */
23/* Copyright (C) 1995-1997 Eric Young (eay\@mincom.oz.au).
24 * All rights reserved.
25 * Copyright remains Eric Young's, and as such any Copyright notices in
26 * the code are not to be removed.
27 * See the COPYRIGHT file in the SSLeay distribution for more details.
28 */
29
30EOF
31
32for ($i=0; $i <= $#primes; $i++)
33 {
34 if ($primes[$i] > 256)
35 {
36 $eight=$i;
37 last;
38 }
39 }
40
41printf "#ifndef EIGHT_BIT\n";
42printf "#define NUMPRIMES %d\n",$num;
43printf "#else\n";
44printf "#define NUMPRIMES %d\n",$eight;
45printf "#endif\n";
46print "static unsigned int primes[NUMPRIMES]=\n\t{\n\t";
47$init=0;
48for ($i=0; $i <= $#primes; $i++)
49 {
50 printf "\n#ifndef EIGHT_BIT\n\t" if ($primes[$i] > 256) && !($init++);
51 printf("\n\t") if (($i%8) == 0) && ($i != 0);
52 printf("%4d,",$primes[$i]);
53 }
54print "\n#endif\n\t};\n";
55
56