Skip to main content

CipherTextBlock

Trait CipherTextBlock 

Source
pub trait CipherTextBlock:
    Default
    + Copy
    + Debug {
    const BLOCK_SIZE: usize;

    // Required methods
    fn to_bytes(self) -> Vec<u8> ;
    fn from_bytes(data: &[u8]) -> Result<Self, ParseError>;
    fn default_in_place(&mut self);
}
Expand description

Trait implemented by per-block ciphertext components (Left and Right blocks). Provides a fixed serialised size and byte conversions used by OreOutput.

Required Associated Constants§

Source

const BLOCK_SIZE: usize

Serialised size of one block in bytes.

Required Methods§

Source

fn to_bytes(self) -> Vec<u8>

Serialise this block to bytes.

Source

fn from_bytes(data: &[u8]) -> Result<Self, ParseError>

Deserialise a block from a byte slice. Returns ParseError if the slice is malformed or the wrong length.

Source

fn default_in_place(&mut self)

Reset this block to its default value in place.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§