Trait FancyInput

Source
pub trait FancyInput {
    type Item: Clone + HasModulus;
    type Error: From<FancyError>;

Show 16 methods // Required methods fn encode_many( &mut self, values: &[u16], moduli: &[u16], ) -> Result<Vec<Self::Item>, Self::Error>; fn receive_many( &mut self, moduli: &[u16], ) -> Result<Vec<Self::Item>, Self::Error>; // Provided methods fn encode( &mut self, value: u16, modulus: u16, ) -> Result<Self::Item, Self::Error> { ... } fn receive(&mut self, modulus: u16) -> Result<Self::Item, Self::Error> { ... } fn encode_bundle( &mut self, values: &[u16], moduli: &[u16], ) -> Result<Bundle<Self::Item>, Self::Error> { ... } fn receive_bundle( &mut self, moduli: &[u16], ) -> Result<Bundle<Self::Item>, Self::Error> { ... } fn encode_bundles( &mut self, values: &[Vec<u16>], moduli: &[Vec<u16>], ) -> Result<Vec<Bundle<Self::Item>>, Self::Error> { ... } fn receive_many_bundles( &mut self, moduli: &[Vec<u16>], ) -> Result<Vec<Bundle<Self::Item>>, Self::Error> { ... } fn crt_encode( &mut self, value: u128, modulus: u128, ) -> Result<CrtBundle<Self::Item>, Self::Error> { ... } fn crt_receive( &mut self, modulus: u128, ) -> Result<CrtBundle<Self::Item>, Self::Error> { ... } fn crt_encode_many( &mut self, values: &[u128], modulus: u128, ) -> Result<Vec<CrtBundle<Self::Item>>, Self::Error> { ... } fn crt_receive_many( &mut self, n: usize, modulus: u128, ) -> Result<Vec<CrtBundle<Self::Item>>, Self::Error> { ... } fn bin_encode( &mut self, value: u128, nbits: usize, ) -> Result<BinaryBundle<Self::Item>, Self::Error> { ... } fn bin_receive( &mut self, nbits: usize, ) -> Result<BinaryBundle<Self::Item>, Self::Error> { ... } fn bin_encode_many( &mut self, values: &[u128], nbits: usize, ) -> Result<Vec<BinaryBundle<Self::Item>>, Self::Error> { ... } fn bin_receive_many( &mut self, ninputs: usize, nbits: usize, ) -> Result<Vec<BinaryBundle<Self::Item>>, Self::Error> { ... }
}
Expand description

Convenience functions for encoding input to Fancy objects.

Required Associated Types§

Source

type Item: Clone + HasModulus

The type that this Fancy object operates over.

Source

type Error: From<FancyError>

The type of error that this Fancy object emits.

Required Methods§

Source

fn encode_many( &mut self, values: &[u16], moduli: &[u16], ) -> Result<Vec<Self::Item>, Self::Error>

Encode many values where the actual input is known.

When writing a garbler, the return value must correspond to the zero wire label.

Source

fn receive_many( &mut self, moduli: &[u16], ) -> Result<Vec<Self::Item>, Self::Error>

Receive many values where the input is not known.

Provided Methods§

Source

fn encode( &mut self, value: u16, modulus: u16, ) -> Result<Self::Item, Self::Error>

Encode a single value.

When writing a garbler, the return value must correspond to the zero wire label.

Source

fn receive(&mut self, modulus: u16) -> Result<Self::Item, Self::Error>

Receive a single value.

Source

fn encode_bundle( &mut self, values: &[u16], moduli: &[u16], ) -> Result<Bundle<Self::Item>, Self::Error>

Encode a bundle.

Source

fn receive_bundle( &mut self, moduli: &[u16], ) -> Result<Bundle<Self::Item>, Self::Error>

Receive a bundle.

Source

fn encode_bundles( &mut self, values: &[Vec<u16>], moduli: &[Vec<u16>], ) -> Result<Vec<Bundle<Self::Item>>, Self::Error>

Encode many input bundles.

Source

fn receive_many_bundles( &mut self, moduli: &[Vec<u16>], ) -> Result<Vec<Bundle<Self::Item>>, Self::Error>

Receive many input bundles.

Source

fn crt_encode( &mut self, value: u128, modulus: u128, ) -> Result<CrtBundle<Self::Item>, Self::Error>

Encode a CRT input bundle.

Source

fn crt_receive( &mut self, modulus: u128, ) -> Result<CrtBundle<Self::Item>, Self::Error>

Receive an CRT input bundle.

Source

fn crt_encode_many( &mut self, values: &[u128], modulus: u128, ) -> Result<Vec<CrtBundle<Self::Item>>, Self::Error>

Encode many CRT input bundles.

Source

fn crt_receive_many( &mut self, n: usize, modulus: u128, ) -> Result<Vec<CrtBundle<Self::Item>>, Self::Error>

Receive many CRT input bundles.

Source

fn bin_encode( &mut self, value: u128, nbits: usize, ) -> Result<BinaryBundle<Self::Item>, Self::Error>

Encode a binary input bundle.

Source

fn bin_receive( &mut self, nbits: usize, ) -> Result<BinaryBundle<Self::Item>, Self::Error>

Receive an binary input bundle.

Source

fn bin_encode_many( &mut self, values: &[u128], nbits: usize, ) -> Result<Vec<BinaryBundle<Self::Item>>, Self::Error>

Encode many binary input bundles.

Source

fn bin_receive_many( &mut self, ninputs: usize, nbits: usize, ) -> Result<Vec<BinaryBundle<Self::Item>>, Self::Error>

Receive many binary input bundles.

Implementors§

Source§

impl FancyInput for DepthInformer

Source§

impl FancyInput for Dummy

Source§

impl<C: AbstractChannel, RNG: CryptoRng + Rng + SeedableRng<Seed = Block>, OT: OtSender<Msg = Block> + SemiHonest, Wire: WireLabel> FancyInput for Garbler<C, RNG, OT, Wire>

Source§

impl<C: AbstractChannel, RNG: CryptoRng + Rng, OT: OtReceiver<Msg = Block> + SemiHonest, Wire: WireLabel> FancyInput for Evaluator<C, RNG, OT, Wire>

Source§

impl<F: Fancy + FancyInput<Item = <F as Fancy>::Item, Error = <F as Fancy>::Error>> FancyInput for Informer<F>

Source§

type Item = <F as Fancy>::Item

Source§

type Error = <F as Fancy>::Error