(rc *layered.RootCircuit, witness *irwg.Witness)
| 24 | } |
| 25 | |
| 26 | func 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 | |
| 46 | func EvalCircuit(rc *layered.RootCircuit, witness *irwg.Witness) []*big.Int { |
| 47 | if witness.NumWitnesses != 1 { |
no test coverage detected