modexp: Implement simple mp_modexp function.
[u/mdw/catacomb] / tests / mp
index ab2e775..a7c5d50 100644 (file)
--- a/tests/mp
+++ b/tests/mp
@@ -223,6 +223,23 @@ modsqrt {
   660864223630638896 1729533840094059799 671335997718840076;
 }
 
+modexp {
+
+  # --- Montgomery exponentiation ---
+
+  435365332435654643667 8745435676786567758678547 
+    4325987397987458979875737589783
+    2439674515119108242643169132064;
+  0xfffffffdfffffffffffffffffffffffe 0 0xfffffffdffffffffffffffffffffffff 1;
+  1804289383 -8939035539979879765 8939489893434234331 6139425926295484741;
+
+  # --- Barrett exponentiation ---
+
+  435365332435654643667 8745435676786567758678547
+    4325987397987458979875737589782
+    2425191520487853884024972777945;
+}
+
 factorial {
   0 1;
   1 1;