diff options
author | Andy Polyakov <appro@openssl.org> | 2019-01-23 14:56:19 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-02-01 09:23:25 +0100 |
commit | a28e4890eed847e6122a1c4d50653566e0813f45 (patch) | |
tree | 5b2f87aa82d3a84cf0a6c248d95e5d130b2e740f /crypto/ppccap.c | |
parent | perlasm/ppc-xlate.pl: add VSX word load/store instructions. (diff) | |
download | openssl-a28e4890eed847e6122a1c4d50653566e0813f45.tar.xz openssl-a28e4890eed847e6122a1c4d50653566e0813f45.zip |
poly1305/asm/poly1305-ppc.pl: add vector base 2^26 implementation.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8120)
Diffstat (limited to 'crypto/ppccap.c')
-rw-r--r-- | crypto/ppccap.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crypto/ppccap.c b/crypto/ppccap.c index 70829e4c0e..9601674041 100644 --- a/crypto/ppccap.c +++ b/crypto/ppccap.c @@ -116,10 +116,19 @@ void poly1305_blocks_fpu(void *ctx, const unsigned char *inp, size_t len, unsigned int padbit); void poly1305_emit_fpu(void *ctx, unsigned char mac[16], const unsigned int nonce[4]); +void poly1305_init_vsx(void *ctx, const unsigned char key[16]); +void poly1305_blocks_vsx(void *ctx, const unsigned char *inp, size_t len, + unsigned int padbit); +void poly1305_emit_vsx(void *ctx, unsigned char mac[16], + const unsigned int nonce[4]); int poly1305_init(void *ctx, const unsigned char key[16], void *func[2]); int poly1305_init(void *ctx, const unsigned char key[16], void *func[2]) { - if (sizeof(size_t) == 4 && (OPENSSL_ppccap_P & PPC_FPU)) { + if (OPENSSL_ppccap_P & PPC_CRYPTO207) { + poly1305_init_int(ctx, key); + func[0] = (void*)(uintptr_t)poly1305_blocks_vsx; + func[1] = (void*)(uintptr_t)poly1305_emit; + } else if (sizeof(size_t) == 4 && (OPENSSL_ppccap_P & PPC_FPU)) { poly1305_init_fpu(ctx, key); func[0] = (void*)(uintptr_t)poly1305_blocks_fpu; func[1] = (void*)(uintptr_t)poly1305_emit_fpu; |