diff --git a/backend/plonk/bls12-377/prove.go b/backend/plonk/bls12-377/prove.go index 16689db59e..1b9612d218 100644 --- a/backend/plonk/bls12-377/prove.go +++ b/backend/plonk/bls12-377/prove.go @@ -229,13 +229,9 @@ type instance struct { } func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts *backend.ProverConfig) (*instance, error) { - bOpt, err := backend.NewBackendConfig(opts.BackendOpts...) - if err != nil { - return nil, fmt.Errorf("get backend options: %w", err) - } var htfFn hash.Hash - if bOpt.HashToFieldFn != nil { - htfFn = bOpt.HashToFieldFn + if opts.HashToFieldFn != nil { + htfFn = opts.HashToFieldFn } else { htfFn = hash_to_field.New([]byte("BSB22-Plonk")) } diff --git a/backend/plonk/bls12-377/verify.go b/backend/plonk/bls12-377/verify.go index 532cee8d33..6757569756 100644 --- a/backend/plonk/bls12-377/verify.go +++ b/backend/plonk/bls12-377/verify.go @@ -44,10 +44,10 @@ var ( errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") ) -func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.BackendOption) error { +func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { log := logger.Logger().With().Str("curve", "bls12-377").Str("backend", "plonk").Logger() start := time.Now() - cfg, err := backend.NewBackendConfig(opts...) + cfg, err := backend.NewVerifierConfig(opts...) if err != nil { return fmt.Errorf("create backend config: %w", err) } diff --git a/backend/plonk/bls12-381/prove.go b/backend/plonk/bls12-381/prove.go index 74e709f97c..9172578f30 100644 --- a/backend/plonk/bls12-381/prove.go +++ b/backend/plonk/bls12-381/prove.go @@ -229,13 +229,9 @@ type instance struct { } func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts *backend.ProverConfig) (*instance, error) { - bOpt, err := backend.NewBackendConfig(opts.BackendOpts...) - if err != nil { - return nil, fmt.Errorf("get backend options: %w", err) - } var htfFn hash.Hash - if bOpt.HashToFieldFn != nil { - htfFn = bOpt.HashToFieldFn + if opts.HashToFieldFn != nil { + htfFn = opts.HashToFieldFn } else { htfFn = hash_to_field.New([]byte("BSB22-Plonk")) } diff --git a/backend/plonk/bls12-381/verify.go b/backend/plonk/bls12-381/verify.go index 615c64e38b..b7ca6c3808 100644 --- a/backend/plonk/bls12-381/verify.go +++ b/backend/plonk/bls12-381/verify.go @@ -44,10 +44,10 @@ var ( errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") ) -func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.BackendOption) error { +func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { log := logger.Logger().With().Str("curve", "bls12-381").Str("backend", "plonk").Logger() start := time.Now() - cfg, err := backend.NewBackendConfig(opts...) + cfg, err := backend.NewVerifierConfig(opts...) if err != nil { return fmt.Errorf("create backend config: %w", err) } diff --git a/backend/plonk/bls24-315/prove.go b/backend/plonk/bls24-315/prove.go index 97515da54a..e5d4dcfedc 100644 --- a/backend/plonk/bls24-315/prove.go +++ b/backend/plonk/bls24-315/prove.go @@ -229,13 +229,9 @@ type instance struct { } func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts *backend.ProverConfig) (*instance, error) { - bOpt, err := backend.NewBackendConfig(opts.BackendOpts...) - if err != nil { - return nil, fmt.Errorf("get backend options: %w", err) - } var htfFn hash.Hash - if bOpt.HashToFieldFn != nil { - htfFn = bOpt.HashToFieldFn + if opts.HashToFieldFn != nil { + htfFn = opts.HashToFieldFn } else { htfFn = hash_to_field.New([]byte("BSB22-Plonk")) } diff --git a/backend/plonk/bls24-315/verify.go b/backend/plonk/bls24-315/verify.go index 484feb44d1..6a23bfecd3 100644 --- a/backend/plonk/bls24-315/verify.go +++ b/backend/plonk/bls24-315/verify.go @@ -44,10 +44,10 @@ var ( errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") ) -func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.BackendOption) error { +func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { log := logger.Logger().With().Str("curve", "bls24-315").Str("backend", "plonk").Logger() start := time.Now() - cfg, err := backend.NewBackendConfig(opts...) + cfg, err := backend.NewVerifierConfig(opts...) if err != nil { return fmt.Errorf("create backend config: %w", err) } diff --git a/backend/plonk/bls24-317/prove.go b/backend/plonk/bls24-317/prove.go index 56aba10127..d6e45ce21f 100644 --- a/backend/plonk/bls24-317/prove.go +++ b/backend/plonk/bls24-317/prove.go @@ -229,13 +229,9 @@ type instance struct { } func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts *backend.ProverConfig) (*instance, error) { - bOpt, err := backend.NewBackendConfig(opts.BackendOpts...) - if err != nil { - return nil, fmt.Errorf("get backend options: %w", err) - } var htfFn hash.Hash - if bOpt.HashToFieldFn != nil { - htfFn = bOpt.HashToFieldFn + if opts.HashToFieldFn != nil { + htfFn = opts.HashToFieldFn } else { htfFn = hash_to_field.New([]byte("BSB22-Plonk")) } diff --git a/backend/plonk/bls24-317/verify.go b/backend/plonk/bls24-317/verify.go index f93b9827f6..f4ca45545b 100644 --- a/backend/plonk/bls24-317/verify.go +++ b/backend/plonk/bls24-317/verify.go @@ -44,10 +44,10 @@ var ( errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") ) -func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.BackendOption) error { +func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { log := logger.Logger().With().Str("curve", "bls24-317").Str("backend", "plonk").Logger() start := time.Now() - cfg, err := backend.NewBackendConfig(opts...) + cfg, err := backend.NewVerifierConfig(opts...) if err != nil { return fmt.Errorf("create backend config: %w", err) } diff --git a/backend/plonk/bn254/prove.go b/backend/plonk/bn254/prove.go index 746f8dd8dc..e461cc174c 100644 --- a/backend/plonk/bn254/prove.go +++ b/backend/plonk/bn254/prove.go @@ -229,13 +229,9 @@ type instance struct { } func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts *backend.ProverConfig) (*instance, error) { - bOpt, err := backend.NewBackendConfig(opts.BackendOpts...) - if err != nil { - return nil, fmt.Errorf("get backend options: %w", err) - } var htfFn hash.Hash - if bOpt.HashToFieldFn != nil { - htfFn = bOpt.HashToFieldFn + if opts.HashToFieldFn != nil { + htfFn = opts.HashToFieldFn } else { htfFn = hash_to_field.New([]byte("BSB22-Plonk")) } diff --git a/backend/plonk/bn254/verify.go b/backend/plonk/bn254/verify.go index e80b58ddea..30b52ba92c 100644 --- a/backend/plonk/bn254/verify.go +++ b/backend/plonk/bn254/verify.go @@ -44,10 +44,10 @@ var ( errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") ) -func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.BackendOption) error { +func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { log := logger.Logger().With().Str("curve", "bn254").Str("backend", "plonk").Logger() start := time.Now() - cfg, err := backend.NewBackendConfig(opts...) + cfg, err := backend.NewVerifierConfig(opts...) if err != nil { return fmt.Errorf("create backend config: %w", err) } diff --git a/backend/plonk/bw6-633/prove.go b/backend/plonk/bw6-633/prove.go index a27aa8ae2c..787c98fe0e 100644 --- a/backend/plonk/bw6-633/prove.go +++ b/backend/plonk/bw6-633/prove.go @@ -229,13 +229,9 @@ type instance struct { } func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts *backend.ProverConfig) (*instance, error) { - bOpt, err := backend.NewBackendConfig(opts.BackendOpts...) - if err != nil { - return nil, fmt.Errorf("get backend options: %w", err) - } var htfFn hash.Hash - if bOpt.HashToFieldFn != nil { - htfFn = bOpt.HashToFieldFn + if opts.HashToFieldFn != nil { + htfFn = opts.HashToFieldFn } else { htfFn = hash_to_field.New([]byte("BSB22-Plonk")) } diff --git a/backend/plonk/bw6-633/verify.go b/backend/plonk/bw6-633/verify.go index 8e98e18d51..267e42c38b 100644 --- a/backend/plonk/bw6-633/verify.go +++ b/backend/plonk/bw6-633/verify.go @@ -44,10 +44,10 @@ var ( errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") ) -func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.BackendOption) error { +func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { log := logger.Logger().With().Str("curve", "bw6-633").Str("backend", "plonk").Logger() start := time.Now() - cfg, err := backend.NewBackendConfig(opts...) + cfg, err := backend.NewVerifierConfig(opts...) if err != nil { return fmt.Errorf("create backend config: %w", err) } diff --git a/backend/plonk/bw6-761/prove.go b/backend/plonk/bw6-761/prove.go index 3cd0364896..79e67154c3 100644 --- a/backend/plonk/bw6-761/prove.go +++ b/backend/plonk/bw6-761/prove.go @@ -229,13 +229,9 @@ type instance struct { } func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts *backend.ProverConfig) (*instance, error) { - bOpt, err := backend.NewBackendConfig(opts.BackendOpts...) - if err != nil { - return nil, fmt.Errorf("get backend options: %w", err) - } var htfFn hash.Hash - if bOpt.HashToFieldFn != nil { - htfFn = bOpt.HashToFieldFn + if opts.HashToFieldFn != nil { + htfFn = opts.HashToFieldFn } else { htfFn = hash_to_field.New([]byte("BSB22-Plonk")) } diff --git a/backend/plonk/bw6-761/verify.go b/backend/plonk/bw6-761/verify.go index 7302d090a5..6cf5bb5531 100644 --- a/backend/plonk/bw6-761/verify.go +++ b/backend/plonk/bw6-761/verify.go @@ -44,10 +44,10 @@ var ( errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") ) -func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.BackendOption) error { +func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { log := logger.Logger().With().Str("curve", "bw6-761").Str("backend", "plonk").Logger() start := time.Now() - cfg, err := backend.NewBackendConfig(opts...) + cfg, err := backend.NewVerifierConfig(opts...) if err != nil { return fmt.Errorf("create backend config: %w", err) }