diff options
author | Andy Polyakov <appro@openssl.org> | 2014-07-20 14:36:49 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2014-07-20 14:36:49 +0200 |
commit | c991d8ae8bf712983ba527eef43388d8bb120a03 (patch) | |
tree | 7ddbeafe135648b3f22d561c56e9ee9fea540203 /crypto/ppccap.c | |
parent | be12cb3e24ad15343e83e826a63a9aa4a3edaea7 (diff) |
Initial POWER8 support from development branch.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/ppccap.c')
-rw-r--r-- | crypto/ppccap.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/crypto/ppccap.c b/crypto/ppccap.c index d78bfbcdbb..13c2ca5162 100644 --- a/crypto/ppccap.c +++ b/crypto/ppccap.c @@ -10,8 +10,7 @@ #include <crypto.h> #include <openssl/bn.h> -#define PPC_FPU64 (1<<0) -#define PPC_ALTIVEC (1<<1) +#include "ppc_arch.h" unsigned int OPENSSL_ppccap_P = 0; @@ -53,11 +52,28 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_U } #endif +void sha256_block_p8(void *ctx,const void *inp,size_t len); +void sha256_block_ppc(void *ctx,const void *inp,size_t len); +void sha256_block_data_order(void *ctx,const void *inp,size_t len) + { + OPENSSL_ppccap_P&PPC_CRYPTO207? sha256_block_p8(ctx,inp,len): + sha256_block_ppc(ctx,inp,len); + } + +void sha512_block_p8(void *ctx,const void *inp,size_t len); +void sha512_block_ppc(void *ctx,const void *inp,size_t len); +void sha512_block_data_order(void *ctx,const void *inp,size_t len) + { + OPENSSL_ppccap_P&PPC_CRYPTO207? sha512_block_p8(ctx,inp,len): + sha512_block_ppc(ctx,inp,len); + } + static sigjmp_buf ill_jmp; static void ill_handler (int sig) { siglongjmp(ill_jmp,sig); } void OPENSSL_ppc64_probe(void); void OPENSSL_altivec_probe(void); +void OPENSSL_crypto207_probe(void); void OPENSSL_cpuid_setup(void) { @@ -128,6 +144,11 @@ void OPENSSL_cpuid_setup(void) { OPENSSL_altivec_probe(); OPENSSL_ppccap_P |= PPC_ALTIVEC; + if (sigsetjmp(ill_jmp,1) == 0) + { + OPENSSL_crypto207_probe(); + OPENSSL_ppccap_P |= PPC_CRYPTO207; + } } sigaction (SIGILL,&ill_oact,NULL); |