Skip to main content

Encryption

Trait Encryption 

Source
pub trait Encryption {
    // Required methods
    fn args_size(&self) -> u8;
    fn public_key(&self) -> PublicKey;
    fn authenticator(&self) -> Authenticator;
    fn handshake(&mut self, peer: PublicKey) -> Result<(), EncryptionError>;
    fn authenticate(
        &mut self,
        peer: Authenticator,
    ) -> Result<(), EncryptionError>;
    fn encrypt(
        &mut self,
        head: &SessionHeader,
        args: &mut [u8],
        data: &mut [u8],
    ) -> Result<(), EncryptionError>;
    fn decrypt(
        &mut self,
        head: &SessionHeader,
        args: &[u8],
        data: &mut [u8],
    ) -> Result<(), EncryptionError>;
}

Required Methods§

Source

fn args_size(&self) -> u8

Source

fn public_key(&self) -> PublicKey

Source

fn authenticator(&self) -> Authenticator

Source

fn handshake(&mut self, peer: PublicKey) -> Result<(), EncryptionError>

Source

fn authenticate(&mut self, peer: Authenticator) -> Result<(), EncryptionError>

Source

fn encrypt( &mut self, head: &SessionHeader, args: &mut [u8], data: &mut [u8], ) -> Result<(), EncryptionError>

Source

fn decrypt( &mut self, head: &SessionHeader, args: &[u8], data: &mut [u8], ) -> Result<(), EncryptionError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§