pub fn gen_key<T: rustls::Session>(session: &T) -> Result<NTSKeys, TLSError> {
    let mut keys: NTSKeys = NTSKeys {
        c2s: [0; 32],
        s2c: [0; 32],
    };
    let c2s_con = [0, 0, 0, 15, 00];
    let s2c_con = [0, 0, 0, 15, 01];
    let context_c2s = Some(&c2s_con[..]);
    let context_s2c = Some(&s2c_con[..]);
    let label = "EXPORTER-network-time-security".as_bytes();
    session.export_keying_material(&mut keys.c2s, label, context_c2s)?;
    session.export_keying_material(&mut keys.s2c, label, context_s2c)?;

    Ok(keys)
}
/// gen_key computes the client and server keys using exporters.
/// https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-28#section-4.3
gen_key computes the client and server keys using exporters.
gen_key computes the client and server keys using exporters .
pub fn gen_key<T: rustls::Session>(session: &T) -> Result<NTSKeys, TLSError> {
    let mut keys: NTSKeys = NTSKeys {
        c2s: [0; 32],
        s2c: [0; 32],
    };
    let c2s_con = [0, 0, 0, 15, 00];
    let s2c_con = [0, 0, 0, 15, 01];
    let context_c2s = Some(&c2s_con[..]);
    let context_s2c = Some(&s2c_con[..]);
    let label = "EXPORTER-network-time-security".as_bytes();
    session.export_keying_material(&mut keys.c2s, label, context_c2s)?;
    session.export_keying_material(&mut keys.s2c, label, context_s2c)?;
    Ok(keys)
}
pub fn gen_key < T : rustls :: Session > ( session : & T ) -> Result < NTSKeys , TLSError > { let mut keys : NTSKeys = NTSKeys { c2s : [ 0 ; 32 ] , s2c : [ 0 ; 32 ] , } ; let c2s_con = [ 0 , 0 , 0 , 15 , 00 ] ; let s2c_con = [ 0 , 0 , 0 , 15 , 01 ] ; let context_c2s = Some ( & c2s_con [ .. ] ) ; let context_s2c = Some ( & s2c_con [ .. ] ) ; let label = " " . as_bytes ( ) ; session . export_keying_material ( & mut keys . c2s , label , context_c2s ) ? ; session . export_keying_material ( & mut keys . s2c , label , context_s2c ) ? ; Ok ( keys ) }
gen_key computes the client and server keys using exporters.
gen_key computes the client and server keys using exporters .
session
&T
session
&T