diff options
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); |