summaryrefslogtreecommitdiffstats
path: root/crypto/ppccap.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-08-14 19:19:11 +0200
committerAndy Polyakov <appro@openssl.org>2016-08-29 23:12:32 +0200
commitd8f432aa972973d20ecd3a8b47ac05a22d722d8d (patch)
treec98fd96d9a4acc13b6fe2f2cff9c46d1ab3d2574 /crypto/ppccap.c
parentb17ff188b17499e83ca3b9df0be47a2f513ac3c5 (diff)
Add ecp_nistz256-ppc64 module.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ppccap.c')
-rw-r--r--crypto/ppccap.c24
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)
{