Function initKdf [src]
Construct a new Blake3 for the key derivation function. The context
string should be hardcoded, globally unique, and application-specific.
Prototype
pub fn initKdf(context: []const u8, options: KdfOptions) Blake3
Parameters
context: []const u8
options: KdfOptions
Source
pub fn initKdf(context: []const u8, options: KdfOptions) Blake3 {
_ = options;
var context_hasher = Blake3.init_internal(IV, DERIVE_KEY_CONTEXT);
context_hasher.update(context);
var context_key: [KEY_LEN]u8 = undefined;
context_hasher.final(context_key[0..]);
const context_key_words = wordsFromLittleEndianBytes(8, context_key);
return Blake3.init_internal(context_key_words, DERIVE_KEY_MATERIAL);
}