Copyright | (C) Hécate Moonlight 2022 |
---|---|
License | BSD-3-Clause |
Maintainer | The Haskell Cryptography Group |
Stability | Stable |
Portability | GHC only |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- cryptoKDFKeygen :: Ptr Word8 -> IO ()
- cryptoKDFDeriveFromKey :: Ptr CUChar -> CSize -> Word64 -> Ptr CChar -> Ptr CUChar -> IO CInt
- cryptoKDFBytesMin :: CSize
- cryptoKDFBytesMax :: CSize
- cryptoKDFKeyBytes :: CSize
- cryptoKDFContextBytes :: CSize
Introduction
From a single, high-entropy key, you can derive multiple secret sub-keys.
This API can derive up to 2⁶⁴ keys from a single key and context, and these sub-keys can have an arbitrary length between 128 (16 bytes) and 512 bits (64 bytes).
Key Generation
:: Ptr Word8 | Pointer that will hold the master key of length |
-> IO () |
Generate a high-entropy key from which the sub-keys will be derived.
See: crypto_kdf_keygen()
Since: 0.0.1.0
cryptoKDFDeriveFromKey Source #
:: Ptr CUChar | Pointer that will hold the sub-key. |
-> CSize | Length of the sub-key. |
-> Word64 | Identifier of the sub-key. Must not be reused for another sub-key. |
-> Ptr CChar | Pointer to the context, of size |
-> Ptr CUChar | Pointer to the master key, which will be of length |
-> IO CInt | Returns 0 on success and -1 on error. |
Derive a sub-key from a high-entropy secre key with a unique identifier. The identifier can be any value up to 2⁶⁴-1
See: crypto_kdf_derive_from_key()
Since: 0.0.1.0