Trait RandChoiceRotReceiver

Source
pub trait RandChoiceRotReceiver: Connected + Send {
    type Error;

    // Required method
    fn rand_choice_receive_into(
        &mut self,
        ots: &mut impl Buf<Block>,
    ) -> impl Future<Output = Result<Vec<Choice>, Self::Error>> + Send;

    // Provided method
    fn rand_choice_receive(
        &mut self,
        count: usize,
    ) -> impl Future<Output = Result<(Vec<Block>, Vec<Choice>), Self::Error>> + Send { ... }
}
Expand description

Returns a random choice vector alongside OTs.

Required Associated Types§

Required Methods§

Source

fn rand_choice_receive_into( &mut self, ots: &mut impl Buf<Block>, ) -> impl Future<Output = Result<Vec<Choice>, Self::Error>> + Send

Receive ots.len() many random OTs, stored into the buffer pointed to by ots and returns the corresponding choices.

Provided Methods§

Source

fn rand_choice_receive( &mut self, count: usize, ) -> impl Future<Output = Result<(Vec<Block>, Vec<Choice>), Self::Error>> + Send

Receive count many random OTs alongside their respective choices.

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<R: RotReceiver> RandChoiceRotReceiver for R

Adapt any RotReceiver into a RandChoiceRotReceiver by securely sampling the random choices using random_choices.

Source§

impl<S: Security> RandChoiceRotReceiver for SilentOtReceiver<S>