[openssl-commits] [openssl] master update

Viktor Dukhovni viktor at openssl.org
Thu Jan 28 11:37:28 UTC 2016


The branch master has been updated
       via  7eba4e62077484aebec010157424287f1963c88f (commit)
      from  3538c7da3d53dca70be5f507376299843046d2b7 (commit)


- Log -----------------------------------------------------------------
commit 7eba4e62077484aebec010157424287f1963c88f
Author: Viktor Dukhovni <openssl-users at dukhovni.org>
Date:   Thu Jan 28 00:10:11 2016 -0500

    Restore NUMPRIMES as a numeric literal
    
    This fixes clang compilation problem with size_t NUMPRIMES and int
    loop counters.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in           | 6 +++---
 crypto/bn/bn_prime.c  | 2 --
 crypto/bn/bn_prime.h  | 5 ++++-
 crypto/bn/bn_prime.pl | 3 ++-
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 629141d..80d5f17 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -442,9 +442,9 @@ depend:
 update: generate errors ordinals depend
 
 generate:
-	(cd apps && $(MAKE) generate)
-	(cd crypto/bn && $(MAKE) generate)
-	(cd crypto/objects && $(MAKE) generate)
+	(cd apps && PERL='${PERL}' $(MAKE) generate)
+	(cd crypto/bn && PERL='${PERL}' $(MAKE) generate)
+	(cd crypto/objects && PERL='${PERL}' $(MAKE) generate)
 
 errors:
 	$(PERL) util/ck_errf.pl -strict */*.c */*/*.c
diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c
index 8d1294f..a5887d9 100644
--- a/crypto/bn/bn_prime.c
+++ b/crypto/bn/bn_prime.c
@@ -121,8 +121,6 @@
  */
 #include "bn_prime.h"
 
-#define NUMPRIMES OSSL_NELEM(primes)
-
 static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,
                    const BIGNUM *a1_odd, int k, BN_CTX *ctx,
                    BN_MONT_CTX *mont);
diff --git a/crypto/bn/bn_prime.h b/crypto/bn/bn_prime.h
index d1fbcd1..6f6949c 100644
--- a/crypto/bn/bn_prime.h
+++ b/crypto/bn/bn_prime.h
@@ -57,7 +57,10 @@
  */
 
 typedef unsigned short prime_t;
-static const prime_t primes[] = {
+# define NUMPRIMES 2048
+
+static const prime_t primes[2048] = {
+
        2,    3,    5,    7,   11,   13,   17,   19, 
       23,   29,   31,   37,   41,   43,   47,   53, 
       59,   61,   67,   71,   73,   79,   83,   89, 
diff --git a/crypto/bn/bn_prime.pl b/crypto/bn/bn_prime.pl
index add6ffb..3a5f064 100644
--- a/crypto/bn/bn_prime.pl
+++ b/crypto/bn/bn_prime.pl
@@ -76,8 +76,9 @@ loop: while ($#primes < $num-1) {
 }
 
 print "typedef unsigned short prime_t;\n";
+printf "# define NUMPRIMES %d\n\n", $num;
 
-print "static const prime_t primes[] = {";
+printf "static const prime_t primes[%d] = {\n", $num;
 for (my $i = 0; $i <= $#primes; $i++) {
     printf "\n    " if ($i % 8) == 0;
     printf "%4d, ", $primes[$i];


More information about the openssl-commits mailing list