Struct CrtBundle

Source
pub struct CrtBundle<W>(/* private fields */);
Expand description

Bundle which is explicitly CRT-representation.

Implementations§

Source§

impl<W: Clone + HasModulus> CrtBundle<W>

Source

pub fn new(ws: Vec<W>) -> CrtBundle<W>

Create a new CRT bundle from a vector of wires.

Source

pub fn extract(self) -> Bundle<W>

Extract the underlying bundle from this CRT bundle.

Source

pub fn composite_modulus(&self) -> u128

Return the product of all the wires’ moduli.

Methods from Deref<Target = Bundle<W>>§

Source

pub fn moduli(&self) -> Vec<u16>

Return the moduli of all the wires in the bundle.

Source

pub fn wires(&self) -> &[W]

Extract the wires from this bundle.

Source

pub fn size(&self) -> usize

Get the number of wires in this bundle.

Source

pub fn is_binary(&self) -> bool

Whether this bundle only contains residues in mod 2.

Source

pub fn with_moduli(&self, moduli: &[u16]) -> Bundle<W>

Returns a new bundle only containing wires with matching moduli.

Source

pub fn iter(&self) -> Iter<'_, W>

Access the underlying iterator

Trait Implementations§

Source§

impl<W: Clone> Clone for CrtBundle<W>

Source§

fn clone(&self) -> CrtBundle<W>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<W: Clone + HasModulus> Deref for CrtBundle<W>

Source§

type Target = Bundle<W>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Bundle<W>

Dereferences the value.
Source§

impl<W: Clone + HasModulus> From<Bundle<W>> for CrtBundle<W>

Source§

fn from(b: Bundle<W>) -> CrtBundle<W>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<W> Freeze for CrtBundle<W>

§

impl<W> RefUnwindSafe for CrtBundle<W>
where W: RefUnwindSafe,

§

impl<W> Send for CrtBundle<W>
where W: Send,

§

impl<W> Sync for CrtBundle<W>
where W: Sync,

§

impl<W> Unpin for CrtBundle<W>
where W: Unpin,

§

impl<W> UnwindSafe for CrtBundle<W>
where W: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V