From 4a9fd030bdaf654f840a31e82ba2845ca1b87928 Mon Sep 17 00:00:00 2001 From: Balazs Komuves Date: Sat, 13 Jun 2026 23:20:28 +0200 Subject: [PATCH] some refactor, useful additions, tests; as a preparation for dynamic proofs --- README.md | 1 + groth16/bn128/arrays.nim | 24 +++++ groth16/bn128/fields.nim | 5 +- groth16/dynamic/types.nim | 53 ++++++++++ groth16/fake_setup.nim | 11 +- groth16/math/convert.nim | 151 ++++++++++++++++++++++++++++ groth16/math/convolution.nim | 70 +++++++++++++ groth16/partial/README.md | 16 +++ groth16/partial/precalc.nim | 2 +- groth16/partial/types.nim | 9 ++ tests/groth16/testFFT.nim | 15 +++ tests/groth16/testLagrangeTau.nim | 56 +++++++++++ tests/groth16/testPtCompression.nim | 1 - tests/test.nim | 3 +- 14 files changed, 403 insertions(+), 14 deletions(-) create mode 100644 groth16/dynamic/types.nim create mode 100644 groth16/math/convert.nim create mode 100644 groth16/math/convolution.nim create mode 100644 groth16/partial/README.md create mode 100644 tests/groth16/testLagrangeTau.nim diff --git a/README.md b/README.md index e16c8c1..e49e28e 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,5 @@ at your choice. - [ ] add Groth16 notes - [ ] document the `snarkjs` circuit-specific setup `H` points convention - [x] precalculate stuff for "partial" proofs +- [ ] implement Dynark style "dynamic proofs" too - [ ] make it work for different curves diff --git a/groth16/bn128/arrays.nim b/groth16/bn128/arrays.nim index 0b65368..184ed57 100644 --- a/groth16/bn128/arrays.nim +++ b/groth16/bn128/arrays.nim @@ -32,6 +32,22 @@ proc scaleFrSeqInPlace*(s: Fr[BN254_Snarks], arr: var seq[Fr[BN254_Snarks]] ) = for i in 0..