From: Andy Polyakov Date: Sun, 25 Jul 2004 18:25:24 +0000 (+0000) Subject: Make SHA-256/-512 optional. Note that no-sha switches off *all* SHA. X-Git-Tag: BEN_FIPS_TEST_6~14^2~130 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fbf96849e9e48750338eba1e2f4cc04d1ae4c1fd;p=oweals%2Fopenssl.git Make SHA-256/-512 optional. Note that no-sha switches off *all* SHA. --- diff --git a/crypto/sha/sha256.c b/crypto/sha/sha256.c index 21aa5d7d0d..618ba3bc10 100644 --- a/crypto/sha/sha256.c +++ b/crypto/sha/sha256.c @@ -4,6 +4,8 @@ * according to the OpenSSL license [found in ../../LICENSE]. * ==================================================================== */ +#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA256) + #include #include @@ -311,3 +313,5 @@ void HASH_BLOCK_HOST_ORDER (SHA256_CTX *ctx, const void *in, size_t num) void HASH_BLOCK_DATA_ORDER (SHA256_CTX *ctx, const void *in, size_t num) { sha256_block (ctx,in,num,0); } + +#endif /* OPENSSL_NO_SHA256 */ diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c index b328fe71d4..bd1a125485 100644 --- a/crypto/sha/sha512.c +++ b/crypto/sha/sha512.c @@ -4,6 +4,7 @@ * according to the OpenSSL license [found in ../../LICENSE]. * ==================================================================== */ +#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA512) /* * IMPLEMENTATION NOTES. * @@ -344,7 +345,7 @@ static const SHA_LONG64 K512[80] = { #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) -#if defined(OPENSSL_IA32_SSE2) && !defined(OPENSSL_NO_ASM) +#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); \ @@ -490,3 +491,5 @@ static void sha512_block (SHA512_CTX *ctx, const void *in, size_t num) #endif #endif /* SHA512_ASM */ + +#endif /* OPENSSL_NO_SHA512 */