Struct diem_crypto::noise::NoiseSession [−][src]
pub struct NoiseSession { /* fields omitted */ }
Expand description
A NoiseSession is produced after a successful Noise handshake, and can be use to encrypt and decrypt messages to the other peer.
Implementations
obtain remote static public key
encrypts a message for the other peers (post-handshake) the function encrypts in place, and returns the authentication tag as result
pub fn read_message_in_place<'a>(
&mut self,
message: &'a mut [u8]
) -> Result<&'a [u8], NoiseError>
pub fn read_message_in_place<'a>(
&mut self,
message: &'a mut [u8]
) -> Result<&'a [u8], NoiseError>
decrypts a message from the other peer (post-handshake) the function decrypts in place, and returns a subslice without the auth tag