cleanup in PBKDF2

This commit is contained in:
Vincent Hanquez 2014-07-23 05:58:22 -07:00
parent 9c9007c3b0
commit 480ff26a34

View File

@ -1,4 +1,3 @@
{-# LANGUAGE BangPatterns #-}
-- | -- |
-- Module : Crypto.KDF.PBKDF2 -- Module : Crypto.KDF.PBKDF2
-- License : BSD-style -- License : BSD-style
@ -8,6 +7,7 @@
-- --
-- Password Based Key Derivation Function 2 -- Password Based Key Derivation Function 2
-- --
{-# LANGUAGE BangPatterns #-}
module Crypto.KDF.PBKDF2 module Crypto.KDF.PBKDF2
( PRF ( PRF
, prfHMAC , prfHMAC
@ -44,10 +44,10 @@ prfHMAC alg k = hmacIncr alg (HMAC.initialize k)
-- | Parameters for PBKDF2 -- | Parameters for PBKDF2
data Parameters = Parameters data Parameters = Parameters
{ password :: ByteString { password :: ByteString -- ^ Password (bytes encoded)
, salt :: ByteString , salt :: ByteString -- ^ Salut (bytes encoded)
, iterCounts :: Int , iterCounts :: Int -- ^ the number of user-defined iterations for the algorithms. e.g. WPA2 uses 4000.
, outputLength :: Int , outputLength :: Int -- ^ the number of bytes to generate out of PBKDF2
} }
-- | generate the pbkdf2 key derivation function from the output -- | generate the pbkdf2 key derivation function from the output