diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-10 17:53:51 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-10 17:53:51 -0400 |
commit | c20d6f4189e1e0c3a1e8339f772df587fac38748 (patch) | |
tree | 9ea59000b21fa1d24904f843dedbab717bfdccbb /Utility | |
parent | b573d91aa27a315fe9b155349a0a90805dc01181 (diff) |
responding to pair requests *almost* works
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Verifiable.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Utility/Verifiable.hs b/Utility/Verifiable.hs index b177787c4..d586d7453 100644 --- a/Utility/Verifiable.hs +++ b/Utility/Verifiable.hs @@ -24,14 +24,14 @@ data Verifiable a = Verifiable mkVerifiable :: Show a => a -> Secret -> Verifiable a mkVerifiable a secret = Verifiable a (calcDigest (show a) secret) -verified :: (Eq a, Show a) => Verifiable a -> Secret -> Bool -verified v secret = v == mkVerifiable (verifiableVal v) secret +verify :: (Eq a, Show a) => Verifiable a -> Secret -> Bool +verify v secret = v == mkVerifiable (verifiableVal v) secret calcDigest :: String -> Secret -> HMACDigest calcDigest v secret = showDigest $ hmacSha1 secret $ fromString v {- for quickcheck -} prop_verifiable_sane :: String -> String -> Bool -prop_verifiable_sane a s = verified (mkVerifiable a secret) secret +prop_verifiable_sane a s = verify (mkVerifiable a secret) secret where secret = fromString s |