[openssl-commits] [openssl] master update

Kurt Roeckx kurt at openssl.org
Sat Nov 25 13:31:23 UTC 2017


The branch master has been updated
       via  d807db26a403b4de69d7846656362e70f5083428 (commit)
      from  92793648945affdfe529fa711666d19528815789 (commit)


- Log -----------------------------------------------------------------
commit d807db26a403b4de69d7846656362e70f5083428
Author: Kurt Roeckx <kurt at roeckx.be>
Date:   Sun Nov 19 17:40:56 2017 +0100

    Create a prototype for OPENSSL_rdtsc
    
    Switch to make it return an uint32_t instead of the various different
    types it returns now.
    
    Fixes: #3125
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    GH: #4757

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

Summary of changes:
 crypto/armcap.c               | 7 ++++---
 crypto/sparcv9cap.c           | 3 ++-
 include/internal/cryptlib.h   | 4 ++++
 test/modes_internal_test.c    | 3 ++-
 test/poly1305_internal_test.c | 4 ++--
 test/siphash_internal_test.c  | 4 ++--
 6 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/crypto/armcap.c b/crypto/armcap.c
index b55a71e..a1f77fa 100644
--- a/crypto/armcap.c
+++ b/crypto/armcap.c
@@ -13,6 +13,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include <openssl/crypto.h>
+#include "internal/cryptlib.h"
 
 #include "arm_arch.h"
 
@@ -23,7 +24,7 @@ void OPENSSL_cpuid_setup(void)
 {
 }
 
-unsigned long OPENSSL_rdtsc(void)
+uint32_t OPENSSL_rdtsc(void)
 {
     return 0;
 }
@@ -45,9 +46,9 @@ void _armv8_aes_probe(void);
 void _armv8_sha1_probe(void);
 void _armv8_sha256_probe(void);
 void _armv8_pmull_probe(void);
-unsigned long _armv7_tick(void);
+uint32_t _armv7_tick(void);
 
-unsigned long OPENSSL_rdtsc(void)
+uint32_t OPENSSL_rdtsc(void)
 {
     if (OPENSSL_armcap_P & ARMV7_TICK)
         return _armv7_tick();
diff --git a/crypto/sparcv9cap.c b/crypto/sparcv9cap.c
index 61d0334..c8c5675 100644
--- a/crypto/sparcv9cap.c
+++ b/crypto/sparcv9cap.c
@@ -15,6 +15,7 @@
 #include <sys/time.h>
 #include <unistd.h>
 #include <openssl/bn.h>
+#include "internal/cryptlib.h"
 
 #include "sparc_arch.h"
 
@@ -98,7 +99,7 @@ unsigned long _sparcv9_random(void);
 size_t _sparcv9_vis1_instrument_bus(unsigned int *, size_t);
 size_t _sparcv9_vis1_instrument_bus2(unsigned int *, size_t, size_t);
 
-unsigned long OPENSSL_rdtsc(void)
+uint32_t OPENSSL_rdtsc(void)
 {
     if (OPENSSL_sparcv9cap_P[0] & SPARCV9_TICK_PRIVILEGED)
 #if defined(__sun) && defined(__SVR4)
diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h
index 4280185..25ccdb1 100644
--- a/include/internal/cryptlib.h
+++ b/include/internal/cryptlib.h
@@ -94,6 +94,10 @@ FILE *openssl_fopen(const char *filename, const char *mode);
 void *openssl_fopen(const char *filename, const char *mode);
 # endif
 
+#ifdef OPENSSL_CPUID_OBJ
+uint32_t OPENSSL_rdtsc();
+#endif
+
 #ifdef  __cplusplus
 }
 #endif
diff --git a/test/modes_internal_test.c b/test/modes_internal_test.c
index f3e46fe..6b02fd0 100644
--- a/test/modes_internal_test.c
+++ b/test/modes_internal_test.c
@@ -17,6 +17,7 @@
 #include "../crypto/modes/modes_lcl.h"
 #include "testutil.h"
 #include "internal/nelem.h"
+#include "internal/cryptlib.h"
 
 typedef struct {
     size_t size;
@@ -889,7 +890,7 @@ static void benchmark_gcm128(const unsigned char *K, size_t Klen,
 #ifdef OPENSSL_CPUID_OBJ
     GCM128_CONTEXT ctx;
     AES_KEY key;
-    size_t start, gcm_t, ctr_t, OPENSSL_rdtsc();
+    uint32_t start, gcm_t, ctr_t;
     union {
         u64 u;
         u8 c[1024];
diff --git a/test/poly1305_internal_test.c b/test/poly1305_internal_test.c
index d1d71c9..3631f34 100644
--- a/test/poly1305_internal_test.c
+++ b/test/poly1305_internal_test.c
@@ -16,6 +16,7 @@
 #include "internal/poly1305.h"
 #include "../crypto/poly1305/poly1305_local.h"
 #include "internal/nelem.h"
+#include "internal/cryptlib.h"
 
 typedef struct {
     size_t size;
@@ -40,8 +41,7 @@ static void benchmark_poly1305()
     POLY1305 poly1305;
     unsigned char key[32];
     unsigned char buf[8192];
-    unsigned long long stopwatch;
-    unsigned long long OPENSSL_rdtsc();
+    uint32_t stopwatch;
     unsigned int i;
 
     memset (buf,0x55,sizeof(buf));
diff --git a/test/siphash_internal_test.c b/test/siphash_internal_test.c
index d832aab..fe20762 100644
--- a/test/siphash_internal_test.c
+++ b/test/siphash_internal_test.c
@@ -17,6 +17,7 @@
 #include "internal/siphash.h"
 #include "../crypto/siphash/siphash_local.h"
 #include "internal/nelem.h"
+#include "internal/cryptlib.h"
 
 static BIO* b_stderr = NULL;
 static BIO* b_stdout = NULL;
@@ -43,8 +44,7 @@ static int benchmark_siphash(void)
     SIPHASH siphash;
     unsigned char key[SIPHASH_KEY_SIZE];
     unsigned char buf[8192];
-    unsigned long long stopwatch;
-    unsigned long long OPENSSL_rdtsc();
+    uint32_t stopwatch;
     unsigned int i;
 
     memset (buf,0x55,sizeof(buf));


More information about the openssl-commits mailing list