diff options
author | Andy Polyakov <appro@openssl.org> | 2014-07-20 14:16:31 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2014-07-20 14:16:31 +0200 |
commit | 0e716d9207e00c9d967492b3b8bb89efad16bd06 (patch) | |
tree | 90f31bde709857570c9f7c4203b816bd6ae870ff /crypto/modes | |
parent | f5b798f50c83bed58d90f940e427552b97eddcb7 (diff) |
Engage GHASH for PowerISA 2.0.7.
[and split ppccap.c to ppccap.c and ppc_arch.h]
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/modes')
-rw-r--r-- | crypto/modes/Makefile | 2 | ||||
-rw-r--r-- | crypto/modes/gcm128.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/crypto/modes/Makefile b/crypto/modes/Makefile index d03284e869..ba0b094baa 100644 --- a/crypto/modes/Makefile +++ b/crypto/modes/Makefile @@ -62,6 +62,8 @@ ghash-parisc.s: asm/ghash-parisc.pl $(PERL) asm/ghash-parisc.pl $(PERLASM_SCHEME) $@ ghashv8-armx.S: asm/ghashv8-armx.pl $(PERL) asm/ghashv8-armx.pl $(PERLASM_SCHEME) $@ +ghashp8-ppc.s: asm/ghashp8-ppc.pl + $(PERL) asm/ghashp8-ppc.pl $(PERLASM_SCHEME) $@ # GNU make "catch all" ghash-%.S: asm/ghash-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ diff --git a/crypto/modes/gcm128.c b/crypto/modes/gcm128.c index 19cbcf5572..484142aefa 100644 --- a/crypto/modes/gcm128.c +++ b/crypto/modes/gcm128.c @@ -700,6 +700,13 @@ extern unsigned int OPENSSL_sparcv9cap_P[]; void gcm_init_vis3(u128 Htable[16],const u64 Xi[2]); void gcm_gmult_vis3(u64 Xi[2],const u128 Htable[16]); void gcm_ghash_vis3(u64 Xi[2],const u128 Htable[16],const u8 *inp,size_t len); +#elif defined(OPENSSL_CPUID_OBJ) && (defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC)) +# include "ppc_arch.h" +# define GHASH_ASM_PPC +# define GCM_FUNCREF_4BIT +void gcm_init_p8(u128 Htable[16],const u64 Xi[2]); +void gcm_gmult_p8(u64 Xi[2],const u128 Htable[16]); +void gcm_ghash_p8(u64 Xi[2],const u128 Htable[16],const u8 *inp,size_t len); # endif #endif @@ -803,6 +810,16 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block) ctx->gmult = gcm_gmult_4bit; ctx->ghash = gcm_ghash_4bit; } +# elif defined(GHASH_ASM_PPC) + if (OPENSSL_ppccap_P & PPC_CRYPTO207) { + gcm_init_p8(ctx->Htable,ctx->H.u); + ctx->gmult = gcm_gmult_p8; + ctx->ghash = gcm_ghash_p8; + } else { + gcm_init_4bit(ctx->Htable,ctx->H.u); + ctx->gmult = gcm_gmult_4bit; + ctx->ghash = gcm_ghash_4bit; + } # else gcm_init_4bit(ctx->Htable,ctx->H.u); # endif |