Documentation ¶
Overview ¶
Package ecarith provides the integrations of the EC_MUL and EC_ADD precompile calls.
Index ¶
Constants ¶
const ( ROUND_NR = 0 NAME_ECMUL = "ECMUL_INTEGRATION" )
const (
NAME_ECADD = "ECADD_INTEGRATION"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ECAddInstance ¶
type ECAddInstance struct { // First input to addition P_X_hi, P_X_lo frontend.Variable `gnark:",public"` P_Y_hi, P_Y_lo frontend.Variable `gnark:",public"` // Second input to addition Q_X_hi, Q_X_lo frontend.Variable `gnark:",public"` Q_Y_hi, Q_Y_lo frontend.Variable `gnark:",public"` // The result of the addition. Is provided non-deterministically by the // caller, we have to ensure that the result is correct. R_X_hi, R_X_lo frontend.Variable `gnark:",public"` R_Y_hi, R_Y_lo frontend.Variable `gnark:",public"` }
type ECMulInstance ¶
type ECMulInstance struct {
P_X_hi, P_X_lo frontend.Variable `gnark:",public"`
P_Y_hi, P_Y_lo frontend.Variable `gnark:",public"`
N_hi, N_lo frontend.Variable `gnark:",public"`
// The result of the multiplication. Is provided by the caller, we have to
// ensure that the result is correct.
R_X_hi, R_X_lo frontend.Variable `gnark:",public"`
R_Y_hi, R_Y_lo frontend.Variable `gnark:",public"`
}
type EcAdd ¶
type EcAdd struct { *EcDataAddSource AlignedGnarkData *plonk.Alignment *Limits // contains filtered or unexported fields }
EcMulIntegration integrated EC_MUL precompile call verification inside a gnark circuit.
func NewEcAddZkEvm ¶
func NewEcAddZkEvm(comp *wizard.CompiledIOP, limits *Limits) *EcAdd
func (*EcAdd) Assign ¶
func (em *EcAdd) Assign(run *wizard.ProverRuntime)
Assign assigns the data from the trace to the gnark inputs.
type EcDataAddSource ¶
type EcDataAddSource struct { CsEcAdd ifaces.Column Limb ifaces.Column Index ifaces.Column IsData ifaces.Column IsRes ifaces.Column }
EcDataAddSource is a struct that holds the columns that are used to fetch data from the EC_DATA module from the arithmetization.
type EcDataMulSource ¶
type EcDataMulSource struct { CsEcMul ifaces.Column Limb ifaces.Column Index ifaces.Column IsData ifaces.Column IsRes ifaces.Column }
EcDataMulSource is a struct that holds the columns that are used to fetch data from the EC_DATA module from the arithmetization.
type EcMul ¶
type EcMul struct { *EcDataMulSource AlignedGnarkData *plonk.Alignment *Limits // contains filtered or unexported fields }
EcMul integrated EC_MUL precompile call verification inside a gnark circuit.
func NewEcMulZkEvm ¶
func NewEcMulZkEvm(comp *wizard.CompiledIOP, limits *Limits) *EcMul
func (*EcMul) Assign ¶
func (em *EcMul) Assign(run *wizard.ProverRuntime)
Assign assigns the data from the trace to the gnark inputs.
type Limits ¶
type Limits struct { // how many ecmul can we do in a single circuit NbInputInstances int // how many circuit instances can we have NbCircuitInstances int }
Limits defines the upper limits on the size of the circuit and the number of gnark circuits. The total number of allowed EC_MUL precompile calls is product of the fields.
type MultiECAddCircuit ¶
type MultiECAddCircuit struct {
Instances []ECAddInstance
}
MultiECAddCircuit is a circuit that can handle multiple EC_ADD instances. The length of the slice Instances should corresponds to the one defined in the Limits struct.
func NewECAddCircuit ¶
func NewECAddCircuit(limits *Limits) *MultiECAddCircuit
NewECMulCircuit creates a new circuit for verifying the EC_MUL precompile based on the defined number of inputs.
type MultiECMulCircuit ¶
type MultiECMulCircuit struct {
Instances []ECMulInstance
}
MultiECMulCircuit is a circuit that can handle multiple EC_MUL instances. The length of the slice Instances should corresponds to the one defined in the Limits struct.
func NewECMulCircuit ¶
func NewECMulCircuit(limits *Limits) *MultiECMulCircuit
NewECMulCircuit creates a new circuit for verifying the EC_MUL precompile based on the defined number of inputs.