like the OpenBSD reference.
BcryptPbkdf.derive
ubyte[] derive(const(ubyte)[] secret, const(ubyte)[] salt,
size_t length)Derives key material using the constructor's round count.
Parameters
secret | Passphrase bytes. |
salt | Salt bytes. |
length | Desired output length, 1..1024 bytes. |
Returns
The derived key bytes, striped across blocks exactly
Throws
CryptoException if
secret or salt is empty, or
length is zero or exceeds bcryptPbkdfMaxKey, or salt exceeds bcryptPbkdfMaxSalt.
ubyte[] derive(const(ubyte)[] secret, const(ubyte)[] salt,
size_t length, KDFParams params)Derives key material, letting params.iterations override the constructor's round count (zero means "unset").
Parameters
secret | Passphrase bytes. |
salt | Salt bytes. |
length | Desired output length, 1..1024 bytes. |
params | Algorithm parameters; only iterations is used. |
Returns
The derived key bytes.
Throws
CryptoException for the derive conditions, or when
params.iterations is an explicit zero.