Skip to main content

CryptInit

Trait CryptInit 

Source
pub trait CryptInit: Sized {
    // Required methods
    fn seed_len() -> usize;
    fn initialize(seed: &[u8]) -> Result<Self>;

    // Provided method
    fn construct<K: KeyGenerator>(keygen: K) -> Result<Self> { ... }
}
Expand description

Represents the ability for one hop of a circuit’s cryptographic state to be initialized from a given seed.

Required Methods§

Source

fn seed_len() -> usize

Return the number of bytes that this state will require.

Source

fn initialize(seed: &[u8]) -> Result<Self>

Construct this state from a seed of the appropriate length.

Provided Methods§

Source

fn construct<K: KeyGenerator>(keygen: K) -> Result<Self>

Initialize this object from a key generator.

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<BC: BlkCipher> CryptInit for EtCipher<BC>

Source§

impl<BC: BlkCipherEnc> CryptInit for Prf<BC>

Source§

impl<EtBC, PrfBC> CryptInit for tor_proto::bench_utils::cgo::CryptStatePair<EtBC, PrfBC>
where EtBC: BlkCipher, PrfBC: BlkCipherEnc,

Source§

impl<EtBC: BlkCipher, PrfBC: BlkCipherEnc> CryptInit for CryptState<EtBC, PrfBC>

Source§

impl<EtBC: BlkCipher, PrfBC: BlkCipherEnc> CryptInit for Uiv<EtBC, PrfBC>

Source§

impl<SC: StreamCipher + KeyIvInit, D: Digest + Clone> CryptInit for tor_proto::bench_utils::tor1::CryptStatePair<SC, D>