diff options
author | Nicolas Noble <pixel@nobis-crew.org> | 2013-08-12 11:21:26 -0700 |
---|---|---|
committer | Nicolas Noble <pixel@nobis-crew.org> | 2013-08-12 11:21:26 -0700 |
commit | 775ee7779d065b33577a97d25079b5c70ec834d1 (patch) | |
tree | d1152401f6bb8e215d7f1cad73482e20562c89d7 /tests | |
parent | 70e20e2f44466bf17de60a84567f1317f66bd928 (diff) |
Adding modpow test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test3.lua | 6 |
1 files changed, 6 insertions, 0 deletions
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 |