BatchDomain

Trait BatchDomain 

Source
pub trait BatchDomain: Domain {
    // Provided methods
    fn batch_kdf<'a>(
        items: impl Iterator<Item = (Option<Self::SharedSecret>, &'a EphemeralKeyBytes)>,
    ) -> Vec<Option<Self::SymmetricKey>> { ... }
    fn batch_epk(
        ephemeral_keys: impl Iterator<Item = EphemeralKeyBytes>,
    ) -> Vec<(Option<Self::PreparedEphemeralPublicKey>, EphemeralKeyBytes)> { ... }
}
Available on crate feature alloc only.
Expand description

Trait that encapsulates protocol-specific batch trial decryption logic.

Each batchable operation has a default implementation that calls through to the non-batched implementation. Domains can override whichever operations benefit from batched logic.

Provided Methods§

Source

fn batch_kdf<'a>( items: impl Iterator<Item = (Option<Self::SharedSecret>, &'a EphemeralKeyBytes)>, ) -> Vec<Option<Self::SymmetricKey>>

Computes Self::kdf on a batch of items.

For each item in the batch, if the shared secret is None, this returns None at that position.

Source

fn batch_epk( ephemeral_keys: impl Iterator<Item = EphemeralKeyBytes>, ) -> Vec<(Option<Self::PreparedEphemeralPublicKey>, EphemeralKeyBytes)>

Computes Self::epk on a batch of ephemeral keys.

This is useful for protocols where the underlying curve requires an inversion to parse an encoded point.

For usability, this returns tuples of the ephemeral keys and the result of parsing them.

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§