x86[_64]cpuid.pl: add low-level RDSEED.
[openssl.git] / crypto / bn / bn_prime.pl
index 9fc376548652801d9ef0207c98ba68a95e3bba25..3fafb6f3e90aa8576fcacd2ea56a65cabd192232 100644 (file)
@@ -11,7 +11,7 @@ loop: while ($#primes < $num-1)
        $p+=2;
        $s=int(sqrt($p));
 
-       for ($i=0; $primes[$i]<=$s; $i++)
+       for ($i=0; defined($primes[$i]) && $primes[$i]<=$s; $i++)
                {
                next loop if (($p%$primes[$i]) == 0);
                }
@@ -101,10 +101,12 @@ for ($i=0; $i <= $#primes; $i++)
 
 printf "#ifndef EIGHT_BIT\n";
 printf "#define NUMPRIMES %d\n",$num;
+printf "typedef unsigned short prime_t;\n";
 printf "#else\n";
 printf "#define NUMPRIMES %d\n",$eight;
+printf "typedef unsigned char prime_t;\n";
 printf "#endif\n";
-print "static const unsigned int primes[NUMPRIMES]=\n\t{\n\t";
+print "static const prime_t primes[NUMPRIMES]=\n\t{\n\t";
 $init=0;
 for ($i=0; $i <= $#primes; $i++)
        {