Skip to main content

CrtGadgets

Trait CrtGadgets 

Source
pub trait CrtGadgets: BundleGadgets + FancyEncode {
    // Provided methods
    fn crt_encode(
        &mut self,
        value: u128,
        modulus: u128,
        channel: &mut Channel<'_>,
    ) -> Result<CrtBundle<Self::Item>> { ... }
    fn crt_receive(
        &mut self,
        modulus: u128,
        channel: &mut Channel<'_>,
    ) -> Result<CrtBundle<Self::Item>> { ... }
    fn crt_encode_many(
        &mut self,
        values: &[u128],
        modulus: u128,
        channel: &mut Channel<'_>,
    ) -> Result<Vec<CrtBundle<Self::Item>>> { ... }
    fn crt_receive_many(
        &mut self,
        n: usize,
        modulus: u128,
        channel: &mut Channel<'_>,
    ) -> Result<Vec<CrtBundle<Self::Item>>> { ... }
    fn crt_output(
        &mut self,
        x: &CrtBundle<Self::Item>,
        channel: &mut Channel<'_>,
    ) -> Result<Option<u128>> { ... }
    fn crt_outputs(
        &mut self,
        xs: &[CrtBundle<Self::Item>],
        channel: &mut Channel<'_>,
    ) -> Result<Option<Vec<u128>>> { ... }
}
Expand description

Extension trait for Fancy providing advanced CRT gadgets based on bundles of wires.

Provided Methods§

Source

fn crt_encode( &mut self, value: u128, modulus: u128, channel: &mut Channel<'_>, ) -> Result<CrtBundle<Self::Item>>

Encode a CRT input bundle.

Source

fn crt_receive( &mut self, modulus: u128, channel: &mut Channel<'_>, ) -> Result<CrtBundle<Self::Item>>

Receive an CRT input bundle.

Source

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

Encode many CRT input bundles.

Source

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

Receive many CRT input bundles.

Source

fn crt_output( &mut self, x: &CrtBundle<Self::Item>, channel: &mut Channel<'_>, ) -> Result<Option<u128>>

Output a CRT bundle and interpret it mod Q.

Source

fn crt_outputs( &mut self, xs: &[CrtBundle<Self::Item>], channel: &mut Channel<'_>, ) -> Result<Option<Vec<u128>>>

Output a slice of CRT bundles and interpret the outputs mod Q.

Implementors§