Skip to content

Commit

Permalink
feat: add noop-engine
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokub committed Jul 4, 2024
1 parent e9a845c commit 3af14c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions std/recursion/sumcheck/arithengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") }

0 comments on commit 3af14c5

Please sign in to comment.