Expand description
Tools useful for interacting with fancy-garbling.
Note: all number representations in this library are little-endian.
Constants§
- PRIMES
- Primes used in
fancy-garbling.
Traits§
- RngExt
- Extra Rng functionality, useful for
fancy-garbling.
Functions§
- crt
- Compute the CRT representation of x with respect to the primes ps.
- crt_
factor - Compute the CRT representation of
xwith respect to the factorization ofq. - crt_inv
- Compute the value x given a list of CRT primes and residues.
- crt_
inv_ factor - Compute the value
xgiven a composite CRT modulus provided byxs. - factor
- Factor using the primes in the global
PRIMESarray. Fancy garbling only supports composites with small prime factors. - modulus_
with_ nprimes - Generate a CRT modulus using the
nsmallest primes inPRIMES. - modulus_
with_ width - Generate a CRT modulus that support at least n-bit integers, using the built-in PRIMES.
- output_
tweak - Compute the output tweak for a garbled gate where
i`` is the gate ID andk` is the value. - primes_
with_ width - Generate the factors of a CRT modulus that support at least n-bit integers, using the
built-in
PRIMES. - product
- Compute the product of some
u16s as au128. - u128_
from_ bits - Convert into a u128 from the “bits” as u16. Assumes each “bit” is 0 or 1.