File: BenchHMAC.hs

package info (click to toggle)
haskell-cryptohash 0.11.9-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 336 kB
  • sloc: haskell: 1,325; ansic: 991; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 303 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12

import Criterion.Main
import Crypto.Hash
import qualified Data.ByteString as B
import Data.Byteable

main = do
    let b32 = B.replicate 32 0
    defaultMain
        [ bench "hmac-md5" $ whnf (toBytes . hmacAlg MD5 b32) b32
        , bench "hmac-sha1" $ whnf (toBytes . hmacAlg SHA1 b32) b32
        ]