Safe Haskell | None |
---|---|
Language | Haskell2010 |
Crypto.Key.Internal
Description
Key derivation/generation internals.
Synopsis
- data Params = Params {}
- type DerivationSlip = ByteString
- derive :: (ByteArrayAccess passwd, ByteArrayN n key, CRYPTO_PWHASH_BYTES_MIN <= n, n <= CRYPTO_PWHASH_BYTES_MAX) => Params -> passwd -> IO (Maybe (key, DerivationSlip))
- rederive :: (ByteArrayAccess passwd, ByteArrayN n key, CRYPTO_PWHASH_BYTES_MIN <= n, n <= CRYPTO_PWHASH_BYTES_MAX) => DerivationSlip -> passwd -> IO (Maybe key)
- data DerivationSlipData = DerivationSlipData {
- params :: !Params
- salt :: !(Salt ByteString)
- derivationSlipEncode :: DerivationSlipData -> DerivationSlip
- derivationSlipDecode :: DerivationSlip -> Maybe DerivationSlipData
Documentation
Secure-hashing parameters.
Constructors
Params | |
type DerivationSlip = ByteString Source #
Opaque bytes that contain the salt and pwhash params.
derive :: (ByteArrayAccess passwd, ByteArrayN n key, CRYPTO_PWHASH_BYTES_MIN <= n, n <= CRYPTO_PWHASH_BYTES_MAX) => Params -> passwd -> IO (Maybe (key, DerivationSlip)) Source #
Derive a key for the first time.
rederive :: (ByteArrayAccess passwd, ByteArrayN n key, CRYPTO_PWHASH_BYTES_MIN <= n, n <= CRYPTO_PWHASH_BYTES_MAX) => DerivationSlip -> passwd -> IO (Maybe key) Source #
Derive the same key form the same password again.
data DerivationSlipData Source #
Data contained in a derivation slip.
This data type is used only internally within this module for convenience. It is exported only for testing purposes.
Currently only one KDF is supported, so it is assumed implicitly, however the actual binary encoding contains an identifier of the KDF used (for forward-compatibility).
Constructors
DerivationSlipData | |
Fields
|
Instances
Eq DerivationSlipData Source # | |
Defined in Crypto.Key.Internal Methods (==) :: DerivationSlipData -> DerivationSlipData -> Bool # (/=) :: DerivationSlipData -> DerivationSlipData -> Bool # | |
Show DerivationSlipData Source # | |
Defined in Crypto.Key.Internal Methods showsPrec :: Int -> DerivationSlipData -> ShowS # show :: DerivationSlipData -> String # showList :: [DerivationSlipData] -> ShowS # | |
Serialize DerivationSlipData Source # | |
Defined in Crypto.Key.Internal |
derivationSlipEncode :: DerivationSlipData -> DerivationSlip Source #
Encode derivation slip data into bytes.
derivationSlipDecode :: DerivationSlip -> Maybe DerivationSlipData Source #
Decode derivation slip data from bytes.