pbkdf

Pure Haskell password-based KDF (docs.ppad.tech/pbkdf).
git clone git://git.ppad.tech/pbkdf.git
Log | Files | Refs | README | LICENSE

Main.hs (591B)


      1 {-# LANGUAGE OverloadedStrings #-}
      2 
      3 module Main where
      4 
      5 import Criterion.Main
      6 import qualified Crypto.KDF.PBKDF as KDF
      7 import qualified Crypto.Hash.SHA256 as SHA256
      8 import qualified Crypto.Hash.SHA512 as SHA512
      9 
     10 main :: IO ()
     11 main = defaultMain [
     12     suite
     13   ]
     14 
     15 suite :: Benchmark
     16 suite =
     17   bgroup "ppad-pbkdf" [
     18     bgroup "PBKDF-SHA256" [
     19       bench "derive (outlen 32)" $
     20         nf (KDF.derive SHA256.hmac "muh password" "muh salt" 32) 64
     21     ]
     22   , bgroup "PBKDF-SHA512" [
     23       bench "derive (outlen 32)" $
     24         nf (KDF.derive SHA512.hmac "muh password" "muh salt" 32) 64
     25     ]
     26   ]
     27