Documentation ¶
Overview ¶
Package backend implements Zero Knowledge Proof systems: it consumes circuit compiled with gnark/frontend.
Index ¶
- type ID
- type ProverConfig
- type ProverOption
- func WithIcicleAcceleration() ProverOption
- func WithProverChallengeHashFunction(hFunc hash.Hash) ProverOption
- func WithProverHashToFieldFunction(hFunc hash.Hash) ProverOption
- func WithProverKZGFoldingHashFunction(hFunc hash.Hash) ProverOption
- func WithSolverOptions(solverOpts ...solver.Option) ProverOption
- func WithStatisticalZeroKnowledge() ProverOption
- type VerifierConfig
- type VerifierOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID uint16
ID represent a unique ID for a proving scheme
func IDFromString ¶
IDFromString returns the ID of a proof system from its string representation
func Implemented ¶
func Implemented() []ID
Implemented return the list of proof systems implemented in gnark
type ProverConfig ¶
type ProverConfig struct { SolverOpts []solver.Option HashToFieldFn hash.Hash ChallengeHash hash.Hash KZGFoldingHash hash.Hash Accelerator string StatisticalZK bool }
ProverConfig is the configuration for the prover with the options applied.
func NewProverConfig ¶
func NewProverConfig(opts ...ProverOption) (ProverConfig, error)
NewProverConfig returns a default ProverConfig with given prover options opts applied.
type ProverOption ¶
type ProverOption func(*ProverConfig) error
ProverOption defines option for altering the behavior of the prover in Prove, ReadAndProve and IsSolved methods. See the descriptions of functions returning instances of this type for implemented options.
func WithIcicleAcceleration ¶
func WithIcicleAcceleration() ProverOption
WithIcicleAcceleration requests to use ICICLE GPU proving backend for the prover. This option requires that the program is compiled with `icicle` build tag and the ICICLE dependencies are properly installed. See ICICLE for installation description.
func WithProverChallengeHashFunction ¶
func WithProverChallengeHashFunction(hFunc hash.Hash) ProverOption
WithProverChallengeHashFunction sets the hash function used for computing non-interactive challenges in Fiat-Shamir heuristic. If not set then by default SHA2-256 is used. Used mainly for compatibility between different systems and efficient recursion.
func WithProverHashToFieldFunction ¶
func WithProverHashToFieldFunction(hFunc hash.Hash) ProverOption
WithProverHashToFieldFunction changes the hash function used for hashing bytes to field. If not set then the default hash function based on RFC 9380 is used. Used mainly for compatibility between different systems and efficient recursion.
func WithProverKZGFoldingHashFunction ¶
func WithProverKZGFoldingHashFunction(hFunc hash.Hash) ProverOption
WithProverKZGFoldingHashFunction sets the hash function used for computing the challenge when folding the KZG opening proofs. If not set then by default SHA2-256 is used. Used mainly for compatibility between different systems and efficient recursion.
func WithSolverOptions ¶
func WithSolverOptions(solverOpts ...solver.Option) ProverOption
WithSolverOptions specifies the constraint system solver options.
func WithStatisticalZeroKnowledge ¶
func WithStatisticalZeroKnowledge() ProverOption
WithStatisticalZeroKnowledge ensures that statistical zero knowledgeness is achieved. This option makes the prover more memory costly, as there are 3 more size n (size of the circuit) allocations.
type VerifierConfig ¶
type VerifierConfig struct { HashToFieldFn hash.Hash ChallengeHash hash.Hash KZGFoldingHash hash.Hash }
VerifierConfig is the configuration for the verifier with the options applied.
func NewVerifierConfig ¶
func NewVerifierConfig(opts ...VerifierOption) (VerifierConfig, error)
NewVerifierConfig returns a default VerifierConfig with given verifier options applied.
type VerifierOption ¶
type VerifierOption func(*VerifierConfig) error
VerifierOption defines option for altering the behavior of the verifier. See the descriptions of functions returning instances of this type for implemented options.
func WithVerifierChallengeHashFunction ¶
func WithVerifierChallengeHashFunction(hFunc hash.Hash) VerifierOption
WithVerifierChallengeHashFunction sets the hash function used for computing non-interactive challenges in Fiat-Shamir heuristic. If not set then by default SHA2-256 is used. Used mainly for compatibility between different systems and efficient recursion.
func WithVerifierHashToFieldFunction ¶
func WithVerifierHashToFieldFunction(hFunc hash.Hash) VerifierOption
WithVerifierHashToFieldFunction changes the hash function used for hashing bytes to field. If not set then the default hash function based on RFC 9380 is used. Used mainly for compatibility between different systems and efficient recursion.
func WithVerifierKZGFoldingHashFunction ¶
func WithVerifierKZGFoldingHashFunction(hFunc hash.Hash) VerifierOption
WithVerifierKZGFoldingHashFunction sets the hash function used for computing the challenge when folding the KZG opening proofs. If not set then by default SHA2-256 is used. Used mainly for compatibility between different systems and efficient recursion.
Directories ¶
Path | Synopsis |
---|---|
Package groth16 implements Groth16 Zero Knowledge Proof system (aka zkSNARK).
|
Package groth16 implements Groth16 Zero Knowledge Proof system (aka zkSNARK). |
bn254/icicle
Package icicle_bn254 implements ICICLE acceleration for BN254 Groth16 backend.
|
Package icicle_bn254 implements ICICLE acceleration for BN254 Groth16 backend. |
Package plonk implements PLONK Zero Knowledge Proof system.
|
Package plonk implements PLONK Zero Knowledge Proof system. |
Package witness provides serialization helpers to encode a witness into a []byte.
|
Package witness provides serialization helpers to encode a witness into a []byte. |