Crate lettuce

Crate lettuce 

Source
Expand description

Lettuce, the healthy lattice prover.

Github README

Macros§

integer_prime_field
Generate a scalar prime field implementation backed by a type.

Structs§

BDLOP
An implementation of Baum et. al. commitments. See also: spec
BDLOPLinearNIZKArg
Argues knowledge of two BDLOP commitments such that c_a = g * c_b
BinaryScalar
Automatically generated FieldScalar impl.
GaussianCDT
Cumulative distribution table for a finite field, with a specific sigma (std dev) and tail bounds limited by float precision. Panics if the distribution cannot be precisely computed.
LOLScalar
Automatically generated FieldScalar impl.
Matrix
A matrix of ring elements. Supports arithmetic with other matrices, vectors and ring elements. Supports concurrent operations with the rayon feature.
MilliScalarMont
Finite field of cardinality 4293918721. This is ~2^32 - 1mil (close to 32 bit boundary) Q is factored by 2^20 thus supports cyclotomic rings up to degree ~1mil.
Polynomial
Univariate negacyclic polynomial ring (modulus X^N + 1). Accelerated with number theoretic transforms and lazy moves between coefficient and eval representation.
R1CS
Rank 1 constraint system over a scalar field.
SISScalar
Commitments based on the short integer solution problem over a scalar field. Comitted values should be small/of low norm. See also: spec
SevenScalar
Automatically generated FieldScalar impl.
Transcript
TransparentInnerProd
Transparent, binding only, argument of inner product of some set of vectors. Vectors may be committed, and constraints may be applied. A set of challenge elements will compare inner products. See also: spec
TransparentInnerProdNIZKArg
TransparentInnerProdSystemBuilder
We need to commit to a witness and a set of algebraic relations. Each relation will be encoded in a hash committed argument of knowledge.
TransparentMatInnerProd
This is a transparent, binding only, argument of vector by matrix multiplication, collapsed to an inner sum. This structure optimizes by rolling all row multiplications into a single logarithmic commitmnet.
Vector
A vector of ring elements. Supports arithmetic with other vectors, matrices, and ring elements.

Enums§

TransparentInnerProdBuilderConstraint
argue equality of algebraic relations.

Traits§

FieldScalar
A scalar field element. All FieldScalar are also RingElement.
RingElement
An element of a commutative ring.

Functions§

intt
Inverse number theoretic transform.
intt_negacyclic
Inverse negacyclic number theoretic transform. Applies an inverse number theoretic transform using a 2N’th root of unity to convert the evaluation form of a polynomial modulo X^N + 1 back to coefficient form.
ntt
Number theoretic transform.
ntt_negacyclic
Negacyclic number theoretic transform. Applies a number theoretic transform using a 2N’th root of unity to yield the negacyclic convolution of two vectors. This is equivalent to polynomial multiplication modulo X^N + 1
prime_factorize
Compute the prime factorization of a number.
ternary_sample