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

Refactor/gkr hint replace prv to slv #745

Closed
wants to merge 6 commits into from
Closed
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: 0 additions & 7 deletions backend/groth16/bls12-377/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/groth16/bls12-381/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/groth16/bls24-315/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/groth16/bls24-317/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/groth16/bn254/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/groth16/bw6-633/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/groth16/bw6-761/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/plonk/bls12-377/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/plonk/bls12-381/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/plonk/bls24-315/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/plonk/bls24-317/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/plonk/bn254/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/plonk/bw6-633/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions backend/plonk/bw6-761/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions constraint/bls12-377/gkr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions constraint/bls12-377/system.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions constraint/bls12-381/gkr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions constraint/bls12-381/system.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions constraint/bls24-315/gkr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions constraint/bls24-315/system.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions constraint/bls24-317/gkr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions constraint/bls24-317/system.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions constraint/bn254/gkr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions constraint/bn254/system.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions constraint/bw6-633/gkr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions constraint/bw6-633/system.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions constraint/bw6-761/gkr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions constraint/bw6-761/system.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions constraint/solver/hint_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ func RegisterNamedHint(hintFn Hint, key HintID) {
registry[key] = hintFn
}

func RemoveNamedHint(key HintID) {
registryM.Lock()
defer registryM.Unlock()
delete(registry, key)
}

// GetRegisteredHints returns all registered hint functions.
func GetRegisteredHints() []Hint {
registryM.RLock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,12 @@ func GkrProveHint(hashName string, data *GkrSolvingData) hint.Hint {
}
}

func ReplaceGkrHints(solverOpts *[]hint.Option, gkrInfo constraint.GkrInfo) {
var gkrData GkrSolvingData
*solverOpts = append(*solverOpts,
hint.OverrideHint(gkrInfo.SolveHintID, GkrSolveHint(gkrInfo, &gkrData)),
hint.OverrideHint(gkrInfo.ProveHintID, GkrProveHint(gkrInfo.HashName, &gkrData)))
}

// TODO: Move to gnark-crypto
var HashBuilderRegistry = make(map[string]func() hash.Hash)
Loading