diff options
Diffstat (limited to 'test/lua/unit/rsa.lua')
-rw-r--r-- | test/lua/unit/rsa.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lua/unit/rsa.lua b/test/lua/unit/rsa.lua index c67a36abb..019212df4 100644 --- a/test/lua/unit/rsa.lua +++ b/test/lua/unit/rsa.lua @@ -47,4 +47,14 @@ context("RSA signature verification test", function() sk, pk = rsa.keypair() assert_false(rsa.verify_memory(pk, sig, "test")) end) + + test("RSA-2048 keypair + sign + verify", function() + local sk, pk = rsa.keypair(2048) + local sig = rsa.sign_memory(sk, "test") + assert_true(rsa.verify_memory(pk, sig, "test")) + assert_false(rsa.verify_memory(pk, sig, "test1")) + -- Overwrite + sk, pk = rsa.keypair(2048) + assert_false(rsa.verify_memory(pk, sig, "test")) + end) end) |