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. --- tests/test3.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/test3.lua') 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