Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZK_ecip Rust translattion #157

Closed
wants to merge 99 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
04575c4
init cairo1
feltroidprime Jun 11, 2024
f0fcade
bn & bls final exp hints
feltroidprime Jun 14, 2024
ecbcf0c
add scalar_to_base_neg3_le python version
feltroidprime Jun 14, 2024
12fb77f
implementing scalar_to_base_neg3_le
luiz-lvj Jun 15, 2024
c1fbc79
performance updates
luiz-lvj Jun 15, 2024
b4c3157
updating tests
luiz-lvj Jun 15, 2024
0612d3e
Tweak neg_3_base_le to use one divmod
feltroidprime Jun 16, 2024
9c689fc
clean neg3 tests
feltroidprime Jun 16, 2024
cdc278a
compute (-3) powers in loop + returns abs(multiplicity)
feltroidprime Jun 16, 2024
257e149
move utils tests to utils.cairo
feltroidprime Jun 16, 2024
06dc9d9
add cairo transcript hasher fn & tests
feltroidprime Jun 16, 2024
3f06074
Merge commit 'dac43112e3298cf64cc8eb656dff05f1d4072ec6'
feltroidprime Jun 17, 2024
52ced17
hydra: allow arbitrary number of Fpk elmts in extf_mul
feltroidprime Jun 17, 2024
71ec916
hydra: use dedicated fp2_square instead of extf_mul
feltroidprime Jun 17, 2024
1b57dc4
bls sage math
feltroidprime Jun 18, 2024
ed1bab3
hydra: handle extf_square automatically
feltroidprime Jun 18, 2024
56ac985
bls sage ^ 2
feltroidprime Jun 18, 2024
4afef4b
bls ^3
feltroidprime Jun 19, 2024
def46a3
hydrat/repo : small updates
feltroidprime Jun 19, 2024
3447312
hydra/fustat : batch extf muls per miller loop bit
feltroidprime Jun 19, 2024
213131f
update to latest nightly
feltroidprime Jun 19, 2024
1d78e7e
cairo: add some utils fns.
feltroidprime Jun 19, 2024
e533494
hydra: Add G1Point to Cairo struct util
feltroidprime Jun 20, 2024
ce36474
cairo: basic ec_add circuit test and failing contract
feltroidprime Jun 20, 2024
df4f544
optimize loops
feltroidprime Jun 24, 2024
b8cd1be
wip: cairo1 compiler
feltroidprime Jun 24, 2024
23c4ae0
wip: cairo1 compiler^2
feltroidprime Jun 24, 2024
14b51c4
upd docs
feltroidprime Jun 27, 2024
183834a
wip: cairo1 compiler^3
feltroidprime Jun 27, 2024
abc2f27
add io utils
feltroidprime Jun 27, 2024
bd06410
hydra: remove unused computation
feltroidprime Jun 27, 2024
f400901
replace CurveID enum to match Cairo1
feltroidprime Jun 28, 2024
27efa87
update circuit syntax in compiler
feltroidprime Jun 28, 2024
05132a0
hydra auto-gen cairo1 unit tests
feltroidprime Jun 28, 2024
34d2539
rename tests/cairo_programs to tests/fustat_programs
feltroidprime Jun 28, 2024
dbcb607
rm deprecated doc
feltroidprime Jun 28, 2024
7d4dc79
clean algebra.py
feltroidprime Jun 28, 2024
f54debd
🔥 pure python zk-ecip
feltroidprime Jun 29, 2024
710cb10
py-ecip: add some comments
feltroidprime Jun 29, 2024
014ed37
pure python bls witness ok
feltroidprime Jun 30, 2024
45eeb7f
⚡️ hydra: multi pairing check for bn & bls
feltroidprime Jul 1, 2024
836c986
hydra: small comment/fixes
feltroidprime Jul 3, 2024
684dd5d
small cairo updates
feltroidprime Jul 3, 2024
3a2b7a5
hydra: always compile functions in the same order
feltroidprime Jul 3, 2024
b24e630
hydra: small fixes/checks
feltroidprime Jul 4, 2024
50470e2
Efficient hint computation for bls curves (#131)
akinovak Jul 5, 2024
014454d
use extf_inv instead of div
feltroidprime Jul 6, 2024
b23af55
separate lhs/rhs accumulation to re-use Pi+1[0](z) and update cairo1 …
feltroidprime Jul 6, 2024
8f63749
small updates
feltroidprime Jul 6, 2024
236cd42
add handmade bit0/bit1 Miller Cairo1 sub-circuits
feltroidprime Jul 6, 2024
a43b7d0
update compiled cairo circuits and benchmarks
feltroidprime Jul 6, 2024
b701e0d
derive_point_fromX circuit & test
feltroidprime Jul 9, 2024
cdfdbb6
move frobenius utils to separate file and improve perf with caching/t…
feltroidprime Jul 17, 2024
addd79a
Test MPCheck with pre-computed extra miller loop result
feltroidprime Jul 17, 2024
e9feea7
Add Cairo1SerializableStruct class
feltroidprime Jul 17, 2024
6935699
minor cleaning
feltroidprime Jul 17, 2024
a2111f1
minor fixes/refactor
feltroidprime Jul 17, 2024
29cddd9
refactor cairo1 compiler to handle structs in input/output
feltroidprime Jul 17, 2024
31031ee
update scarb
feltroidprime Jul 18, 2024
a3e012e
add basic field operations
feltroidprime Jul 18, 2024
9eb1266
mpcheck: prepare_pairs, prepare_lambda_root_evals, and init_bit circu…
feltroidprime Jul 19, 2024
b0ebec7
update (circuits, definitions, utils).cairo
feltroidprime Jul 19, 2024
35081c4
WIP: Pairing/Groth16 fns
feltroidprime Jul 19, 2024
e736bb8
Support comment per circuit operation
feltroidprime Jul 19, 2024
fcd4284
Support empty circuit in compilation
feltroidprime Jul 20, 2024
784a501
split bn254 finalize step to access the lines
feltroidprime Jul 20, 2024
fa68742
fixes & comments support in eval poly
feltroidprime Jul 20, 2024
0fae3bd
add Cairo1 structs
feltroidprime Jul 20, 2024
9e65983
small fixes & better generated comments
feltroidprime Jul 20, 2024
3b59b79
smal refactor
feltroidprime Jul 20, 2024
307c711
update generated circuits
feltroidprime Jul 20, 2024
6f0692e
bls MPcheck Cairo1 interfaces
feltroidprime Jul 20, 2024
d148171
compiler : pack inputs 2 by 2
feltroidprime Jul 21, 2024
eaf3e8f
bls 3 pairs test passing + fixes
feltroidprime Jul 21, 2024
38bc870
BLS 2 pairs passing
feltroidprime Jul 21, 2024
1bb57e7
feat(ecip): translate the zk_ecip_hint in rust for optimisation
bacharif Jul 31, 2024
1de33cf
feat(ecip): translate the zk_ecip_hint in rust for optimisation
bacharif Jul 31, 2024
c986d78
feat(ecip): translate the zk_ecip_hint in rust for optimisation
bacharif Jul 31, 2024
6cddd15
feat(ecip): Ecip in Rust
bacharif Aug 4, 2024
bcc3643
feat(ecip): Ecip in Rust
bacharif Aug 4, 2024
8ab4b3a
feat(isPrimeField): use generic type instead of PyFetl
bacharif Aug 5, 2024
daf57a0
feat(isPrimeField): use generic type instead of PyFetl
bacharif Aug 5, 2024
7146049
Merge branch 'main' of https://github.com/bacharif/garaga into ecip_i…
bacharif Aug 12, 2024
56ce912
merge main
bacharif Aug 12, 2024
50d08a9
Fix merge
bacharif Aug 12, 2024
18fe9a3
feat(polynome) : complete implementation of Polynome
bacharif Aug 12, 2024
b78c63e
feat(rationnal) : complete implementation of Rational and G1point
bacharif Aug 12, 2024
f3cbb45
feat(g1point) : complete implementation G1point
bacharif Aug 12, 2024
3264942
feat(poly): Rework Polynomial
bacharif Aug 12, 2024
3a48d9e
feat(rational): Rework Rational
bacharif Aug 12, 2024
7a5c33d
feat(FunctionFelt): Rework FunctionFelt
bacharif Aug 12, 2024
b106c9e
feat(Poly): Rework new function to trim zero coeff
bacharif Aug 12, 2024
c0da463
feat(core) : correction core
bacharif Aug 12, 2024
5b7ed1d
feat(core) : correction core
bacharif Aug 12, 2024
06703e1
feat(poly): add differentiate function
bacharif Aug 12, 2024
2a53e3d
feat(core): zk_ecip_hint_
bacharif Aug 14, 2024
a405eb0
ECIP rust translation
bacharif Aug 17, 2024
46ba068
Merge branch 'ecip_in_rust' into main
bacharif Aug 17, 2024
5a6a157
Co-authored-by: feltroid Prime <[email protected]>
bacharif Aug 17, 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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ venv

tools/garaga_rs/target/
tools/garaga_rs/Cargo.lock
<<<<<<< HEAD
tools/garaga_rs/sys

src/cairo/target/

tools/garaga_rs/target/
=======

src/cairo/target/
*target*
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ Ensure you have the following installed:
- [pprof](https://github.com/google/pprof) - A tool for visualization and analysis of profiling data. Requires [Go](https://go.dev/).
- [graphviz](https://graphviz.org/download/) - Necessary for generating graphical representations of profiling data.

<<<<<<< HEAD
=======

>>>>>>> a504e556e4f9731d65815eff327cc8f5dd654411
### Setup

Once you have the prerequisites installed, clone the repository, and set up your development environment with the following command. Be sure to run this command from the root of the repository.
Expand All @@ -96,6 +99,10 @@ At this point, you should have everything you need to start developing with Gara
| ADDMOD | 4 | Equivalent cost of a+b % p with the modulo builtin in VM steps |
| ASSERT_EQ | 2 | Equivalent cost of a==b % p with the modulo builtin in VM steps |
| RLC | 28 | Cost of writing a field element to the value segment and retrieving random coefficients |
<<<<<<< HEAD
| POSEIDON 3 LIMBS | 14 | Cost of hashing the first 3 limbs of 384 bits emulated field element with Poseidon |
=======
>>>>>>> a504e556e4f9731d65815eff327cc8f5dd654411
| POSEIDON 4 LIMBS | 17 | Cost of hashing the 4 limbs of 384 bits emulated field element with Poseidon |


Expand Down
30 changes: 30 additions & 0 deletions docs/hints_document.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ ids.elements_end - ids.elements >= ids.N_LIMBS
```

- **[Lines 145-145](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//utils.cairo#L145-L145)**
<<<<<<< HEAD

```python
ids.elements_end - ids.elements >= 6*ids.N_LIMBS
```

- **[Lines 147-152](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//utils.cairo#L147-L152)**

```python
=======

```python
ids.elements_end - ids.elements >= 6*ids.N_LIMBS
Expand Down Expand Up @@ -85,7 +95,16 @@ ids.elements_end - ids.elements >= ids.N_LIMBS
// to_hash=pack_bigint_ptr(memory, ids.elements, ids.N_LIMBS, ids.BASE, 1)
// for e in to_hash:
// print(f"\t\t Will Hash {hex(e)}")
<<<<<<< HEAD

```

- **[Lines 206-206](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//utils.cairo#L206-L206)**
=======
>>>>>>> a504e556e4f9731d65815eff327cc8f5dd654411

```python
print(f"res {hex(ids.res)}")
```

- **[Lines 206-206](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//utils.cairo#L206-L206)**
Expand Down Expand Up @@ -527,11 +546,22 @@ print(f"\tRunning ModuloBuiltin circuit...")
```

## File: [src/fustat/precompiled_circuits/dummy.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/dummy.cairo)
<<<<<<< HEAD

## File: [src/fustat/precompiled_circuits/ec.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/ec.cairo)

## File: [src/fustat/precompiled_circuits/extf_mul.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/extf_mul.cairo)

## File: [src/fustat/precompiled_circuits/final_exp.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/final_exp.cairo)

## File: [src/fustat/precompiled_circuits/multi_miller_loop.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/multi_miller_loop.cairo)
=======

## File: [src/fustat/precompiled_circuits/ec.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/ec.cairo)

## File: [src/fustat/precompiled_circuits/extf_mul.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/extf_mul.cairo)

## File: [src/fustat/precompiled_circuits/final_exp.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/final_exp.cairo)
>>>>>>> a504e556e4f9731d65815eff327cc8f5dd654411

## File: [src/fustat/precompiled_circuits/multi_miller_loop.cairo](https://github.com/keep-starknet-strange/garaga/blob/main/src/fustat//precompiled_circuits/multi_miller_loop.cairo)
2 changes: 1 addition & 1 deletion hydra/garaga/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,4 +1033,4 @@ def validate_degrees(self, msm_size: int) -> bool:
return True

def print_as_sage_poly(self, var: str = "x") -> str:
return f"(({self.b.numerator.print_as_sage_poly(var)}) / ({self.b.denominator.print_as_sage_poly(var)}) * y + ({self.a.numerator.print_as_sage_poly(var)} / ({self.a.denominator.print_as_sage_poly(var)})"
return f"(({self.b.numerator.print_as_sage_poly(var)}) / ({self.b.denominator.print_as_sage_poly(var)}) * y + ({self.a.numerator.print_as_sage_poly(var)} / ({self.a.denominator.print_as_sage_poly(var)})"
2 changes: 1 addition & 1 deletion hydra/garaga/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,4 +1107,4 @@ def replace_consecutive_zeros(lst):


if __name__ == "__main__":
pass
pass
2 changes: 1 addition & 1 deletion hydra/garaga/extension_field_modulo_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,4 +841,4 @@ def compile_circuit_cairo_zero(


if __name__ == "__main__":
pass
pass
111 changes: 111 additions & 0 deletions hydra/garaga/hints/bls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<<<<<<< HEAD
from hydra.hints.tower_backup import E12
from hydra.definitions import CURVES, CurveID
from math import gcd

=======
from math import gcd

from garaga.definitions import CURVES, CurveID
Expand All @@ -21,6 +27,7 @@

Since gcd(h1, λ) = 1 computing λ root of x_sh can be simply done by just raising x_sh^e where e = inverse_mod(h3, λ)
"""
>>>>>>> a504e556e4f9731d65815eff327cc8f5dd654411

# Bls

Expand All @@ -35,11 +42,14 @@

p = 5044125407647214251
h3 = h // (27 * p)
<<<<<<< HEAD
=======

e = pow(lam, -1, h3)
s = (-1 * pow(h3, -1, p * 27)) % (p * 27)


>>>>>>> a504e556e4f9731d65815eff327cc8f5dd654411
assert h % (27 * p) == 0
assert m == 3 * p**2

Expand All @@ -55,6 +65,106 @@
assert (q**3 - 1) % 27 == 0


<<<<<<< HEAD
def is_pth_residue(x: E12) -> bool:
return x ** (h3 * 27) == ONE


def get_pth_root_inverse(x: E12) -> E12:
if is_pth_residue(x):
return ONE

v = 27 * h3
wj = x**v

v_inv = pow(v, -1, p)
s = (-1 * v_inv) % p

return wj**s


def get_order_of_3rd_primitive_root(x: E12) -> int:
# correct way is do do r * p * h3 but outputs of equal Tate pairings are always of the form c^r thus there is no rth root contribution
y = x ** (p * h3)

if y == ONE:
return 0

y3 = y**3
if y3 == ONE:
return 1

y9 = y3**3
if y9 == ONE:
return 2

y27 = y9**3
if y27 == ONE:
return 3

else:
raise ValueError("")


def get_any_27th_root_inverse(x: E12) -> E12:
pw = get_order_of_3rd_primitive_root(x)

if pw == 0:
return ONE

_ord = 3**pw

v = p * h3
wj = x**v

v_inv = pow(v, -1, _ord)
s = (-1 * v_inv) % _ord

return wj**s


def h3_ord_element_lambda_root(x: E12) -> E12:
# after applying shifts we know that element is order just h3

e = pow(lam, -1, h3)
return x**e


# assumes it's already of the form x^r
def get_root_and_scaling_factor_bls(x: E12) -> tuple[E12, E12]:
assert x**h == ONE # assert that x = f^r for some f
wp_shift = get_pth_root_inverse(x)
w27_shift = get_any_27th_root_inverse(x)

w_full = wp_shift * w27_shift
x_shifted = x * w_full
root = h3_ord_element_lambda_root(x_shifted)

return (root, w_full)


if __name__ == "__main__":
from hydra.hints.multi_miller_witness import get_miller_loop_output

import random

random.seed(0)
for i in range(5):
f = get_miller_loop_output(curve_id=CurveID.BLS12_381, will_be_one=True)
root, w_full = get_root_and_scaling_factor_bls(f)
assert f * w_full == root**lam
print(f"{i} Will be one check ok")

f = get_miller_loop_output(curve_id=CurveID.BLS12_381, will_be_one=False)

try:
root, w_full = get_root_and_scaling_factor_bls(f)
assert f * w_full == root**lam
except (ValueError, AssertionError):
print(f"{i} No nth root -- Ok")
else:
raise ValueError("Non-one case should not pass")
=======
def get_root_and_scaling_factor_bls(mlo: E12) -> tuple[E12, E12]:
"""
Takes a miller loop output and returns root, shift such that
Expand All @@ -64,3 +174,4 @@ def get_root_and_scaling_factor_bls(mlo: E12) -> tuple[E12, E12]:
shift = x**s
root = (shift * mlo) ** e
return root, shift
>>>>>>> a504e556e4f9731d65815eff327cc8f5dd654411
35 changes: 29 additions & 6 deletions hydra/garaga/hints/ecip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import functools
from dataclasses import dataclass

import garaga_rs

from garaga.algebra import Fp2, FunctionFelt, Polynomial, PyFelt, RationalFunction, T
from garaga.definitions import CURVES, CurveID, G1Point, G2Point, get_base_field
from garaga.hints.neg_3 import (
Expand Down Expand Up @@ -102,12 +104,33 @@ def zk_ecip_hint(
"""
assert len(Bs) == len(scalars)

dss = construct_digit_vectors(scalars)
Q, Ds = ecip_functions(Bs, dss)
dlogs = [dlog(D) for D in Ds]
sum_dlog = dlogs[0]
for i in range(1, len(dlogs)):
sum_dlog = sum_dlog + (-3) ** i * dlogs[i]
ec_group_class = get_ec_group_class_from_ec_point(Bs[0])
if ec_group_class == G1Point:
pts = []
c_id = Bs[0].curve_id
for pt in Bs:
pts.extend([pt.x, pt.y])
field_type = get_field_type_from_ec_point(Bs[0])
field = get_base_field(c_id.value, field_type)

q, a_num, a_den, b_num, b_den = garaga_rs.zk_ecip_hint(pts, scalars, c_id.value)
a_num = [field(int(f, 16)) for f in a_num]
a_den = [field(int(f, 16)) for f in a_den]
b_num = [field(int(f, 16)) for f in b_num]
b_den = [field(int(f, 16)) for f in b_den]

Q = G1Point(q[0], q[1], c_id)
sum_dlog = FunctionFelt(
RationalFunction(Polynomial(a_num), Polynomial(a_den)),
RationalFunction(Polynomial(b_num), Polynomial(b_den)),
)
else:
dss = construct_digit_vectors(scalars)
Q, Ds = ecip_functions(Bs, dss)
dlogs = [dlog(D) for D in Ds]
sum_dlog = dlogs[0]
for i in range(1, len(dlogs)):
sum_dlog = sum_dlog + (-3) ** i * dlogs[i]
return Q, sum_dlog


Expand Down
11 changes: 11 additions & 0 deletions hydra/garaga/hints/extf_mul.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
get_base_field,
get_irreducible_poly,
tower_to_direct,
get_base_field,
)
from garaga.hints.tower_backup import E6, get_tower_object

Expand Down Expand Up @@ -78,14 +79,24 @@ def nondeterministic_extension_field_div(


if __name__ == "__main__":
<<<<<<< HEAD
from hydra.definitions import (
BN254_ID,
BLS12_381_ID,
get_base_field,
CURVES,
=======
from random import randint as rint

from garaga.definitions import (
BLS12_381_ID,
BN254_ID,
get_base_field,
>>>>>>> a504e556e4f9731d65815eff327cc8f5dd654411
get_irreducible_poly,
)
from random import randint as rint
import random

field = get_base_field(BN254_ID)
p = field.p
Expand Down
2 changes: 1 addition & 1 deletion hydra/garaga/hints/frobenius.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ def test_frobenius_maps():
CURVES[1].p,
1,
get_irreducible_poly(1, 12),
)
)
2 changes: 1 addition & 1 deletion hydra/garaga/hints/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,4 @@ def _getattr(obj, attr):

def rsetattr(obj, attr, val):
pre, _, post = attr.rpartition(".")
return setattr(rgetattr(obj, pre) if pre else obj, post, val)
return setattr(rgetattr(obj, pre) if pre else obj, post, val)
2 changes: 1 addition & 1 deletion hydra/garaga/hints/multi_miller_witness.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,4 @@ def test_bn254():

for i in range(10):
test_bn254()
print(f"Test {i} passed")
print(f"Test {i} passed")
2 changes: 1 addition & 1 deletion hydra/garaga/hints/neg_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def sign(felt252: int) -> int:


if __name__ == "__main__":
print(positive_negative_multiplicities(neg_3_base_le(2**128)))
print(positive_negative_multiplicities(neg_3_base_le(2**128)))
2 changes: 1 addition & 1 deletion hydra/garaga/hints/tower_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,4 @@ def get_tower_object(x: list[PyFelt], curve_id: int, extension_degree: int):
elif extension_degree == 12:
return E12(x, curve_id)
else:
raise ValueError
raise ValueError
2 changes: 1 addition & 1 deletion hydra/garaga/modulo_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,4 +1135,4 @@ def summarize(self):
print(d)

circuit = ModuloCircuit("test_empty_circuit", curve_id=0, compilation_mode=1)
print(circuit.compile_circuit())
print(circuit.compile_circuit())
2 changes: 1 addition & 1 deletion hydra/garaga/modulo_circuit_structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,4 +926,4 @@ def __len__(self) -> int:
assert len(self.elmts) == 6
return 6
else:
return 6
return 6
2 changes: 1 addition & 1 deletion hydra/garaga/poseidon_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ def gen_cairo_test_vectors(n_elmts: int):

print(gen_cairo_test_vectors(1))
print(gen_cairo_test_vectors(2))
print(gen_cairo_test_vectors(3))
print(gen_cairo_test_vectors(3))
Loading
Loading