Documentation ¶
Index ¶
- Constants
- Variables
- func CompileCircuit() frontend.CompiledConstraintSystem
- func GetChallengeIndex(index [32]byte, interval uint64) uint64
- func NewProvingKey(b []byte) groth16.ProvingKey
- func NewVerifyingKey(b []byte) groth16.VerifyingKey
- func SetupZKP(r1cs frontend.CompiledConstraintSystem) (groth16.ProvingKey, groth16.VerifyingKey)
- func ZKPProve(r1cs frontend.CompiledConstraintSystem, pk groth16.ProvingKey, preimage []byte) ([]byte, []byte)
- func ZKPVerify(vk groth16.VerifyingKey, preimage []byte, hash []byte, proof []byte) bool
- type Circuit
- type GetHeaderByNum
- type Hasher
- type Prover
- type Verifier
Constants ¶
View Source
const SEED = "Go Evanesco"
Variables ¶
View Source
var ( ErrorInvalidR1CSPath = errors.New("r1cs path invalid") ErrorInvalidPkPath = errors.New("proving key path invalid") ErrorInvalidVkPath = errors.New("verifying key path invalid") )
View Source
var MimcHasher = Hasher{ // contains filtered or unexported fields }
Functions ¶
func CompileCircuit ¶
func CompileCircuit() frontend.CompiledConstraintSystem
func GetChallengeIndex ¶
func NewProvingKey ¶
func NewProvingKey(b []byte) groth16.ProvingKey
func NewVerifyingKey ¶
func NewVerifyingKey(b []byte) groth16.VerifyingKey
func SetupZKP ¶
func SetupZKP(r1cs frontend.CompiledConstraintSystem) (groth16.ProvingKey, groth16.VerifyingKey)
func ZKPProve ¶
func ZKPProve(r1cs frontend.CompiledConstraintSystem, pk groth16.ProvingKey, preimage []byte) ([]byte, []byte)
Types ¶
type Circuit ¶
type Prover ¶
type Prover struct {
// contains filtered or unexported fields
}
func NewProblemProver ¶
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
func NewProblemVerifier ¶
func NewProblemVerifier(vkPath string, interval, advance uint64, getHeaderByNum GetHeaderByNum) (*Verifier, error)
Click to show internal directories.
Click to hide internal directories.