Index Mathematics Conjectures nbv lettuce Widgets

bdlop_blindfold_milli_poseidon_32_16!

Commit to an R1CS witness with BDLOP and return the blinded argument as witness vectors. Cryptography

bdlop_blindfold_milli_poseidon_32_16! a, b, c, w

Builds a BDLOP commitment based argument (ring dimension 64, Poseidon 32/16 transcript in the milli field) that the witness w satisfies the R1CS with matrices a, b, c, and places the argument in the current witness so the program can verify it, e.g. with bdlop_r1cs_verify. This is the building block for verifying one system inside another.

The argument's three parts have data-dependent lengths, so the precompile publishes the three lengths as a public output. When compiling without a witness the lengths are read from the claimed outputs, the same way as into_public_static!.

Arguments

a, b, c
Static row-major matrices, each a multiple of len! w long, as returned by r1cs!. Witness matrices are an error.
w
The witness vector of the inner system, whose length is the matrix width.

Returns

A tuple of three witness vectors, the parts of the argument (s, the witness argument and the cross-term argument taken by bdlop_r1cs_verify). It is an expression-form precompile used with a tuple assignment.

Constraints

None. It allocates three witness entries for the published lengths plus one per element of the returned vectors, all unconstrained until the program verifies them.

Example

Not runnable here: the commitment uses fresh randomness and a ring dimension 64 lattice, which is slow to evaluate in a debug build. The shape of a use is:

(static width, static a, static b, static c) = r1cs! {
  let y = wtns! 20
  let z = y * y
}
# w: the inner witness, a vector of `width` elements
(let s, let wtns_arg, let crossterm_arg) = bdlop_blindfold_milli_poseidon_32_16! (clone! a), (clone! b), (clone! c), (clone! w)
let state = oraccle_init()
let state = bdlop_r1cs_verify(64, a, b, c, w, s, wtns_arg, crossterm_arg, state)

Notes

Milli field only (the implementation converts through MilliScalarMont and asserts the field matches). Compiling without a witness and without the claimed length output panics. The commitment is randomized, so the witness differs between runs.