Finalize processes deferred functions, converts boolean and nonzero assertions to zero assertions, and adds public variables to the output.
()
| 9 | // Finalize processes deferred functions, converts boolean and nonzero assertions to zero assertions, |
| 10 | // and adds public variables to the output. |
| 11 | func (r *Root) Finalize() *irsource.RootCircuit { |
| 12 | res := make(map[uint64]*irsource.Circuit) |
| 13 | for x, b := range r.registry.m { |
| 14 | res[x] = b.builder.Finalize() |
| 15 | } |
| 16 | return &irsource.RootCircuit{ |
| 17 | NumPublicInputs: r.nbPublicInputs, |
| 18 | ExpectedNumOutputZeroes: 0, |
| 19 | Circuits: res, |
| 20 | Field: r.field, |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | func (builder *builder) Finalize() *irsource.Circuit { |
| 25 | // defers may change during the process |