Documentation ¶
Overview ¶
Packing package implements the utilities for Packing the limbs of variable length to the lanes of fixed length.
Index ¶
Constants ¶
const ( MAXNBYTE = 16 LEFT_ALIGNMENT = 16 POWER8 = 1 << 8 )
const ( PACKING = "PACKING" CLEANING = "CLEANING" DECOMPOSITION = "DECOMPOSITION" LENGTH_CONSISTENCY = "LENGTH_CONSISTENCY" SPAGHETTI = "SPAGHETTI" LANE = "LANE" BLOCK = "BLOCK" )
Variables ¶
This section is empty.
Functions ¶
func NewClean ¶
func NewClean(comp *wizard.CompiledIOP, inp cleaningInputs) cleaningCtx
NewClean imposes the constraint for cleaning the limbs.
func NewLookupTables ¶
func NewLookupTables(comp *wizard.CompiledIOP) lookUpTables
It commits to the lookUp tables used by dataTransfer module.
Types ¶
type Importation ¶
type Importation struct { // The set of the limbs that are subject to Packing (i.e., should be pushed into the pack). // Limbs are 16 bytes, left aligned. Limb ifaces.Column // It is 1 if the associated limb is the first limb of the new hash. IsNewHash ifaces.Column // NByte is the meaningful length of limbs in byte. // \Sum NByte[i] should divide the blockSize, // otherwise a padding step is required before calling the Packing module NByte ifaces.Column // The active part of the columns in the Importation module IsActive ifaces.Column }
Importaion implements the set of required columns for launching the Packing module.
type Packing ¶
type Packing struct { Inputs PackingInput // submodules Cleaning cleaningCtx LookUps lookUpTables Decomposed decomposition // it stores the result of the Packing // limbs are repacked in Lane column. Repacked laneRepacking Block block }
Packing implements the wizard.ProverAction receiving the limbs and relevant parameters,
it repack them in the lanes of the same size.
func NewPack ¶
func NewPack(comp *wizard.CompiledIOP, inp PackingInput) *Packing
NewPack creates a Packing object.
The lanes and relevant metadata can be accessed via Packing.Repacked.
It panics if the columns in Imported have a size different from;
size := utils.NextPowerOfTwo(inp.packingParam.blockSize * inp.maxNumBlocks)
It also panics if the number of generated blocks passes the limit inp.maxNumBlocks
func (*Packing) Run ¶
func (pck *Packing) Run(run *wizard.ProverRuntime)
Run assign the Packing module.
type PackingInput ¶
type PackingInput struct { // The maximum number of blocks that can be extracted from limbs. // If the number of blocks passes the max, newPack() would panic. MaxNumBlocks int PackingParam generic.HashingUsecase // The columns in Imported should be of size; // size := utils.NextPowerOfTwo(packingParam.blockSize * maxNumBlocks) Imported Importation Name string }
The set of parameters and columns required to launch the module.