Botan

Key Derivation Function interfaces

License
Botan is released under the Simplified BSD License (see LICENSE.md)

abstract class  KDF;

Key Derivation Function


const SecureVector!ubyte  deriveKey()(size_t key_len, auto ref const SecureVector!ubyte secret, in string salt = "");

Derive a key

Parameters
size_t key_len the desired output length in bytes
SecureVector!ubyte secret the secret input
string salt a diversifier

const SecureVector!ubyte  deriveKey(Alloc)(size_t key_len, auto ref const SecureVector!ubyte secret, auto ref const Vector!(ubyte, Alloc) salt);

Derive a key

Parameters
size_t key_len the desired output length in bytes
SecureVector!ubyte secret the secret input
Vector!(ubyte, Alloc) salt a diversifier

const SecureVector!ubyte  deriveKey()(size_t key_len, auto ref const SecureVector!ubyte secret, const(ubyte)* salt, size_t salt_len);

Derive a key

Parameters
size_t key_len the desired output length in bytes
SecureVector!ubyte secret the secret input
const(ubyte)* salt a diversifier
size_t salt_len size of salt in bytes

const SecureVector!ubyte  deriveKey(size_t key_len, const(ubyte)* secret, size_t secret_len, in string salt = "");

Derive a key

Parameters
size_t key_len the desired output length in bytes
const(ubyte)* secret the secret input
size_t secret_len size of secret in bytes
string salt a diversifier

const SecureVector!ubyte  deriveKey(size_t key_len, const(ubyte)* secret, size_t secret_len, const(ubyte)* salt, size_t salt_len);

Derive a key

Parameters
size_t key_len the desired output length in bytes
const(ubyte)* secret the secret input
size_t secret_len size of secret in bytes
const(ubyte)* salt a diversifier
size_t salt_len size of salt in bytes

KDF  getKdf(in string algo_spec);

Factory method for KDF (key derivation function)

Parameters
string algo_spec the name of the KDF to create
Returns
pointer to newly allocated object of that type