Slightly better test generation for RSA signatures.

This commit is contained in:
2018-05-01 22:29:37 -07:00
parent 296bb6ad90
commit c9092ffe6a

View File

@@ -91,6 +91,12 @@ runSignatureGenerator inputs outputs =
Left _ ->
go (Just keySize) g3
Right sig ->
case rsassa_pkcs1_v1_5_verify hash public (BSL.fromStrict message) sig of
Left err ->
fail ("RSA Verification error: " ++ show err)
Right False ->
fail ("RSA verification failed?!")
Right True ->
do writeChan outputs [("d", showHex (private_d private) ""),
("n", showHex (public_n public) ""),
("h", hashname),