cryptoKDFKeygen :: Ptr Word8Pointer that will hold the master key of length cryptoKDFKeyBytes
-> IO ()
Generate a high-entropy key from which the sub-keys will be derived.
See: crypto_kdf_keygen()
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulelibsodium-bindings-0.0.1.1Haskell2010
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).
cryptoKDFKeygen :: Ptr Word8Pointer that will hold the master key of length cryptoKDFKeyBytes
-> IO ()Generate a high-entropy key from which the sub-keys will be derived.
See: crypto_kdf_keygen()
cryptoKDFDeriveFromKey :: Ptr CUCharPointer that will hold the sub-key.
-> CSizeLength of the sub-key.
-> Word64Identifier of the sub-key. Must not be reused for another sub-key.
-> Ptr CCharPointer to the context, of size cryptoKDFContextBytes.
-> Ptr CUCharPointer to the master key, which will be of length cryptoKDFKeyBytes.
-> IO CIntReturns 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
Minimum length of a sub-key.
See: crypto_kdf_BYTES_MIN
Maximum length of a sub-key.
See: crypto_kdf_BYTES_MAX
Length of the master key.
See: crypto_kdf_KEYBYTES
Length of a Context.