Trait FalseBottom

Source
pub trait FalseBottom {
    // Required methods
    fn init(cipher_len: usize, keybase_len: usize) -> Self;
    fn add(&mut self, msg: &[u8]) -> FbKey;
    fn decrypt(&self, key: &FbKey) -> Result<Vec<u8>, FbError>;
}
Expand description

The main interface to the False Bottom algorithm.

Required Methods§

Source

fn init(cipher_len: usize, keybase_len: usize) -> Self

Creates a new FbObj. The keybase and ciphertext are initialized from random values.
Bounds: 2 <= keybase_len <= cipher_len

§Panics

If Parameters are out of bounds.

Source

fn add(&mut self, msg: &[u8]) -> FbKey

Adds the provided message to the ciphertext.

Source

fn decrypt(&self, key: &FbKey) -> Result<Vec<u8>, FbError>

Decrypts the message that corresponds to the provided key.

§Errors

InvalidKey

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§

Source§

impl<const LIMBS: usize> FalseBottom for FbObj<Uint<LIMBS>>
where Uint<LIMBS>: ArrayEncoding + PrimeField,