summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test-BigInt.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-BigInt.cc b/tests/test-BigInt.cc
index df69e64..56f195b 100644
--- a/tests/test-BigInt.cc
+++ b/tests/test-BigInt.cc
@@ -16,5 +16,20 @@ void MainTask::Do() {
TAssert(a.toString() == s);
}
+ {
+ BigInt a, b, m, r, c;
+
+ // random values; c is computed by wolfram alpha.
+ a.set("23475098273405987234905872394051923847902348567");
+ b.set("3234057230495872034923458723049857203948572039485734598276345987");
+ m.set("534287528093746598127364987236459872634587");
+
+ c.set("211833264233843026809053124694679687014311");
+
+ r = a.modpow(b, m);
+
+ TAssert(r == c);
+ }
+
Printer::log(M_STATUS, "Test::BigInt passed.");
}