Skip to content

Commit

Permalink
Rewrite.
Browse files Browse the repository at this point in the history
  • Loading branch information
feltroidprime committed Dec 12, 2024
1 parent d17429b commit f9babde
Show file tree
Hide file tree
Showing 5 changed files with 63,357 additions and 64,280 deletions.
2 changes: 1 addition & 1 deletion precompiled_circuits/all_circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def main(
"""Compiles and writes all circuits to separate .cairo files"""

# Write the header to each file
HEADER = compilation_mode_to_file_header(compilation_mode)
HEADER = compilation_mode_to_file_header(compilation_mode, None)

# Dictionary to store compiled circuits and selectors for each filename
compiled_files = {}
Expand Down
17 changes: 6 additions & 11 deletions precompiled_circuits/compilable_circuits/fustat_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def __init__(
) -> None:
super().__init__(
name="derive_point_from_x",
input_len=3, # X + b + G
curve_id=curve_id,
auto_run=auto_run,
compilation_mode=compilation_mode,
Expand Down Expand Up @@ -58,12 +57,10 @@ def __init__(
init_hash: int = None,
compilation_mode: int = 0,
):
super().__init__(
"fp12_mul", 24, curve_id, auto_run, init_hash, compilation_mode
)
super().__init__("fp12_mul", curve_id, auto_run, init_hash, compilation_mode)

def build_input(self) -> list[PyFelt]:
return [self.field(randint(0, self.field.p - 1)) for _ in range(self.input_len)]
return [self.field(randint(0, self.field.p - 1)) for _ in range(24)]

def _run_circuit_inner(self, input: list[PyFelt]) -> ExtensionFieldModuloCircuit:
circuit = ExtensionFieldModuloCircuit(
Expand Down Expand Up @@ -91,11 +88,11 @@ def __init__(
compilation_mode: int = 0,
):
super().__init__(
"final_exp_part_1", 12, curve_id, auto_run, init_hash, compilation_mode
"final_exp_part_1", curve_id, auto_run, init_hash, compilation_mode
)

def build_input(self) -> list[PyFelt]:
return [self.field(randint(0, self.field.p - 1)) for _ in range(self.input_len)]
return [self.field(randint(0, self.field.p - 1)) for _ in range(12)]

def _run_circuit_inner(self, input: list[PyFelt]) -> ExtensionFieldModuloCircuit:
circuit: final_exp.FinalExpTorusCircuit = final_exp.GaragaFinalExp[
Expand Down Expand Up @@ -123,11 +120,11 @@ def __init__(
compilation_mode: int = 0,
):
super().__init__(
"final_exp_part_2", 12, curve_id, auto_run, init_hash, compilation_mode
"final_exp_part_2", curve_id, auto_run, init_hash, compilation_mode
)

def build_input(self) -> list[PyFelt]:
return [self.field(randint(0, self.field.p - 1)) for _ in range(self.input_len)]
return [self.field(randint(0, self.field.p - 1)) for _ in range(12)]

def _run_circuit_inner(self, input: list[PyFelt]) -> ExtensionFieldModuloCircuit:
circuit: final_exp.FinalExpTorusCircuit = final_exp.GaragaFinalExp[
Expand All @@ -150,7 +147,6 @@ def __init__(
self.n_pairs = n_pairs
super().__init__(
f"multi_miller_loop_{n_pairs}",
6 * n_pairs,
curve_id,
auto_run,
compilation_mode,
Expand Down Expand Up @@ -200,7 +196,6 @@ def __init__(
self.n_pairs = n_pairs
super().__init__(
f"multi_pairing_check_{n_pairs}",
6 * n_pairs,
curve_id,
auto_run,
compilation_mode,
Expand Down
Loading

0 comments on commit f9babde

Please sign in to comment.