Key Derivation
Bindings for the crypto_kdf API. See the libsodium crypto_kdf docs for more information.
Constants
Buffer lengths (integer)
crypto_kdf_KEYBYTES
crypto_kdf_BYTES_MIN
crypto_kdf_BYTES_MAX
crypto_kdf_CONTEXTBYTES
String constants (string)
crypto_kdf_PRIMITIVE
crypto_kdf_keygen
sodium.crypto_kdf_keygen(key)
Generates a new master key.
key
should be abuffer
of 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.
subkey
should be abuffer
betweencrypto_kdf_BYTES_MIN
andcrypto_kdf_BYTES_MAX
subkeyId
should be an integerctx
should be abuffer
of lengthcrypto_kdf_CONTEXTBYTES
key
should be abuffer
of lengthcrypto_kdf_KEYBYTES