Skip to main content

kdf_tree

Function kdf_tree 

Source
pub fn kdf_tree(
    k: &[u8],
    label: &[u8],
    seed: &[u8],
    output_len: usize,
) -> Vec<u8> ⓘ
Expand description

KDF_TREE_GOSTR3411_2012_256 (R 50.1.113-2016 / RFC 7836) with a one-octet counter (R = 1).

Derives output_len octets from key k, a label and a seed: each 256-bit block K_i = HMAC_Streebog256(k, i ‖ label ‖ 0x00 ‖ seed ‖ L), where i is a one-octet counter (1-based) and L is the total output length in bits, encoded as a 16-bit big-endian integer. In the DLMS GOST profile the diversified key is 768 bits: Key = LSB512, M = MSB256.