Documentation ¶
Index ¶
- func ArrayBigIntToString(bi []*big.Int) []string
- func ParsePk(pkJson []byte) (*types.Pk, error)
- func ParsePkBin(f *os.File) (*types.Pk, error)
- func ParsePkGoBin(f *os.File) (*types.Pk, error)
- func ParseProof(pj []byte) (*types.Proof, error)
- func ParsePublicSignals(pj []byte) ([]*big.Int, error)
- func ParseVk(vj []byte) (*types.Vk, error)
- func ParseWitness(wJson []byte) (types.Witness, error)
- func ParseWitnessBin(f *os.File) (types.Witness, error)
- func PkToGoBin(pk *types.Pk) ([]byte, error)
- func ProofStringToProof(pr ProofString) (*types.Proof, error)
- func ProofToJson(p *types.Proof) ([]byte, error)
- func ProofToJsonHex(p *types.Proof) ([]byte, error)
- func VkStringToVk(vr VkString) (*types.Vk, error)
- type PkString
- type ProofString
- type VkString
- type WitnessString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayBigIntToString ¶
ArrayBigIntToString converts an []*big.Int into []string, used to output the Public Signals
func ParsePkBin ¶
ParsePkBin parses binary file representation of the ProvingKey into the ProvingKey struct
func ParsePkGoBin ¶
ParsePkGoBin parses go-circom-prover-verifier binary file representation of the ProvingKey into ProvingKey struct (*types.Pk). PkGoBin is a own go-circom-prover-verifier binary format that allows to go faster when parsing.
func ParseProof ¶
ParseProof takes a json []byte and outputs the *Proof struct
func ParsePublicSignals ¶
ParsePublicSignals takes a json []byte and outputs the []*big.Int struct
func ParseWitness ¶
ParseWitness parses the json []byte data into the Witness struct
func ParseWitnessBin ¶
ParseWitnessBin parses binary file representation of the Witness into the Witness struct
func PkToGoBin ¶
PkToGoBin converts the ProvingKey (*types.Pk) into binary format defined by go-circom-prover-verifier. PkGoBin is a own go-circom-prover-verifier binary format that allows to go faster when parsing.
func ProofStringToProof ¶
func ProofStringToProof(pr ProofString) (*types.Proof, error)
func ProofToJson ¶
ProofToJson outputs the Proof i Json format
func ProofToJsonHex ¶
ProofToJsonHex outputs the Proof i Json format with hexadecimal strings
Types ¶
type PkString ¶
type PkString struct { A [][]string `json:"A"` B2 [][][]string `json:"B2"` B1 [][]string `json:"B1"` C [][]string `json:"C"` NVars int `json:"nVars"` NPublic int `json:"nPublic"` VkAlpha1 []string `json:"vk_alfa_1"` VkDelta1 []string `json:"vk_delta_1"` VkBeta1 []string `json:"vk_beta_1"` VkBeta2 [][]string `json:"vk_beta_2"` VkDelta2 [][]string `json:"vk_delta_2"` HExps [][]string `json:"hExps"` DomainSize int `json:"domainSize"` PolsA []map[string]string `json:"polsA"` PolsB []map[string]string `json:"polsB"` }
PkString is the equivalent to the Pk struct in string representation, containing the ProvingKey
type ProofString ¶
type ProofString struct { A []string `json:"pi_a"` B [][]string `json:"pi_b"` C []string `json:"pi_c"` Protocol string `json:"protocol"` }
ProofString is the equivalent to the Proof struct in string representation
func ProofStringToSmartContractFormat ¶
func ProofStringToSmartContractFormat(s ProofString) ProofString
ProofStringToSmartContractFormat converts the ProofString to a ProofString in the SmartContract format in a ProofString structure
func ProofToHex ¶
func ProofToHex(p *types.Proof) ProofString
ProofToHex converts the Proof to ProofString with hexadecimal strings
func ProofToSmartContractFormat ¶
func ProofToSmartContractFormat(p *types.Proof) ProofString
ProofToSmartContractFormat converts the *types.Proof to a ProofString in the SmartContract format in a ProofString structure
func ProofToString ¶
func ProofToString(p *types.Proof) ProofString
ProofToString converts the Proof to ProofString
type VkString ¶
type VkString struct { Alpha []string `json:"vk_alfa_1"` Beta [][]string `json:"vk_beta_2"` Gamma [][]string `json:"vk_gamma_2"` Delta [][]string `json:"vk_delta_2"` IC [][]string `json:"IC"` }
VkString is the Verification Key data structure in string format (from json)
type WitnessString ¶
type WitnessString []string
WitnessString contains the Witness in string representation