]> git.immae.eu Git - github/fretlink/hmacaroons.git/blobdiff - src/Crypto/Macaroon/Verifier.hs
Add quickcheck properties
[github/fretlink/hmacaroons.git] / src / Crypto / Macaroon / Verifier.hs
index 0d1636cb9d9be3c7b22caa4c31ea2c00c8dedb78..e257f5f71d4a5edf098c8425d4f788ae19d93b5d 100644 (file)
@@ -24,10 +24,10 @@ import           Crypto.Macaroon.Internal
 
 
 -- | Opaque datatype for now. Might need more explicit errors
-data Result = Success | Failure deriving (Show,Eq)
+data VResult = VSuccess | VFailure deriving (Show,Eq)
 
-verifySig :: Key -> Macaroon -> Result
-verifySig k m = bool Failure Success $
+verifySig :: Key -> Macaroon -> VResult
+verifySig k m = bool VFailure VSuccess $
       signature m == foldl' hash (toBytes (hmac derivedKey (identifier m) :: HMAC SHA256)) (caveats m)
   where
     hash s c = toBytes (hmac s (vid c `BS.append` cid c) :: HMAC SHA256)