Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix naming and format #37

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions abstractor/abstractor.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Package abstractor defines the abstractor.API. It is based on
// frontend.API from the gnark library plus `DefineGadget`
// and `Call` functions to support Gadgets in circuits
package abstractor

import "github.com/consensys/gnark/frontend"
Expand All @@ -6,10 +9,12 @@ type Gadget interface {
Call(gadget GadgetDefinition) []frontend.Variable
}

// GadgetDefinition is the interface to define the circuit of a gadget
type GadgetDefinition interface {
DefineGadget(api API) []frontend.Variable
}

// API extends frontend.API
type API interface {
frontend.API
DefineGadget(gadget GadgetDefinition) Gadget
Expand All @@ -18,6 +23,8 @@ type API interface {
Call(gadget GadgetDefinition) []frontend.Variable
}

// The Circuit interface. AbsDefine is the function called
// to read the circuit implementation from the extractor
type Circuit interface {
frontend.Circuit
AbsDefine(api API) error
Expand Down
3 changes: 2 additions & 1 deletion abstractor/concretizer.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package abstractor

import (
"math/big"

"github.com/consensys/gnark/backend/hint"
"github.com/consensys/gnark/frontend"
"math/big"
)

type ConcreteGadget struct {
Expand Down
Loading