Key Derivation
Bindings for the crypto_kdf API. See the libsodium crypto_kdf docs for more information.
Constants
Buffer lengths (integer)
crypto_kdf_KEYBYTEScrypto_kdf_BYTES_MINcrypto_kdf_BYTES_MAXcrypto_kdf_CONTEXTBYTES
String constants (string)
crypto_kdf_PRIMITIVE
crypto_kdf_keygen
sodium.crypto_kdf_keygen(key)
Generates a new master key.
keyshould be abufferof lengthcrypto_kdf_KEYBYTES
crypto_kdf_derive_from_key
sodium.crypto_kdf_derive_from_key(subkey, subkeyId, ctx, key)
Derives a new key from a master key.
subkeyshould be abufferbetweencrypto_kdf_BYTES_MINandcrypto_kdf_BYTES_MAXsubkeyIdshould be an integerctxshould be abufferof lengthcrypto_kdf_CONTEXTBYTESkeyshould be abufferof lengthcrypto_kdf_KEYBYTES
