diff options
Diffstat (limited to 'src/lib/libcrypto/whrlpool/wp_block.c')
-rw-r--r-- | src/lib/libcrypto/whrlpool/wp_block.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/libcrypto/whrlpool/wp_block.c b/src/lib/libcrypto/whrlpool/wp_block.c index d8c1b89ba3..1e00a01330 100644 --- a/src/lib/libcrypto/whrlpool/wp_block.c +++ b/src/lib/libcrypto/whrlpool/wp_block.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: wp_block.c,v 1.12 2016/09/04 14:06:46 jsing Exp $ */ | 1 | /* $OpenBSD: wp_block.c,v 1.13 2016/11/04 17:30:30 miod Exp $ */ |
2 | /** | 2 | /** |
3 | * The Whirlpool hashing function. | 3 | * The Whirlpool hashing function. |
4 | * | 4 | * |
@@ -36,10 +36,12 @@ | |||
36 | * | 36 | * |
37 | */ | 37 | */ |
38 | 38 | ||
39 | #include "wp_locl.h" | ||
40 | #include <string.h> | 39 | #include <string.h> |
40 | #include <openssl/crypto.h> | ||
41 | #include <machine/endian.h> | 41 | #include <machine/endian.h> |
42 | 42 | ||
43 | #include "wp_locl.h" | ||
44 | |||
43 | typedef unsigned char u8; | 45 | typedef unsigned char u8; |
44 | #if defined(_LP64) | 46 | #if defined(_LP64) |
45 | typedef unsigned long u64; | 47 | typedef unsigned long u64; |
@@ -57,12 +59,15 @@ typedef unsigned long long u64; | |||
57 | # define OPENSSL_SMALL_FOOTPRINT /* it appears that for elder non-MMX | 59 | # define OPENSSL_SMALL_FOOTPRINT /* it appears that for elder non-MMX |
58 | CPUs this is actually faster! */ | 60 | CPUs this is actually faster! */ |
59 | # endif | 61 | # endif |
60 | # define GO_FOR_MMX(ctx,inp,num) do { \ | 62 | #include "x86_arch.h" |
61 | extern unsigned int OPENSSL_ia32cap_P[]; \ | 63 | # define GO_FOR_MMX(ctx,inp,num) \ |
64 | do { \ | ||
62 | void whirlpool_block_mmx(void *,const void *,size_t); \ | 65 | void whirlpool_block_mmx(void *,const void *,size_t); \ |
63 | if (!(OPENSSL_ia32cap_P[0] & (1<<23))) break; \ | 66 | if ((OPENSSL_cpu_caps() & CPUCAP_MASK_MMX) == 0) \ |
64 | whirlpool_block_mmx(ctx->H.c,inp,num); return; \ | 67 | break; \ |
65 | } while (0) | 68 | whirlpool_block_mmx(ctx->H.c,inp,num); \ |
69 | return; \ | ||
70 | } while (0) | ||
66 | # endif | 71 | # endif |
67 | #elif defined(__arm__) | 72 | #elif defined(__arm__) |
68 | # define SMALL_REGISTER_BANK | 73 | # define SMALL_REGISTER_BANK |