crypton-2.2.5: Cryptography Primitives
LicenseBSD-style
Stabilityexperimental
PortabilityGood
Safe HaskellNone
LanguageHaskell2010

Crypto.KDF.BCryptPBKDF

Description

Port of the bcrypt_pbkdf key derivation function from OpenBSD as described at http://man.openbsd.org/bcrypt_pbkdf.3.

Synopsis

Documentation

data Parameters Source #

Constructors

Parameters 

Fields

  • iterCounts :: Int

    The number of user-defined iterations for the algorithm (must be > 0)

  • outputLength :: Int

    The number of bytes to generate out of BCryptPBKDF (must be in 1..1024)

generate :: (ByteArray pass, ByteArray salt, ByteArray output) => Parameters -> pass -> salt -> output Source #

Derive a key of specified length using the bcrypt_pbkdf algorithm.

Parameters outside the ranges documented for Parameters raise CryptoError_ParameterInvalid; tryGenerate reports the same condition as CryptoFailed.

tryGenerate :: (ByteArray pass, ByteArray salt, ByteArray output) => Parameters -> pass -> salt -> CryptoFailable output Source #

Derive a key of specified length using the bcrypt_pbkdf algorithm, reporting parameters the implementation refuses rather than raising.

hashInternal :: (ByteArrayAccess pass, ByteArrayAccess salt, ByteArray output) => pass -> salt -> output Source #

Internal hash function used by generate.

Normal users should not need this.

Inputs that are not 512 bits long raise CryptoError_ParameterInvalid; tryHashInternal reports the same condition as CryptoFailed.

tryHashInternal :: (ByteArrayAccess pass, ByteArrayAccess salt, ByteArray output) => pass -> salt -> CryptoFailable output Source #

Internal hash function used by tryGenerate, reporting inputs the implementation refuses rather than raising.

Normal users should not need this.