Skip to main content

PacketCipher

Trait PacketCipher 

Source
pub trait PacketCipher {
    type Error;

    // Required methods
    fn seal(
        &mut self,
        key_id: u32,
        nonce: u64,
        payload: &mut Vec<u8>,
    ) -> Result<(), Self::Error>;
    fn open(
        &mut self,
        key_id: u32,
        nonce: u64,
        payload: &mut Vec<u8>,
    ) -> Result<(), Self::Error>;
}
Expand description

Packet cipher hook. Embedders should provide real encryption outside SectorSync when confidentiality is needed.

Required Associated Types§

Source

type Error

Cipher error type.

Required Methods§

Source

fn seal( &mut self, key_id: u32, nonce: u64, payload: &mut Vec<u8>, ) -> Result<(), Self::Error>

Seals a payload in place before authentication.

Source

fn open( &mut self, key_id: u32, nonce: u64, payload: &mut Vec<u8>, ) -> Result<(), Self::Error>

Opens a payload in place after authentication.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§