Trait false_bottom::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

Object Safety§

This trait is not object safe.

Implementors§

source§

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