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

Function CheckCircuit

ecgo/test/eval.go:13–24  ·  view source on GitHub ↗

check if first output is zero

(rc *layered.RootCircuit, witness *irwg.Witness)

Source from the content-addressed store, hash-verified

11
12// check if first output is zero
13func CheckCircuit(rc *layered.RootCircuit, witness *irwg.Witness) bool {
14 if witness.NumWitnesses != 1 {
15 panic("expected 1 witness, if you need to check multiple witnesses, use CheckCircuitMultiWitness")
16 }
17 out := evalCircuit(rc, witness.Values[:witness.NumInputsPerWitness], witness.Values[witness.NumInputsPerWitness:])
18 for i := 0; i < rc.ExpectedNumOutputZeroes; i++ {
19 if out[i].Cmp(big.NewInt(0)) != 0 {
20 return false
21 }
22 }
23 return true
24}
25
26func CheckCircuitMultiWitness(rc *layered.RootCircuit, witness *irwg.Witness) []bool {
27 if witness.NumWitnesses == 0 {

Callers 15

mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
TestLogupCircuitFunction · 0.92
TestLogupRuntimeCircuitFunction · 0.92

Calls 2

evalCircuitFunction · 0.85
CmpMethod · 0.80

Tested by 4

TestLogupCircuitFunction · 0.74
TestLogupRuntimeCircuitFunction · 0.74