diff options
author | Andy Polyakov <appro@openssl.org> | 2016-08-14 19:19:11 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2016-08-29 23:12:32 +0200 |
commit | d8f432aa972973d20ecd3a8b47ac05a22d722d8d (patch) | |
tree | c98fd96d9a4acc13b6fe2f2cff9c46d1ab3d2574 /crypto/ppccap.c | |
parent | perlasm/ppc-xlate.pl: recognize .type directive. (diff) | |
download | openssl-d8f432aa972973d20ecd3a8b47ac05a22d722d8d.tar.xz openssl-d8f432aa972973d20ecd3a8b47ac05a22d722d8d.zip |
Add ecp_nistz256-ppc64 module.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ppccap.c')
-rw-r--r-- | crypto/ppccap.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crypto/ppccap.c b/crypto/ppccap.c index ef38b172d9..28cfa199e5 100644 --- a/crypto/ppccap.c +++ b/crypto/ppccap.c @@ -131,6 +131,30 @@ int poly1305_init(void *ctx, const unsigned char key[16], void *func[2]) } #endif +#ifdef ECP_NISTZ256_ASM +void ecp_nistz256_mul_mont(unsigned long res[4], const unsigned long a[4], + const unsigned long b[4]); + +void ecp_nistz256_to_mont(unsigned long res[4], const unsigned long in[4]); +void ecp_nistz256_to_mont(unsigned long res[4], const unsigned long in[4]) +{ + static const unsigned long RR[] = { 0x0000000000000003U, + 0xfffffffbffffffffU, + 0xfffffffffffffffeU, + 0x00000004fffffffdU }; + + ecp_nistz256_mul_mont(res, in, RR); +} + +void ecp_nistz256_from_mont(unsigned long res[4], const unsigned long in[4]); +void ecp_nistz256_from_mont(unsigned long res[4], const unsigned long in[4]) +{ + static const unsigned long one[] = { 1, 0, 0, 0 }; + + ecp_nistz256_mul_mont(res, in, one); +} +#endif + static sigjmp_buf ill_jmp; static void ill_handler(int sig) { |