Trait fancy_garbling::WireLabel
source · [−]pub trait WireLabel: Clone + HasModulus {
Show 22 methods
fn digits(&self) -> Vec<u16>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
;
fn as_block(&self) -> Block;
fn color(&self) -> u16;
fn plus_eq<'a>(&'a mut self, other: &Self) -> &'a mut Self;
fn cmul_eq(&mut self, c: u16) -> &mut Self;
fn negate_eq(&mut self) -> &mut Self;
fn from_block(inp: Block, q: u16) -> Self;
fn zero(q: u16) -> Self;
fn rand_delta<R: CryptoRng + Rng>(rng: &mut R, q: u16) -> Self;
fn rand<R: CryptoRng + RngCore>(rng: &mut R, q: u16) -> Self;
fn hash_to_mod(hash: Block, q: u16) -> Self;
fn hashback(&self, tweak: Block, q: u16) -> Self { ... }
fn negate_mov(self) -> Self { ... }
fn cmul_mov(self, c: u16) -> Self { ... }
fn cmul(&self, c: u16) -> Self { ... }
fn plus_mov(self, other: &Self) -> Self { ... }
fn plus(&self, other: &Self) -> Self { ... }
fn negate(&self) -> Self { ... }
fn minus_mov(self, other: &Self) -> Self { ... }
fn minus(&self, other: &Self) -> Self { ... }
fn minus_eq<'a>(&'a mut self, other: &Self) -> &'a mut Self { ... }
fn hash(&self, tweak: Block) -> Block { ... }
}
Expand description
Trait implementing a wire that can be used for secure computation via garbled circuits
Required Methods
Get the digits of the wire
Add another wire digit-wise into this one. Assumes that both wires have the same modulus.
sourcefn from_block(inp: Block, q: u16) -> Self
fn from_block(inp: Block, q: u16) -> Self
Pack the wire into a Block
.
Get a random wire label mod q
, with the first digit set to 1
sourcefn hash_to_mod(hash: Block, q: u16) -> Self
fn hash_to_mod(hash: Block, q: u16) -> Self
Subroutine of hashback that converts the hash block into a valid wire of the given modulus. Also useful when batching hashes ahead of time for later conversion.
Provided Methods
Compute the hash of this wire, converting the result back to a wire.
Uses fixed-key AES.
sourcefn negate_mov(self) -> Self
fn negate_mov(self) -> Self
Negate all the digits mod q
, consuming it for chained computations.
Multiply each digit by a constant c mod q
, consuming it for chained computations.
Multiply each digit by a constant c mod q
, returning a new wire.
Add another wire into this one, consuming it for chained computations.
Subtract a wire from this one, consuming it for chained computations.