Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1808,15 +1808,15 @@ test_SignatureVerification =
[ testPropertyNamed
"Ed25519 verification behaves correctly on all inputs"
"ed25519_correct"
. mapTestLimitAtLeast 99 (`div` 10)
. mapTestLimitAtLeast 300 (`div` 10)
$ property ed25519Prop
]
, testGroup
"Signatures on the SECP256k1 curve"
[ testPropertyNamed
"ECDSA verification behaves correctly on all inputs"
"ecdsa_correct"
. mapTestLimitAtLeast 99 (`div` 10)
. mapTestLimitAtLeast 5000 (`div` 10)
$ property ecdsaSecp256k1Prop
, testPropertyNamed
"Schnorr verification behaves correctly on all inputs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,35 +62,35 @@ import Text.Show.Pretty (ppShow)
ecdsaSecp256k1Prop :: PropertyT IO ()
ecdsaSecp256k1Prop = do
testCase <- forAllWith ppShow genEcdsaCase
cover 4 "malformed verification key" . is (_ShouldError . _BadVerKey) $ testCase
cover 4 "malformed message" . is (_ShouldError . _BadMessage) $ testCase
cover 4 "malformed signature" . is (_ShouldError . _BadSignature) $ testCase
cover 4 "mismatch of signing key and verification key" . is (_Shouldn'tError . _WrongVerKey) $
cover 15 "malformed verification key" . is (_ShouldError . _BadVerKey) $ testCase
cover 15 "malformed message" . is (_ShouldError . _BadMessage) $ testCase
cover 15 "malformed signature" . is (_ShouldError . _BadSignature) $ testCase
cover 15 "mismatch of signing key and verification key" . is (_Shouldn'tError . _WrongVerKey) $
testCase
cover 4 "mismatch of message and signature" . is (_Shouldn'tError . _WrongSignature) $ testCase
cover 4 "happy path" . is (_Shouldn'tError . _AllGood) $ testCase
cover 15 "mismatch of message and signature" . is (_Shouldn'tError . _WrongSignature) $ testCase
cover 15 "happy path" . is (_Shouldn'tError . _AllGood) $ testCase
runTestDataWith def testCase fromMessageHash VerifyEcdsaSecp256k1Signature

schnorrSecp256k1Prop :: PropertyT IO ()
schnorrSecp256k1Prop = do
testCase <- forAllWith ppShow genSchnorrCase
cover 5 "malformed verification key" . is (_ShouldError . _BadVerKey) $ testCase
cover 5 "malformed signature" . is (_ShouldError . _BadSignature) $ testCase
cover 5 "mismatch of signing key and verification key" . is (_Shouldn'tError . _WrongVerKey) $
cover 15 "malformed verification key" . is (_ShouldError . _BadVerKey) $ testCase
cover 15 "malformed signature" . is (_ShouldError . _BadSignature) $ testCase
cover 15 "mismatch of signing key and verification key" . is (_Shouldn'tError . _WrongVerKey) $
testCase
cover 5 "mismatch of message and signature" . is (_Shouldn'tError . _WrongSignature) $ testCase
cover 5 "happy path" . is (_Shouldn'tError . _AllGood) $ testCase
cover 15 "mismatch of message and signature" . is (_Shouldn'tError . _WrongSignature) $ testCase
cover 15 "happy path" . is (_Shouldn'tError . _AllGood) $ testCase
runTestDataWith def testCase id VerifySchnorrSecp256k1Signature

ed25519Prop :: PropertyT IO ()
ed25519Prop = do
testCase <- forAllWith ppShow genEd25519Case
cover 5 "malformed verification key" . is (_ShouldError . _BadVerKey) $ testCase
cover 5 "malformed signature" . is (_ShouldError . _BadSignature) $ testCase
cover 5 "mismatch of signing key and verification key" . is (_Shouldn'tError . _WrongVerKey) $
cover 15 "malformed verification key" . is (_ShouldError . _BadVerKey) $ testCase
cover 15 "malformed signature" . is (_ShouldError . _BadSignature) $ testCase
cover 15 "mismatch of signing key and verification key" . is (_Shouldn'tError . _WrongVerKey) $
testCase
cover 5 "mismatch of message and signature" . is (_Shouldn'tError . _WrongSignature) $ testCase
cover 5 "happy path" . is (_Shouldn'tError . _AllGood) $ testCase
cover 15 "mismatch of message and signature" . is (_Shouldn'tError . _WrongSignature) $ testCase
cover 15 "happy path" . is (_Shouldn'tError . _AllGood) $ testCase
runTestDataWith def testCase id VerifyEd25519Signature

-- Helpers
Expand Down