| License | BSD-style |
|---|---|
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Crypto.KDF.Scrypt
Description
Scrypt key derivation function as defined in Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard Functions" http://www.tarsnap.com/scrypt/scrypt.pdf.
Synopsis
- data Parameters = Parameters {
- n :: Word64
- r :: Int
- p :: Int
- outputLength :: Int
- generate :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray output) => Parameters -> password -> salt -> output
- tryGenerate :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray output) => Parameters -> password -> salt -> CryptoFailable output
Documentation
data Parameters Source #
Parameters for Scrypt
Constructors
| Parameters | |
Fields
| |
generate :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray output) => Parameters -> password -> salt -> output Source #
Generate the scrypt key derivation data
Parameters the implementation refuses raise a CryptoError; tryGenerate
reports the same condition as CryptoFailed.
tryGenerate :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray output) => Parameters -> password -> salt -> CryptoFailable output Source #
Generate the scrypt key derivation data, reporting parameters the implementation refuses rather than raising.
n has to be a power of two greater than 1, r and p positive, r
times p below 2^30, and the 128 * r * n bytes of working memory
addressable.