prover

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUProver

func CPUProver(
	curve ecc.ID,
	ccs constraint.ConstraintSystem,
	pk groth16.ProvingKey,
	assignment frontend.Circuit,
	opts ...backend.ProverOption,
) (groth16.Proof, error)

CPUProver is the standard implementation that simply calls groth16.Prove directly. This is used in production environments.

func CPUProverWithWitness

func CPUProverWithWitness(
	curve ecc.ID,
	ccs constraint.ConstraintSystem,
	pk groth16.ProvingKey,
	w witness.Witness,
	opts ...backend.ProverOption,
) (groth16.Proof, error)

CPUProverWithWitness proves using CPU with an already-created witness.

func DefaultProver

func DefaultProver(
	curve ecc.ID,
	ccs constraint.ConstraintSystem,
	pk groth16.ProvingKey,
	assignment frontend.Circuit,
	opts ...backend.ProverOption,
) (groth16.Proof, error)

DefaultProver is the default prover implementation. It uses the GPU prover if UseGPUProver is true, otherwise it uses the CPU prover. If GPU proving fails, it falls back to CPU proving.

func GPUProver

func GPUProver(
	curve ecc.ID,
	ccs constraint.ConstraintSystem,
	pk groth16.ProvingKey,
	assignment frontend.Circuit,
	opts ...backend.ProverOption,
) (groth16.Proof, error)

GPUProver is an implementation that uses GPU acceleration for proving.

func GPUProverWithWitness

func GPUProverWithWitness(
	curve ecc.ID,
	ccs constraint.ConstraintSystem,
	pk groth16.ProvingKey,
	w witness.Witness,
	opts ...backend.ProverOption,
) (groth16.Proof, error)

GPUProverWithWitness proves using GPU with an already-created witness.

func NewProvingKey

func NewProvingKey(curve ecc.ID) groth16.ProvingKey

NewProvingKey instantiates an empty proving key compatible with the selected backend. When GPU proving is enabled this returns an ICICLE proving key so that serialized keys can be read directly into GPU-ready structures.

func ProveWithWitness

func ProveWithWitness(
	curve ecc.ID,
	ccs constraint.ConstraintSystem,
	pk groth16.ProvingKey,
	w witness.Witness,
	opts ...backend.ProverOption,
) (groth16.Proof, error)

ProveWithWitness generates a proof from an already-created witness. It automatically uses GPU acceleration if UseGPUProver is true. If GPU proving fails, it falls back to CPU proving.

func Setup

Setup wraps groth16.Setup and switches to the ICICLE-aware setup when the GPU prover is enabled. This guarantees that the resulting proving key has the extra device metadata required by gpugroth16.Prove.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL