summaryrefslogtreecommitdiff
path: root/src/mp.h
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-04-08 01:11:48 +0200
committerGitHub <[email protected]>2020-04-08 01:11:48 +0200
commit8bdf0d013359d295e7b26b46d553c9525d7ed0cb (patch)
tree96235fd9d2df5736553ecc884a9f1b0050ae2365 /src/mp.h
parent2e5b3891e485237a7860a84b141a770b0a867ea1 (diff)
downloadmate-calc-8bdf0d013359d295e7b26b46d553c9525d7ed0cb.tar.bz2
mate-calc-8bdf0d013359d295e7b26b46d553c9525d7ed0cb.tar.xz
Add modular exponentiation ability and add acccording tests
Diffstat (limited to 'src/mp.h')
-rw-r--r--src/mp.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mp.h b/src/mp.h
index f57ff16..3e03089 100644
--- a/src/mp.h
+++ b/src/mp.h
@@ -204,6 +204,9 @@ void mp_factorial(const MPNumber *x, MPNumber *z);
/* Sets z = x mod y */
void mp_modulus_divide(const MPNumber *x, const MPNumber *y, MPNumber *z);
+/* Sets z = x ^ y mod p */
+void mp_modular_exponentiation(const MPNumber *x, const MPNumber *y, const MPNumber *p, MPNumber *z);
+
/* Sets z = x^y */
void mp_xpowy(const MPNumber *x, const MPNumber *y, MPNumber *z);