summaryrefslogtreecommitdiffstats
path: root/crypto/ppccap.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2019-01-23 14:56:19 +0100
committerRichard Levitte <levitte@openssl.org>2019-02-01 09:23:25 +0100
commita28e4890eed847e6122a1c4d50653566e0813f45 (patch)
tree5b2f87aa82d3a84cf0a6c248d95e5d130b2e740f /crypto/ppccap.c
parentperlasm/ppc-xlate.pl: add VSX word load/store instructions. (diff)
downloadopenssl-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.c11
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;