Trait CipherCore

Source
pub trait CipherCore {
    type Err: From<Error> + From<Error>;
    type Mac: Mac;

    // Required methods
    fn mac(&self) -> &Self::Mac;
    fn block_size(&self) -> usize;

    // Provided method
    fn padding(&self, payload: usize) -> u8 { ... }
}
Expand description

A trait with common methods and associated types involved in the manipulation of OpeningCipher and SealingCipher.

Required Associated Types§

Source

type Err: From<Error> + From<Error>

The associated error type returned by the open method.

Source

type Mac: Mac

The Message Authentication Code associated to the cipher.

Required Methods§

Source

fn mac(&self) -> &Self::Mac

Gets a reference to the Message Authentication Code for this CipherCore.

Source

fn block_size(&self) -> usize

The size of a CipherCore’s block.

Provided Methods§

Source

fn padding(&self, payload: usize) -> u8

Calculate the necessary padding size for the provided payload size.

Implementors§