Documentation
¶
Index ¶
- func ParsePk(pkJSON []byte) (*types.Pk, error)
- func ParsePkBin(r io.Reader) (*types.Pk, error)
- func ParsePkGoBin(r io.Reader) (*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(r io.Reader) (types.Witness, error)
- func PkToGoBin(pk *types.Pk) ([]byte, error)
- func ProofToJSON(p *types.Proof) ([]byte, error)
- func ProofToJSONHex(p *types.Proof) ([]byte, error)
- type PkString
- type ProofString
- type PublicSignals
- type StringSlice
- type VkString
- type WitnessString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePkBin ¶
ParsePkBin parses binary file representation of the ProvingKey into the ProvingKey struct
func ParsePkGoBin ¶
ParsePkGoBin parses go-snark binary file representation of the ProvingKey into ProvingKey struct (*types.Pk). PkGoBin is a own go-snark 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-snark. PkGoBin is a own go-snark binary format that allows to go faster when parsing. nolint:gomnd
func ProofToJSON ¶
ProofToJSON outputs the Proof i JSON format
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_alpha_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
func (PkString) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (PkString) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*PkString) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PkString) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
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
func (ProofString) MarshalEasyJSON ¶
func (v ProofString) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProofString) MarshalJSON ¶
func (v ProofString) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ProofString) UnmarshalEasyJSON ¶
func (v *ProofString) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProofString) UnmarshalJSON ¶
func (v *ProofString) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PublicSignals ¶
type PublicSignals []string
func (PublicSignals) MarshalEasyJSON ¶
func (v PublicSignals) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PublicSignals) MarshalJSON ¶
func (v PublicSignals) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PublicSignals) UnmarshalEasyJSON ¶
func (v *PublicSignals) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PublicSignals) UnmarshalJSON ¶
func (v *PublicSignals) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StringSlice ¶
type StringSlice []string
func ArrayBigIntToString ¶
func ArrayBigIntToString(bi []*big.Int) StringSlice
ArrayBigIntToString converts an []*big.Int into []string, used to output the Public Signals
type VkString ¶
type VkString struct { Alpha []string `json:"vk_alpha_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)
func (VkString) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (VkString) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*VkString) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*VkString) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type WitnessString ¶
type WitnessString []string
WitnessString contains the Witness in string representation
func (WitnessString) MarshalEasyJSON ¶
func (v WitnessString) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WitnessString) MarshalJSON ¶
func (v WitnessString) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WitnessString) UnmarshalEasyJSON ¶
func (v *WitnessString) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WitnessString) UnmarshalJSON ¶
func (v *WitnessString) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface