summaryrefslogtreecommitdiffstats
path: root/crypto/sha
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2004-08-29 16:36:05 +0000
committerAndy Polyakov <appro@openssl.org>2004-08-29 16:36:05 +0000
commit2b247cf81fbc320a313f952e2ea39cf63aa21010 (patch)
treed81b7181197eb2360ef8048ca9b488eff54b6e0f /crypto/sha
parent746fc2526ffc17d57a5fb87568d01400cbcf62fd (diff)
OPENSSL_ia32cap final touches. Note that OPENSSL_ia32cap is no longer a
symbol, but a macro expanded as (*(OPENSSL_ia32cap_loc())). The latter is the only one to be exported to application.
Diffstat (limited to 'crypto/sha')
-rw-r--r--crypto/sha/sha512.c7
-rw-r--r--crypto/sha/sha512t.c8
2 files changed, 9 insertions, 6 deletions
diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c
index bd1a125485..c84bd5addf 100644
--- a/crypto/sha/sha512.c
+++ b/crypto/sha/sha512.c
@@ -48,6 +48,8 @@
#include <openssl/sha.h>
#include <openssl/opensslv.h>
+#include "cryptlib.h"
+
const char *SHA512_version="SHA-512" OPENSSL_VERSION_PTEXT;
#if defined(_M_IX86) || defined(_M_AMD64) || defined(__i386) || defined(__x86_64)
@@ -347,9 +349,8 @@ static const SHA_LONG64 K512[80] = {
#if defined(OPENSSL_IA32_SSE2) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY)
#define GO_FOR_SSE2(ctx,in,num) do { \
- extern int OPENSSL_ia32cap; \
- void sha512_block_sse2(void *,const void *,size_t); \
- if (!(OPENSSL_ia32cap & (1<<26))) break; \
+ void sha512_block_sse2(void *,const void *,size_t); \
+ if (!(OPENSSL_ia32cap_P & (1<<26))) break; \
sha512_block_sse2(ctx->h,in,num); return; \
} while (0)
#endif
diff --git a/crypto/sha/sha512t.c b/crypto/sha/sha512t.c
index 96a71efb8e..7385469bee 100644
--- a/crypto/sha/sha512t.c
+++ b/crypto/sha/sha512t.c
@@ -9,6 +9,7 @@
#include <openssl/sha.h>
#include <openssl/evp.h>
+#include <openssl/crypto.h>
unsigned char app_c1[SHA512_DIGEST_LENGTH] = {
0xdd,0xaf,0x35,0xa1,0x93,0x61,0x7a,0xba,
@@ -70,11 +71,12 @@ int main ()
EVP_MD_CTX evp;
#ifdef OPENSSL_IA32_SSE2
- { extern int OPENSSL_ia32cap;
- char *env;
+ /* Alternative to this is to call OpenSSL_add_all_algorithms...
+ * The below code is retained exclusively for debugging purposes. */
+ { char *env;
if ((env=getenv("OPENSSL_ia32cap")))
- OPENSSL_ia32cap = strtol (env,NULL,0);
+ OPENSSL_ia32cap = strtoul (env,NULL,0);
}
#endif