Index Mathematics Conjectures nbv lettuce Widgets

sample_uniform_sparse_r1cs!

Sample a random sparse R1CS with a satisfying witness, as statics. R1CS

sample_uniform_sparse_r1cs! height, width

Like sample_uniform_r1cs!, but each row involves only a few (one to three) random witness entries. The witness is uniform with 1 in entry 0 and satisfies every row.

Arguments

height
Static scalar, number of rows.
width
Static scalar, witness length including the constant entry.

Returns

A tuple of four statics (a, b, c, wtns): the matrices as row-major vectors of rows * width elements (sparse in content, but returned densely) and the witness of length width. It is an expression-form precompile used with a tuple assignment.

Constraints

None.

Example

(static a, static b, static c, static w) = sample_uniform_sparse_r1cs! 3, 4
static first = w[0]
concat! (len! w), first

Notes

Values are drawn from the system random number generator, so the program is not deterministic.