modexp

package
v0.0.0-...-50d4516 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	Settings Settings
	// Binary column indicating if we have base limbs
	IsModExpBase ifaces.Column
	// Binary column indicating if we have exponent limbs
	IsModExpExponent ifaces.Column
	// Binary column indicating if we have modulus limbs
	IsModExpModulus ifaces.Column
	// Binary column indicating if we have result limbs
	IsModExpResult ifaces.Column

	// Multiplexed column containing limbs for base, exponent, modulus, and result
	Limbs ifaces.Column
	// contains filtered or unexported fields
}

input collects references to the columns of the arithmetization containing the Modexp statements. These columns are constrained via a projection query to describe the same statement as what is being stated in the antichamber module. They are also used as a data source to assign the columns of the antichamber module.

The columns provided here are columns from the BLK_MDXP module.

type Module

type Module struct {
	// MaxNb256BitsInstances MaxNb4096BitsInstances corresponds to the maximum
	// number of instances that we want to support for the corresponding variant
	// of the Modexp circuit.
	MaxNb256BitsInstances, MaxNb4096BitsInstances int
	// Input stores the columns used as a source for the antichamber.
	Input Input
	// IsActive is a binary indicator column marking with a 1, the rows of the
	// antichamber modules corresponding "active" rows: e.g. NOT padding rows.
	IsActive ifaces.Column
	// IsSmall, IsLarge are indicator columns that are constant per modexp
	// instances. They are mutually exclusive and
	IsSmall, IsLarge ifaces.Column
	// Limb contains the modexp arguments and is subjected to a projection
	// constraint from the BLK_MDXP (using IsActive as filter). It is constrained
	// to zero when IsActive = 0.
	Limbs ifaces.Column
	// LsbIndicator is a precomputed column marking with a 1 the last two limbs
	// of every operands. The column is precomputed because all Modexp provided
	// by the arithmetization have exactly the same layout.
	LsbIndicator ifaces.Column
	// ToSmallCirc and ToLargeCirc are indicator columns marking with a 1 the
	// positions of limbs corresponding to public inputs of (respectely) the
	// small and the large circuit.
	ToSmallCirc ifaces.Column
	// connection logic of the modexp circuit specialized for the small and
	// large instances respectively
	GnarkCircuitConnector256Bits, GnarkCircuitConnector4096Bits *plonk.Alignment
	// contains filtered or unexported fields
}

Module implements the wizard part responsible for checking the MODEXP claims coming from the BLKMDXP module of the arithmetization.

func NewModuleZkEvm

func NewModuleZkEvm(comp *wizard.CompiledIOP, settings Settings) *Module

NewModuleZkEvm constructs an instance of the modexp module. It should be called only once.

To define the circuit, call Module.WithCircuit as the present function does not define them.

func (*Module) Assign

func (mod *Module) Assign(run *wizard.ProverRuntime)

Assign assigns the anti-chamber module

func (*Module) WithCircuit

func (mod *Module) WithCircuit(comp *wizard.CompiledIOP, options ...plonk.Option) *Module

WithCircuits adds the Plonk-in-Wizard circuit verification to complete the anti-chamber.

type Settings

type Settings struct {
	MaxNbInstance256, MaxNbInstance4096 int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL