Index Mathematics Conjectures nbv lettuce Widgets

r1cs_eval

stdlib/r1cs/r1cs_eval.nbv

r1cs_eval(r1cs, wtns)

given an r1cs and a witness vector evaluate the r1cs. Makes NO assertion or constraint of validity.

Calls
mat_vec_mul, r1cs/r1cs_from_vec
Precompiles
clone!

Source

# given an r1cs and a witness vector
# evaluate the r1cs. Makes NO assertion
# or constraint of validity.
(r1cs, wtns)

(
  static wtns_len,
  static a,
  static b,
  static c
) = r1cs_from_vec(r1cs)

static a = mat_vec_mul(a, clone! wtns)
static b = mat_vec_mul(b, clone! wtns)
static c = mat_vec_mul(c, clone! wtns)

(a * b) - c