Copyright | (c) 2024 Auth Global |
---|---|
License | Apache2 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
An implementation of PBKDF2-HMAC-SHA256
Synopsis
- pbkdf2 :: ByteString -> ByteString -> Word64 -> Int -> HashString
- pbkdf2_index :: ByteString -> ByteString -> Word32 -> Word64 -> HashString
- data Pbkdf2Ctx
- pbkdf2Ctx_init :: HmacKeyHashed -> Pbkdf2Ctx
- pbkdf2Ctx_feed :: ByteString -> Pbkdf2Ctx -> Pbkdf2Ctx
- pbkdf2Ctx_feeds :: Foldable f => f ByteString -> Pbkdf2Ctx -> Pbkdf2Ctx
- pbkdf2Ctx_update :: Pbkdf2Ctx -> ByteString -> Pbkdf2Ctx
- pbkdf2Ctx_updates :: Foldable f => Pbkdf2Ctx -> f ByteString -> Pbkdf2Ctx
- pbkdf2Ctx_finalize :: Word32 -> Pbkdf2Ctx -> Pbkdf2Gen
- data Pbkdf2Gen
- pbkdf2Gen_iterate :: Word64 -> Pbkdf2Gen -> Pbkdf2Gen
- pbkdf2Gen_finalize :: Pbkdf2Gen -> HashString
Documentation
:: ByteString | nominally the "password" |
-> ByteString | nominally the "salt" |
-> Word64 | number of rounds |
-> Int | desired length of output |
-> HashString |
Simple interface to PBKDF2. Reusing computations via partial application is not (yet!) supported. TODO: write pbkdf2 and pbkdf2_index functions in a point-free style.
:: ByteString | nominally the "password" |
-> ByteString | nominally the "salt" |
-> Word32 | the "index", returns the i-th block of output. The first index is 1, thus the result consists of bytes starting at 32*(i-1) and ending before 32*i. This is appended as 4 more bytes after the salt. |
-> Word64 | number of rounds |
-> HashString | 32-byte output" |
pbkdf2Ctx_feed :: ByteString -> Pbkdf2Ctx -> Pbkdf2Ctx Source #
Append some bytes to the end of the salt. Flipped version of pbkdf2Ctx_update
.
pbkdf2Ctx_feeds :: Foldable f => f ByteString -> Pbkdf2Ctx -> Pbkdf2Ctx Source #
Append zero or more bytestrings to the end of the salt. Flipped version of pbkdf2Ctx_updates
.
pbkdf2Ctx_update :: Pbkdf2Ctx -> ByteString -> Pbkdf2Ctx Source #
Append some bytes to the end of the salt. Flipped version of pbkdf2Ctx_feed
.
pbkdf2Ctx_updates :: Foldable f => Pbkdf2Ctx -> f ByteString -> Pbkdf2Ctx Source #
Append zero or more bytestrings to the end of the salt. Flipped version of pbkdf2Ctx_feeds
Append the index to the end of the salt, and then initialize a Pbkdf2Gen
with
one round applied.
Apply zero or more rounds to a pbkdf2 computation.