Skip to main content

FancyProj

Trait FancyProj 

Source
pub trait FancyProj: Fancy {
    // Required method
    fn proj(
        &mut self,
        x: &Self::Item,
        q: u16,
        tt: Option<Vec<u16>>,
        channel: &mut Channel<'_>,
    ) -> Result<Self::Item>;

    // Provided method
    fn mod_change(
        &mut self,
        x: &Self::Item,
        to_modulus: u16,
        channel: &mut Channel<'_>,
    ) -> Result<Self::Item> { ... }
}
Expand description

Extension trait for Fancy that provides a projection gate, alongside methods that utilize projection gates.

§Security Warning

In its current form, using projection gates in arithmetic garbling is insecure.

Required Methods§

Source

fn proj( &mut self, x: &Self::Item, q: u16, tt: Option<Vec<u16>>, channel: &mut Channel<'_>, ) -> Result<Self::Item>

Project x according to the truth table tt. Resulting wire has modulus q.

Optional tt is useful for hiding the gate from the evaluator.

§Panics

This may panic in certain implementations if tt is None when it should be Some. In addition, it may panic if tt is improperly formed: either the length of tt is smaller than xs modulus, or the values in tt are larger than q.

Provided Methods§

Source

fn mod_change( &mut self, x: &Self::Item, to_modulus: u16, channel: &mut Channel<'_>, ) -> Result<Self::Item>

Change the modulus of x to to_modulus using a projection gate.

Implementors§