Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

🗼 Tower Extensions (Fq2, Fq6, and Fq12) and Torus Compression for BN254 precompiles #38

Draft
wants to merge 109 commits into
base: dl-precompiles
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
7afe9cd
add sage source files and `README.md` file
ZamDimon Mar 12, 2024
ada1149
:sparkles: add the basic multiplication version
ZamDimon Mar 12, 2024
1b1ed54
:sparkles: update `beta` parameter in wnaf scalar multiplication
ZamDimon Mar 13, 2024
7359f51
:technologist: verify that chosen beta parameter is valid on bn254 curve
ZamDimon Mar 13, 2024
7cb291e
:memo: specify what parameters were chosen in the Sage file for wnaf …
ZamDimon Mar 13, 2024
4bf6ed4
:heavy_plus_sign: find values a1,b1,a2,b2 for BN254 curve
ZamDimon Mar 13, 2024
930220e
:twisted_rightwards_arrows: convert constants to Fq field elements
ZamDimon Mar 13, 2024
a0aa6c3
:broom: fix all the constants
ZamDimon Mar 14, 2024
241dd3a
:broom: polish the code
ZamDimon Mar 14, 2024
1cafd0b
:thought_balloon: fix comment
ZamDimon Mar 14, 2024
2eaea09
:arrow_up: add basic implementation for `zeroable_affine`
ZamDimon Mar 15, 2024
b487274
:sparkles: basic implementation of a line function
ZamDimon Mar 18, 2024
f4a644b
:zap: add tangent function evaluation
ZamDimon Mar 18, 2024
3b4ed5d
:rotating_light: run `cargo fmt`
ZamDimon Mar 18, 2024
ccf0f9c
:construction: added basic tower extension
NikitaMasych Mar 21, 2024
34386af
:construction: completed basic `fp2` and `fp6` implementation
ZamDimon Mar 21, 2024
7308d02
:sparkles: complete `fp12` implementation
ZamDimon Mar 21, 2024
2f50fd5
:green_heart: make it somewhat working
ZamDimon Mar 21, 2024
2f92e96
:sparkles: add basic outline of tower extension trait implementations…
ZamDimon Mar 25, 2024
23b911a
:green_heart: add `ExtendedSWProjective` struct for twisted curve
ZamDimon Mar 26, 2024
dd53cab
:construction: added field-specific parametrization for tower and fro…
NikitaMasych Mar 28, 2024
c73c454
:twisted_rightwards_arrows: tower extension params
NikitaMasych Mar 28, 2024
76fb529
:adhesive_bandage: make getting `b_twist` a bit neater
ZamDimon Mar 28, 2024
024965c
:test_tube: add basic outline of `ec_pairing` final function
ZamDimon Mar 28, 2024
d48492e
:sparkles: complete the `easy_part` of final exp
ZamDimon Mar 28, 2024
f329b5a
:sparkles: add `hard_exp` part
ZamDimon Mar 28, 2024
e6a4ac3
:bug: fix `c0c1c4` notation to `c0c3c4`
ZamDimon Mar 29, 2024
8d307d6
:twisted_rightwards_arrows: Merge pull request #3 from `distributed-l…
ZamDimon Mar 29, 2024
3e765d9
:construction: added witness conversion for constant allocation
NikitaMasych Apr 2, 2024
88f602e
Merge branch 'feature/tower-extension-trait-impls' into feature/bn254…
NikitaMasych Apr 2, 2024
f826e39
:sparkles: add field extension inverse methods
ZamDimon Apr 3, 2024
ab97005
:fire: remove `wnaf`-based multiplication in sync with ecmul windowed…
ZamDimon Apr 5, 2024
8fface9
:recycle: make bn256 types public
ZamDimon Apr 5, 2024
f8f9190
:construction: fixing scalar multiplication for bn254
ZamDimon Apr 9, 2024
b3efe94
:sparkles: finish constant allocation and frobenius map for tower ext…
NikitaMasych Apr 9, 2024
63bd0a8
:test_tube: finalize the `ecmul` implementation
ZamDimon Apr 9, 2024
dc06e74
:adhesive_bandage: :fire: remove useless debugging and left shift fun…
ZamDimon Apr 9, 2024
008c487
:sparkles: add `projective_add` function
ZamDimon Apr 10, 2024
c91b3d5
:bug: fix `fq2` inverse operation
ZamDimon Apr 10, 2024
de1295a
:bug: fix `fq6` operations that did not work
ZamDimon Apr 11, 2024
4ad8406
:fire: remove unused `mem` library from `use`s
ZamDimon Apr 11, 2024
8aa50ad
:construction: added torus integration to exponentiation in pairing
NikitaMasych Apr 12, 2024
097e1b3
:adhesive_bandage: fixes after PR review
ZamDimon Apr 12, 2024
25d26e6
:recycle: come back to old `ecmul`
ZamDimon Apr 16, 2024
9c8e923
:technologist: make final exponentiation work
ZamDimon Apr 17, 2024
66c5a9e
:sparkles: further `ecpairing` fixes
ZamDimon Apr 20, 2024
e74cec7
:adhesive_bandage: final `ecpairing` fixes
ZamDimon Apr 25, 2024
4efdc40
:memo: fix comments in `ecpairing`
ZamDimon Apr 25, 2024
f447972
:sparkles: add `NonNativeField` implementation for `Fq6`
ZamDimon Apr 26, 2024
77a2db8
:adhesive_bandage: add `NonNativeField` implementation for all field …
ZamDimon Apr 26, 2024
86fa901
:building_construction: made public convertion functions and added pa…
NikitaMasych Apr 26, 2024
d008332
:construction: trying to make `modexp`
ZamDimon Apr 26, 2024
a55fa99
:fire: remove `bn254`-specific functionality
ZamDimon Apr 29, 2024
bb86ebc
:fire: removed duplicating normalization for fq12
NikitaMasych Apr 30, 2024
7c93122
:sparkles: added enforce_reduced to sw_projective
NikitaMasych Apr 30, 2024
3ca46b8
:construction: continue with `modexp` implementation
ZamDimon Apr 30, 2024
3c82e38
:twisted_rightwards_arrows: Merge branch 'feature/bn254-ec-pairing', …
ZamDimon Apr 30, 2024
155d41b
Merge branch 'main' into feature/bn254-ec-pairing
NikitaMasych Apr 30, 2024
16aaaca
:fire: removed duplicating normalization for fq12
NikitaMasych Apr 30, 2024
902bc84
:sparkles: added enforce_reduced to sw_projective
NikitaMasych Apr 30, 2024
e93d297
:construction: continue with `modmul` implementation
ZamDimon May 3, 2024
814b8f6
:sparkles: add basic working `modmul`
ZamDimon May 3, 2024
a7f3b6f
:art: tiny polishes in `modexp`
ZamDimon May 6, 2024
df347dc
:fire: remove useless `.py` sage file in `modexp`
ZamDimon May 6, 2024
2589656
:adhesive_bandage: fixes according to the PR review
ZamDimon May 7, 2024
9e25358
:sparkles: added CSPlaceholder implementation for tower of extensions…
NikitaMasych May 10, 2024
ab529a3
:sparkles: implemented CircuitVarLengthEncodable for tower of extensi…
May 15, 2024
9772403
:sparkles: added implementation of serialize and deserialize for FFPr…
May 15, 2024
0baba09
:sparkles: added equality traits implementation to FFProxyValue
NikitaMasych May 15, 2024
15ae1dd
Merge branch 'feature/bn254-ec-pairing' into feature/modexp
ZamDimon May 16, 2024
db3c41b
:twisted_rightwards_arrows: Merge pull request #4 from `feature/modexp`
ZamDimon May 16, 2024
65e3b1d
:twisted_rightwards_arrows: merge `ecpairing` branch
ZamDimon May 17, 2024
393ede6
:sparkles: add `TorusWrapper` implementation
ZamDimon May 17, 2024
9f22dde
:bug: fix issues in `torus`
ZamDimon May 20, 2024
61dd23d
:twisted_rightwards_arrows: Merge pull request #5 from `feature/bn254…
ZamDimon May 22, 2024
16c213d
:bug: fixed frobenius map non-homogeneity in tower of extension
NikitaMasych May 23, 2024
dbd8c48
:bug: make `fq12` and `algebraic\_torus` circuits homogeneous
ZamDimon May 27, 2024
f73483e
:fire: remove `modexp` implementation: move to `era-zkevm-circuits`
ZamDimon May 27, 2024
591f781
normalize t1 prior to mul by nonresidue
jules May 27, 2024
1b5f72f
:construction: wip: implementing `u1024` and `u2048`
ZamDimon May 28, 2024
7f1167f
:green_heart: add normalizations to fix `uintx` issue
ZamDimon May 28, 2024
859372c
:adhesive_bandage: fix torus inverse function
ZamDimon May 28, 2024
d402c88
chore: move comments from dbg to log (#51)
mm-zk May 29, 2024
4bcb11f
feat: Update boojum nightly - feature gate packed simd (Attempt 2) (#50)
mm-zk May 29, 2024
c86b422
:1234: add basic `u1024` and `u2048` implementations
ZamDimon May 29, 2024
91c8e60
:heavy_plus_sign: implement `u4096`
ZamDimon May 30, 2024
794750d
:heavy_multiplication_x: implement multiplication for `u2048`
ZamDimon May 30, 2024
8c4f9d6
:1234: implement `modmul` and `long_division` for new uints
ZamDimon May 30, 2024
a0353f7
:bug: fix tiny issues in `long_division` implementation
ZamDimon May 30, 2024
7742e90
:art: fixed warnings and formatted
NikitaMasych May 31, 2024
6f0a42f
:zap: make even more optimizations
ZamDimon Jun 4, 2024
63a7c9e
Ensure nonnative field negate works in case of non-normalized input
jules Jun 9, 2024
2068938
:twisted_rightwards_arrows: Merge branch `fix_negate` into `feature/b…
ZamDimon Jun 11, 2024
f9cfb60
remove superfluous normalizations
jules Jun 12, 2024
1a79557
shave normalizations in the torus
jules Jun 12, 2024
dd82efc
further reduction of normalizations where possible
jules Jun 12, 2024
2200a02
:adhesive_bandage: fix `cargo clippy`, small polishes
ZamDimon Jun 12, 2024
5b8780c
:sparkles: add `one()` function in elliptic curves
ZamDimon Jun 12, 2024
ef80177
:zap: optimize `square` in torus a bit
ZamDimon Jun 12, 2024
a8049b0
:zap: add `mul_by_fq` method in `fq6`
ZamDimon Jun 12, 2024
b874fd0
:sparkles: add `HardExpCompatible` trait
ZamDimon Jun 14, 2024
2931865
:construction: added optimized torus squaring
NikitaMasych Jul 4, 2024
a040d85
Fix native torus square
jules Jul 9, 2024
6f798c1
:art: make torus code cleaner
ZamDimon Jul 10, 2024
7449bb6
:sparkles: add torus multiplication
ZamDimon Jul 10, 2024
b68be4e
:sparkles: finalize torus
ZamDimon Jul 10, 2024
6c9e39d
:sparkles: add sparse multiplication by c5 support
ZamDimon Jul 10, 2024
2a8ed75
:memo: remove useless debugging
ZamDimon Jul 10, 2024
e97e94f
:twisted_rightwards_arrows: Merge pull request #6 from `feature/torus…
ZamDimon Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/target
/profiling-target/target
/Cargo.lock

.idea/
3 changes: 3 additions & 0 deletions src/gadgets/curves/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sage/*.sage.py
bn256/*.sage.py
.ipynb_checkpoints
Loading