Skip to content

Commit

Permalink
Merge pull request #12 from qwang98/steve/jupyter-notebook-tutorial-p…
Browse files Browse the repository at this point in the history
…art-3

Steve/jupyter notebook tutorial part 3
  • Loading branch information
leolara authored Aug 8, 2023
2 parents 67016b7 + d27ed9f commit 0008f00
Show file tree
Hide file tree
Showing 13 changed files with 659 additions and 1,383 deletions.
11 changes: 4 additions & 7 deletions pychiquito/dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,12 @@ def gen_witness(self: Circuit, args: Any) -> TraceWitness:
def get_ast_json(self: Circuit) -> str:
return json.dumps(self.ast, cls=CustomEncoder, indent=4)

def ast_to_halo2(self: Circuit):
ast_json: str = self.get_ast_json()
self.rust_ast_id: int = rust_chiquito.ast_to_halo2(ast_json)

def verify_proof(self: Circuit, witness: TraceWitness):
def halo2_mock_prover(self: Circuit, witness: TraceWitness):
if self.rust_ast_id == 0:
self.ast_to_halo2()
ast_json: str = self.get_ast_json()
self.rust_ast_id: int = rust_chiquito.ast_to_halo2(ast_json)
witness_json: str = witness.get_witness_json()
rust_chiquito.verify_proof(witness_json, self.rust_ast_id)
rust_chiquito.halo2_mock_prover(witness_json, self.rust_ast_id)

def __str__(self: Circuit) -> str:
return self.ast.__str__()
Expand Down
3 changes: 1 addition & 2 deletions pychiquito/fibonacci.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@ def wg(self: FiboLastStep, values=Tuple[int, int]):

fibo = Fibonacci()
fibo_witness = fibo.gen_witness(None)
fibo.ast_to_halo2()
fibo.verify_proof(fibo_witness)
fibo.halo2_mock_prover(fibo_witness)
674 changes: 0 additions & 674 deletions pychiquito/tutorial.ipynb

This file was deleted.

44 changes: 0 additions & 44 deletions pychiquito/tutorial_ch1.ipynb

This file was deleted.

Loading

0 comments on commit 0008f00

Please sign in to comment.