From 775ee7779d065b33577a97d25079b5c70ec834d1 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Mon, 12 Aug 2013 11:21:26 -0700 Subject: Adding modpow test. --- Balau | 2 +- tests/test3.lua | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Balau b/Balau index 7584692..a91c3d3 160000 --- a/Balau +++ b/Balau @@ -1 +1 @@ -Subproject commit 758469279bda5810ed7cef45b5f301234bfc7596 +Subproject commit a91c3d3a6cb5e71c6376b1efe7d037f02b36f035 diff --git a/tests/test3.lua b/tests/test3.lua index aeea660..f52099b 100644 --- a/tests/test3.lua +++ b/tests/test3.lua @@ -7,4 +7,10 @@ function test3() if z == 6912 then error "bigint2" end -- this is the proper comparison. if z ~= BigInt.new(6912) then error "bigint3" end + + x = BigInt.new "2570928358736459287364501827645832746923875623845" + y = BigInt.new "52934875203984750192837512983750192582348756" + local m = BigInt.new "6971908475092834619032845610238976458374561729345017823461297384" + z = x:modpow(y, m) + if tostring(z) ~= "2205750725547192694097770347478670564947020421824213327486286017" then error "bigint4" end end -- cgit v1.2.3