diff --git a/Cargo.toml b/Cargo.toml index 93a7915f..9ed7a0e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chiquito" -version = "0.1.2023091000" +version = "0.1.2023091300" edition = "2021" license = "MIT OR Apache-2.0" authors = ["Leo Lara "] diff --git a/examples/mimc7.py b/examples/mimc7.py index 73972ec9..1fca6613 100644 --- a/examples/mimc7.py +++ b/examples/mimc7.py @@ -7,6 +7,7 @@ ROUNDS = 91 + # It's the best practice to wrap all values in F, even though the `assign` functions automatically wrap values in F. class Mimc7Constants(Circuit): def setup(self): @@ -20,6 +21,7 @@ def fixed_gen(self): self.assign(i, self.lookup_row, F(i)) self.assign(i, self.lookup_c, F(round_key)) + class Mimc7Circuit(Circuit): def setup(self): self.x = self.forward("x") @@ -58,6 +60,7 @@ def trace(self, args): self.add(self.mimc7_last_step, (x_value, k_value, c_value, row_value)) + class Mimc7FirstStep(StepType): def setup(self): self.xkc = self.internal("xkc") @@ -150,6 +153,7 @@ def wg(self, args): self.assign(self.circuit.row, F(row_value)) self.assign(self.out, F(x_value + k_value)) + class Mimc7SuperCircuit(SuperCircuit): def setup(self): self.mimc7_constants = self.sub_circuit(Mimc7Constants(self, imports=None)) diff --git a/src/frontend/python/chiquito/util.py b/src/frontend/python/chiquito/util.py index 15982aaa..0533fd6f 100644 --- a/src/frontend/python/chiquito/util.py +++ b/src/frontend/python/chiquito/util.py @@ -20,6 +20,7 @@ def __json__(self: F): ] return ints + class CustomEncoder(json.JSONEncoder): def default(self, obj): if hasattr(obj, "__json__"): diff --git a/src/frontend/python/mod.rs b/src/frontend/python/mod.rs index 2fa29e41..af9106b3 100644 --- a/src/frontend/python/mod.rs +++ b/src/frontend/python/mod.rs @@ -19,10 +19,7 @@ use crate::{ cell_manager::SingleRowCellManager, compile, config, step_selector::SimpleStepSelectorBuilder, }, - ir::{ - assignments::AssignmentGenerator, - sc::MappingContext, - }, + ir::{assignments::AssignmentGenerator, sc::MappingContext}, }, util::{uuid, UUID}, wit_gen::{StepInstance, TraceContext, TraceWitness},