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

Commit

Permalink
fmt and upload pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
qwang98 committed Sep 14, 2023
1 parent c5334fb commit 2c6188c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
Expand Down
4 changes: 4 additions & 0 deletions examples/mimc7.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions src/frontend/python/chiquito/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def __json__(self: F):
]
return ints


class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if hasattr(obj, "__json__"):
Expand Down
5 changes: 1 addition & 4 deletions src/frontend/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 2c6188c

Please sign in to comment.