pub trait CrtGadgets:
FancyArithmetic
+ FancyBinary
+ ArithmeticBundleGadgets
+ BundleGadgets {
// 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_constant_bundle(
&mut self,
x: u128,
q: u128,
channel: &mut Channel<'_>,
) -> Result<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>>> { ... }
fn crt_add(
&mut self,
x: &CrtBundle<Self::Item>,
y: &CrtBundle<Self::Item>,
) -> CrtBundle<Self::Item> { ... }
fn crt_sub(
&mut self,
x: &CrtBundle<Self::Item>,
y: &CrtBundle<Self::Item>,
) -> CrtBundle<Self::Item> { ... }
fn crt_cmul(
&mut self,
x: &CrtBundle<Self::Item>,
c: u128,
) -> CrtBundle<Self::Item> { ... }
fn crt_mul(
&mut self,
x: &CrtBundle<Self::Item>,
y: &CrtBundle<Self::Item>,
channel: &mut Channel<'_>,
) -> Result<CrtBundle<Self::Item>> { ... }
}Expand description
Extension trait for Fancy providing advanced CRT gadgets based on bundles of wires.
Provided Methods§
Sourcefn crt_encode(
&mut self,
value: u128,
modulus: u128,
channel: &mut Channel<'_>,
) -> Result<CrtBundle<Self::Item>>
fn crt_encode( &mut self, value: u128, modulus: u128, channel: &mut Channel<'_>, ) -> Result<CrtBundle<Self::Item>>
Encode a CRT input bundle.
Sourcefn crt_receive(
&mut self,
modulus: u128,
channel: &mut Channel<'_>,
) -> Result<CrtBundle<Self::Item>>
fn crt_receive( &mut self, modulus: u128, channel: &mut Channel<'_>, ) -> Result<CrtBundle<Self::Item>>
Receive an CRT input bundle.
Sourcefn crt_encode_many(
&mut self,
values: &[u128],
modulus: u128,
channel: &mut Channel<'_>,
) -> Result<Vec<CrtBundle<Self::Item>>>
fn crt_encode_many( &mut self, values: &[u128], modulus: u128, channel: &mut Channel<'_>, ) -> Result<Vec<CrtBundle<Self::Item>>>
Encode many CRT input bundles.
Sourcefn crt_receive_many(
&mut self,
n: usize,
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>>>
Receive many CRT input bundles.
Sourcefn crt_constant_bundle(
&mut self,
x: u128,
q: u128,
channel: &mut Channel<'_>,
) -> Result<CrtBundle<Self::Item>>
fn crt_constant_bundle( &mut self, x: u128, q: u128, channel: &mut Channel<'_>, ) -> Result<CrtBundle<Self::Item>>
Creates a bundle of constant wires for the CRT representation of x under
composite modulus q.
Sourcefn crt_output(
&mut self,
x: &CrtBundle<Self::Item>,
channel: &mut Channel<'_>,
) -> Result<Option<u128>>
fn crt_output( &mut self, x: &CrtBundle<Self::Item>, channel: &mut Channel<'_>, ) -> Result<Option<u128>>
Output a CRT bundle and interpret it mod Q.
Sourcefn crt_outputs(
&mut self,
xs: &[CrtBundle<Self::Item>],
channel: &mut Channel<'_>,
) -> Result<Option<Vec<u128>>>
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.
Sourcefn crt_add(
&mut self,
x: &CrtBundle<Self::Item>,
y: &CrtBundle<Self::Item>,
) -> CrtBundle<Self::Item>
fn crt_add( &mut self, x: &CrtBundle<Self::Item>, y: &CrtBundle<Self::Item>, ) -> CrtBundle<Self::Item>
Add two CRT bundles.
Sourcefn crt_sub(
&mut self,
x: &CrtBundle<Self::Item>,
y: &CrtBundle<Self::Item>,
) -> CrtBundle<Self::Item>
fn crt_sub( &mut self, x: &CrtBundle<Self::Item>, y: &CrtBundle<Self::Item>, ) -> CrtBundle<Self::Item>
Subtract two CRT bundles.