Skip to main content

hash_with_titles

Function hash_with_titles 

Source
pub fn hash_with_titles(
    mechanism: AuthMechanism,
    secret: &[u8],
    st_a: &[u8],
    st_b: &[u8],
    challenge_a: &[u8],
    challenge_b: &[u8],
) -> Option<Vec<u8>>
Expand description

Mechanisms 6 (SHA-256) and 9 (Streebog-256): f = HASH(secret ‖ st_a ‖ st_b ‖ challenge_a ‖ challenge_b).

For f(StoC) use st_a = system-title-C, st_b = system-title-S, challenge_a = StoC, challenge_b = CtoS; for f(CtoS) swap both pairs (IEC 62056-5-3 Table 32 mechanism 6; Р 1323565.1 §7.5.2 mechanism 9).

Returns None for other mechanisms.