Trait CryptInit

Source
pub(crate) 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>

Available on crate feature counter-galois-onion only.
Source§

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

Available on crate feature counter-galois-onion only.
Source§

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

Available on crate feature counter-galois-onion only.
Source§

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

Available on crate feature counter-galois-onion only.
Source§

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

Available on crate feature counter-galois-onion only.
Source§

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