Skip to main content

Evaluator

Struct Evaluator 

Source
pub struct Evaluator<Wire> { /* private fields */ }
Expand description

Streaming evaluator using a callback to receive ciphertexts as needed.

Evaluates a garbled circuit on the fly, using messages containing ciphertexts and wires. Parallelizable.

Implementations§

Source§

impl<Wire: WireLabel<F2>> Evaluator<Wire>

Source

pub fn new() -> Self

Create a new Evaluator.

Trait Implementations§

Source§

impl<Wire: WireLabel<F2>> Default for Evaluator<Wire>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Wire: WireLabel<F2>> Fancy for Evaluator<Wire>

Source§

type Item = Wire

The underlying wire representation of this [Fancy] object.
Source§

impl<W: BinaryWireLabel> FancyBinary for Evaluator<W>

Source§

fn negate(&mut self, x: &Self::Item) -> Self::Item

Binary negation.
Source§

fn xor(&mut self, x: &Self::Item, y: &Self::Item) -> Self::Item

Binary XOR.
Source§

fn and( &mut self, A: &Self::Item, B: &Self::Item, channel: &mut Channel<'_>, ) -> Result<Self::Item>

Binary AND.
§

fn or( &mut self, x: &Self::Item, y: &Self::Item, channel: &mut Channel<'_>, ) -> Result<Self::Item, Error>

Binary OR.
Source§

impl<Wire: WireLabel<F2>> FancyConstant<F2> for Evaluator<Wire>

Source§

fn constant(&mut self, x: F2) -> Self::Item

Encode a constant value x.
Source§

impl<Wire: WireLabel<F2>> FancyEncode<F2> for Evaluator<Wire>

Source§

fn encode_many( &mut self, _: &[F2], _: &mut Channel<'_>, ) -> Result<Vec<Self::Item>>

Encode many wires for known values.
Source§

fn receive_many( &mut self, n: usize, channel: &mut Channel<'_>, ) -> Result<Vec<Self::Item>>

Receive many wires for unknown values.
§

fn encode( &mut self, value: FF, channel: &mut Channel<'_>, ) -> Result<Self::Item, Error>

Encode a wire for a known value.
§

fn receive(&mut self, channel: &mut Channel<'_>) -> Result<Self::Item, Error>

Receive a wire for an unknown value.
Source§

impl<Wire: WireLabel<F2>> FancyOutput<F2> for Evaluator<Wire>

Source§

fn output(&mut self, x: &Wire, channel: &mut Channel<'_>) -> Result<Option<F2>>

Output the value associated with wire x. Read more
§

fn outputs( &mut self, xs: &[Self::Item], channel: &mut Channel<'_>, ) -> Result<Option<Vec<FF>>, Error>

Output the values associated with a slice of wires. Read more

Auto Trait Implementations§

§

impl<Wire> Freeze for Evaluator<Wire>
where Wire: Freeze,

§

impl<Wire> RefUnwindSafe for Evaluator<Wire>
where Wire: RefUnwindSafe,

§

impl<Wire> Send for Evaluator<Wire>
where Wire: Send,

§

impl<Wire> Sync for Evaluator<Wire>
where Wire: Sync,

§

impl<Wire> Unpin for Evaluator<Wire>
where Wire: Unpin,

§

impl<Wire> UnsafeUnpin for Evaluator<Wire>
where Wire: UnsafeUnpin,

§

impl<Wire> UnwindSafe for Evaluator<Wire>
where Wire: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IsSameType<T> for T

§

const WITNESS: Witness<<T as IsSameType<T>>::EqualityProposition> = Witness::EQUAL_TYPES

A [Witness] that Self == T Read more
§

type EqualityProposition = TrueEqualityProposition

The [EqualityProposition] that Self == T
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.