1 {-#LANGUAGE OverloadedStrings #-}
3 import Data.ByteString (ByteString)
7 import Crypto.Macaroon.Internal
11 loc = "http://mybank/"
14 ident = "we used our secret key"
17 key = "this is our super secret key; only we should know it"
23 {-#INLINE benchCreate#-}
24 benchCreate :: (Key, Key, Location) -> Macaroon
25 benchCreate (secret, ident, loc) = create secret ident loc
27 {-#INLINE benchMint #-}
28 benchMint :: ((Key, Key, Location), ByteString) -> Macaroon
29 benchMint (ms,c) = addFirstPartyCaveat c (benchCreate ms)
32 bgroup "Crypto.Macaroon" [ bench "create" $ nf benchCreate (key,ident,loc)
33 , bench "mint" $ nf benchMint ((key,ident,loc),cav)