pub(crate) fn add_remote_key(&mut self, public: &[u8; 32], nonce: &[u8; 12]) {
        let key = SessionKeyMaterial {
            secret: None,
            public: public.to_owned(),
            nonce: nonce.to_owned(),
            session: None,
        };
        self.remote_key = Some(key);
        let secret = self.local_key.secret.take();
        if let Some(secret) = secret {
            self.local_key.session = Some(secret.diffie_hellman(&EphemeralPublic::from(*public)));
        }
    }
/// Add key received from a remote connection and generate session key
Add key received from a remote connection and generate session key
Add key received from a remote connection and generate session key
pub(crate) fn add_remote_key(&mut self, public: &[u8; 32], nonce: &[u8; 12]) {
        let key = SessionKeyMaterial {
            secret: None,
            public: public.to_owned(),
            nonce: nonce.to_owned(),
            session: None,
        };
        self.remote_key = Some(key);
        let secret = self.local_key.secret.take();
        if let Some(secret) = secret {
            self.local_key.session = Some(secret.diffie_hellman(&EphemeralPublic::from(*public)));
        }
    }
pub ( crate ) fn add_remote_key ( & mut self , public : & [ u8 ; 32 ] , nonce : & [ u8 ; 12 ] ) { let key = SessionKeyMaterial { secret : None , public : public . to_owned ( ) , nonce : nonce . to_owned ( ) , session : None , } ; self . remote_key = Some ( key ) ; let secret = self . local_key . secret . take ( ) ; if let Some ( secret ) = secret { self . local_key . session = Some ( secret . diffie_hellman ( & EphemeralPublic :: from ( * public ) ) ) ; } }
Add key received from a remote connection and generate session key
Add key received from a remote connection and generate session key
&mut self
public
&[u8; 32]
nonce
&[u8; 12]
&mut self
public
&[u8; 32]
nonce
&[u8; 12]