diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_prime.pl')
-rw-r--r-- | src/lib/libcrypto/bn/bn_prime.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_prime.pl b/src/lib/libcrypto/bn/bn_prime.pl index 9fc3765486..3fafb6f3e9 100644 --- a/src/lib/libcrypto/bn/bn_prime.pl +++ b/src/lib/libcrypto/bn/bn_prime.pl | |||
@@ -11,7 +11,7 @@ loop: while ($#primes < $num-1) | |||
11 | $p+=2; | 11 | $p+=2; |
12 | $s=int(sqrt($p)); | 12 | $s=int(sqrt($p)); |
13 | 13 | ||
14 | for ($i=0; $primes[$i]<=$s; $i++) | 14 | for ($i=0; defined($primes[$i]) && $primes[$i]<=$s; $i++) |
15 | { | 15 | { |
16 | next loop if (($p%$primes[$i]) == 0); | 16 | next loop if (($p%$primes[$i]) == 0); |
17 | } | 17 | } |
@@ -101,10 +101,12 @@ for ($i=0; $i <= $#primes; $i++) | |||
101 | 101 | ||
102 | printf "#ifndef EIGHT_BIT\n"; | 102 | printf "#ifndef EIGHT_BIT\n"; |
103 | printf "#define NUMPRIMES %d\n",$num; | 103 | printf "#define NUMPRIMES %d\n",$num; |
104 | printf "typedef unsigned short prime_t;\n"; | ||
104 | printf "#else\n"; | 105 | printf "#else\n"; |
105 | printf "#define NUMPRIMES %d\n",$eight; | 106 | printf "#define NUMPRIMES %d\n",$eight; |
107 | printf "typedef unsigned char prime_t;\n"; | ||
106 | printf "#endif\n"; | 108 | printf "#endif\n"; |
107 | print "static const unsigned int primes[NUMPRIMES]=\n\t{\n\t"; | 109 | print "static const prime_t primes[NUMPRIMES]=\n\t{\n\t"; |
108 | $init=0; | 110 | $init=0; |
109 | for ($i=0; $i <= $#primes; $i++) | 111 | for ($i=0; $i <= $#primes; $i++) |
110 | { | 112 | { |