Documentation ¶
Index ¶
- func CalculateWitness(wasmFilePath string, inputs map[string]interface{}) ([]*big.Int, error)
- func CalculateWitnessBinWASM(wasmBytes []byte, inputs map[string]interface{}) ([]*big.Int, error)
- func ParseInputs(inputsJSON []byte) (map[string]interface{}, error)
- type Circom2WitnessCalculator
- func (wc *Circom2WitnessCalculator) CalculateBinWitness(inputs map[string]interface{}, sanityCheck bool) ([]byte, error)
- func (wc *Circom2WitnessCalculator) CalculateWTNSBin(inputs map[string]interface{}, sanityCheck bool) ([]byte, error)
- func (wc *Circom2WitnessCalculator) CalculateWitness(inputs map[string]interface{}, sanityCheck bool) ([]*big.Int, error)
- type WitnessCalculator
- type WitnessJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateWitness ¶
func CalculateWitnessBinWASM ¶
func ParseInputs ¶
ParseInputs parses WitnessCalc inputs from JSON that consist of a map of types which contain a recursive combination of: numbers, base-10 encoded numbers in string format, arrays.
Types ¶
type Circom2WitnessCalculator ¶ added in v0.2.0
type Circom2WitnessCalculator struct {
// contains filtered or unexported fields
}
Circom2WitnessCalculator is the object that allows performing witness calculation from signal inputs using the WitnessCalc WASM module.
func NewCircom2WitnessCalculator ¶ added in v0.2.0
func NewCircom2WitnessCalculator(wasmBytes []byte, sanityCheck bool) (*Circom2WitnessCalculator, error)
NewCircom2WitnessCalculator creates a new WitnessCalculator from the WitnessCalc loaded WASM module in the runtime.
func (*Circom2WitnessCalculator) CalculateBinWitness ¶ added in v0.2.0
func (wc *Circom2WitnessCalculator) CalculateBinWitness(inputs map[string]interface{}, sanityCheck bool) ([]byte, error)
CalculateBinWitness calculates the witness in binary given the inputs.
func (*Circom2WitnessCalculator) CalculateWTNSBin ¶ added in v0.2.0
func (wc *Circom2WitnessCalculator) CalculateWTNSBin(inputs map[string]interface{}, sanityCheck bool) ([]byte, error)
CalculateWTNSBin calculates the witness in binary given the inputs.
func (*Circom2WitnessCalculator) CalculateWitness ¶ added in v0.2.0
func (wc *Circom2WitnessCalculator) CalculateWitness(inputs map[string]interface{}, sanityCheck bool) ([]*big.Int, error)
CalculateWitness calculates the witness given the inputs.
type WitnessCalculator ¶
type WitnessCalculator struct {
// contains filtered or unexported fields
}
WitnessCalculator is the object that allows performing witness calculation from signal inputs using the WitnessCalc WASM module.
func NewWitnessCalculator ¶
NewWitnessCalculator creates a new WitnessCalculator from the WitnessCalc loaded WASM module in the runtime.
func (*WitnessCalculator) CalculateBinWitness ¶
func (wc *WitnessCalculator) CalculateBinWitness(inputs map[string]interface{}, sanityCheck bool) ([]byte, error)
CalculateWitness calculates the witness in binary given the inputs.
func (*WitnessCalculator) CalculateWitness ¶
func (wc *WitnessCalculator) CalculateWitness(inputs map[string]interface{}, sanityCheck bool) ([]*big.Int, error)
CalculateWitness calculates the witness given the inputs.
type WitnessJSON ¶
WitnessJSON is a wrapper type to Marshal the Witness in JSON format
func (WitnessJSON) MarshalJSON ¶
func (w WitnessJSON) MarshalJSON() ([]byte, error)
MarshalJSON marshals the WitnessJSON where each value is encoded in base 10 as a string in an array.