From ccf611d90fa5303e94c5eae8f0325d5c00fa0bf9 Mon Sep 17 00:00:00 2001 From: Ivo Kubjas Date: Mon, 18 Mar 2024 23:26:40 +0000 Subject: [PATCH] feat: add noop-engine --- std/recursion/sumcheck/arithengine.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/std/recursion/sumcheck/arithengine.go b/std/recursion/sumcheck/arithengine.go index e4de69ba0a..2df009e9f9 100644 --- a/std/recursion/sumcheck/arithengine.go +++ b/std/recursion/sumcheck/arithengine.go @@ -95,3 +95,12 @@ func newEmulatedEngine[FR emulated.FieldParams](api frontend.API) (*emuEngine[FR } return &emuEngine[FR]{f: f}, nil } + +// noopEngine is a no-operation arithmetic engine. Can be used to access methods of the gates without performing any computation. +type noopEngine struct{} + +func (ne *noopEngine) Add(a, b element) element { panic("noop engine: Add called") } +func (ne *noopEngine) Mul(a, b element) element { panic("noop engine: Mul called") } +func (ne *noopEngine) Sub(a, b element) element { panic("noop engine: Sub called") } +func (ne *noopEngine) One() element { panic("noop engine: One called") } +func (ne *noopEngine) Const(i *big.Int) element { panic("noop engine: Const called") }