Skip to content

Implement "glue" for prover modules over koalabear field - #8

Open
OmegaTymbJIep wants to merge 19 commits into
prover/limitless-top-level-rebasedfrom
feature/prover-over-koalabear-rebased
Open

Implement "glue" for prover modules over koalabear field#8
OmegaTymbJIep wants to merge 19 commits into
prover/limitless-top-level-rebasedfrom
feature/prover-over-koalabear-rebased

Conversation

@OmegaTymbJIep

Copy link
Copy Markdown

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

OmegaTymbJIep and others added 17 commits July 7, 2025 16:49
Added comprehensive implementation of flatten column functionality to handle limb data in a circuit:

1. Created new `FlattenColumn` component in `common` package that:
   - Manages flattened limbs and mask columns
   - Implements projection constraints to verify data consistency
   - Supports reuse across multiple circuits to avoid duplication

2. Refactored EC arithmetic modules to use shared flatten column:
   - Updated ECADD and ECMUL to use common implementation
   - Added proper column sharing between circuits
   - Improved variable naming for clarity
1. Flatten columns for limbs and circuit masks were used in the modexp module for both 256-bit and 4096-bit instances.
2. Updated modexp constraints for a limbs column divided into 8 smaller columns.
1. Use Flatten column in the ecpair module for a Plonk in Wizard part.
2. Adjust constraints for 8 columns of 16 bits.
3. Change the G2GroupCheckInstance.IsSuccess, so it uses 8 field values to represent the boolean, but the first 7 are empty.
* Make 16 bit limbs for address

* Make 16 bit limbs for txn signature

* Rewrite ecdata for 16 bit limbs

* Apply 16 bit divisions for unaligned data

* Fix address constrains, remove unused variables

* Break into 16 bit limbs

* Refactor constant name and structures assignment

* Refactor constant name and structures assignment

* Fix divideBytes empty input function, add test

* Fix wrong address trimming

* Change reader to read antichamber csv file

* Remove mocked data for modules that use hash module

* Add working ecdsa module

* Fix constraints and circuit

* Apply constraint for an every column

* Get rid of magic variables

* Fix address constraint over all columns

* Use constants from the common module

* Change constants, change comments, bring commented constraints back

* Add import for circuit

* Change constant name, remove commented import

* Fix ScanStreams, change limb size

* Make constant global

* Add left alignment for limbs

* Add GnarkDataLA column

* Uncomment projection query

* Remove commented print, fix formatting

* Rename DivideBytes into SplitBytes

* Fix magic values

* Change gnarkDataOffsetAlignment from bytes to bits
* Remove GenDataLA column

* Remove redundant assignments
* Add a multi_limb_add dedicated wizard

* Add testdata for multilimb importpad tests

* Fix typo

* Adjust sha2 importpad to use several limb columns

* Adjust mimc importpad to use several limb columns

* Adjust keccak importpad to use several limb columns

* Fix naming in tests

* Fix testdata generator script

* Make b operand a multilimb one in AddColToLimbs

* Rename AddColToLimbs to MultiLimbAdd
* WIP

* Refactor limb length indexing for consistency and correctness

* Fix constraint to apply decompositionHappened in last limb

* Fix limb decomposition constraints and carry assignment

* Add test cases for limb decomposition with carry

Fix IsActive column assignment in test utils

* Fix byte packing constraints and test data generation

The changes affect hashing byte packing code, correcting constraint equations and
improving test data handling. Key fixes include removing an incorrect byte shift
and restructuring decomposition detection logic.

* Fix limb array length and improve nByte decomposition

The commit improves limb array handling and nByte decomposition in the lane
repacking logic. It replaces manually tracked decomposed lengths with a
dedicated helper function and fixes array size declarations.

* Fix lane bytes extraction in hash lane repacking

* Fix nbrows initialization

* Fix lane bytes calculation and ceil division

* Fix lane accumulation byte size limit

* Remove maxLen field from decomposition struct

* Fix lane bytes truncation in hash packing

* Add range checks for decomposed limbs and carry values

* Add length consistency check in CLD decomposition

* Fix decomposition check by vectorizing expression of
decompositionHappened for each column
* Update sha2 module for koalabear field

* Fix according to a packing changes
@OmegaTymbJIep
OmegaTymbJIep force-pushed the feature/prover-over-koalabear-rebased branch from 4a6dab3 to f46ec50 Compare July 7, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants