Skip to content

Commit

Permalink
Fix bitrotted tests/DSA.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
depressed-pho committed Apr 24, 2012
1 parent 9277f35 commit e989b40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -7,3 +7,6 @@ examples/GenRSAKey
examples/HelloWorld
examples/PKCS7
examples/Server
tests/Base64
tests/Cipher
tests/DSA
14 changes: 7 additions & 7 deletions tests/DSA.hs
Expand Up @@ -13,7 +13,7 @@ test_generateParameters = do
0xb6, 0x21, 0x1b, 0x40,
0x62, 0xba, 0x32, 0x24,
0xe0, 0x42, 0x7d, 0xd3]
(a, b, p, q, g) <- generateParameters 512 $ Just seed
(a, b, p, q, g) <- generateDSAParameters 512 $ Just seed
return $ (a, p, q, g) == (105,
0x8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8324f0d7882e5d0762fc5b7210eafc2e9adac32ab7aac49693dfbf83724c2ec0736ee31c80291,
0xc773218c737ec8ee993b4f2ded30f48edace915f,
Expand All @@ -22,16 +22,16 @@ test_generateParameters = do
testMessage = BS.pack [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]

test_signVerify = do
dsa <- generateParametersAndKey 512 Nothing
(a, b) <- signDigestedData dsa testMessage
verifyDigestedData dsa testMessage (a, b)
dsa <- generateDSAParametersAndKey 512 Nothing
(a, b) <- signDigestedDataWithDSA dsa testMessage
verifyDigestedDataWithDSA dsa testMessage (a, b)

test_signVerifySpeed = do
dsa <- generateParametersAndKey 512 Nothing
dsa <- generateDSAParametersAndKey 512 Nothing

let test = do
(a, b) <- signDigestedData dsa testMessage
True <- verifyDigestedData dsa testMessage (a, b)
(a, b) <- signDigestedDataWithDSA dsa testMessage
True <- verifyDigestedDataWithDSA dsa testMessage (a, b)
return ()

starttime <- getClockTime
Expand Down

0 comments on commit e989b40

Please sign in to comment.