MCPcopy Create free account
hub / github.com/PolyhedraZK/ExpanderCompilerCollection / CheckCircuitMultiWitness

Function CheckCircuitMultiWitness

ecgo/test/eval.go:26–44  ·  view source on GitHub ↗
(rc *layered.RootCircuit, witness *irwg.Witness)

Source from the content-addressed store, hash-verified

24}
25
26func CheckCircuitMultiWitness(rc *layered.RootCircuit, witness *irwg.Witness) []bool {
27 if witness.NumWitnesses == 0 {
28 panic("expected at least 1 witness")
29 }
30 res := make([]bool, witness.NumWitnesses)
31 a := witness.NumInputsPerWitness
32 b := witness.NumPublicInputsPerWitness
33 for i := 0; i < witness.NumWitnesses; i++ {
34 out := evalCircuit(rc, witness.Values[i*(a+b):i*(a+b)+a], witness.Values[i*(a+b)+a:i*(a+b)+a+b])
35 res[i] = true
36 for j := 0; j < rc.ExpectedNumOutputZeroes; j++ {
37 if out[j].Cmp(big.NewInt(0)) != 0 {
38 res[i] = false
39 break
40 }
41 }
42 }
43 return res
44}
45
46func EvalCircuit(rc *layered.RootCircuit, witness *irwg.Witness) []*big.Int {
47 if witness.NumWitnesses != 1 {

Callers 1

mainFunction · 0.92

Calls 2

evalCircuitFunction · 0.85
CmpMethod · 0.80

Tested by

no test coverage detected