BundleGadgets

Trait BundleGadgets 

Source
pub trait BundleGadgets: Fancy {
    // Provided methods
    fn constant_bundle(
        &mut self,
        xs: &[u16],
        ps: &[u16],
        channel: &mut Channel<'_>,
    ) -> Result<Bundle<Self::Item>> { ... }
    fn output_bundle(
        &mut self,
        x: &Bundle<Self::Item>,
        channel: &mut Channel<'_>,
    ) -> Result<Option<Vec<u16>>> { ... }
    fn output_bundles(
        &mut self,
        xs: &[Bundle<Self::Item>],
        channel: &mut Channel<'_>,
    ) -> Result<Option<Vec<Vec<u16>>>> { ... }
    fn shift(
        &mut self,
        x: &Bundle<Self::Item>,
        n: usize,
        channel: &mut Channel<'_>,
    ) -> Result<Bundle<Self::Item>> { ... }
    fn shift_extend(
        &mut self,
        x: &Bundle<Self::Item>,
        n: usize,
        channel: &mut Channel<'_>,
    ) -> Result<Bundle<Self::Item>> { ... }
}
Expand description

Extension trait for Fancy which provides Bundle constructions which are not necessarily CRT nor binary-based.

Provided Methods§

Source

fn constant_bundle( &mut self, xs: &[u16], ps: &[u16], channel: &mut Channel<'_>, ) -> Result<Bundle<Self::Item>>

Creates a bundle of constant wires using moduli ps.

Source

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

Output the wires that make up a bundle.

Source

fn output_bundles( &mut self, xs: &[Bundle<Self::Item>], channel: &mut Channel<'_>, ) -> Result<Option<Vec<Vec<u16>>>>

Output a slice of bundles.

Source

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

Shift residues, replacing them with zeros in the modulus of the least signifigant residue. Maintains the length of the input.

Source

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

Shift residues, replacing them with zeros in the modulus of the least signifigant residue. Output is extended with n elements.

Implementors§