Skip to main content

get_introduce_key_material

Function get_introduce_key_material 

Source
fn get_introduce_key_material(
    bx: &SharedSecret,
    auth_key: &PublicKey,
    X: &PublicKey,
    B: &PublicKey,
    subcredential: &Subcredential,
) -> Result<(Zeroizing<[u8; 32]>, [u8; 32]), Bug>
Expand description

Helper function: Compute the part of the HS ntor handshake that generates key material for creating and handling INTRODUCE1 cells. Function used by both client and service. Specifically, calculate the following:

 intro_secret_hs_input = EXP(B,x) | AUTH_KEY | X | B | PROTOID
 info = m_hsexpand | subcredential
 hs_keys = KDF(intro_secret_hs_input | t_hsenc | info, S_KEY_LEN+MAC_LEN)
 ENC_KEY = hs_keys[0:S_KEY_LEN]
 MAC_KEY = hs_keys[S_KEY_LEN:S_KEY_LEN+MAC_KEY_LEN]

Return (ENC_KEY, MAC_KEY).