forked from scroll-tech/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate gadgets from zkevm-circuits mod to it'w own crate (scroll-tec…
…h#457) * Migrate gadgets from zkevm-circuits mod to it'w own crate * add: Include `gadgets` as workspace member * update: Include `gadgets` into workflows config Resolves: scroll-tech#444
- Loading branch information
Showing
15 changed files
with
150 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "gadgets" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["The appliedzkp team"] | ||
|
||
[dependencies] | ||
ff = "0.11" | ||
halo2_proofs = { git = "https://github.com/appliedzkp/halo2.git", tag = "v2022_03_06" } | ||
pairing = { git = 'https://github.com/appliedzkp/pairing', package = "pairing_bn256" } | ||
sha3 = "0.7.2" | ||
eth-types = { path = "../eth-types" } | ||
digest = "0.7.6" | ||
|
||
[dev-dependencies] | ||
rand_xorshift = "0.3" | ||
rand = "0.8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//! # ZKEVM-Gadgets | ||
//! | ||
//! A collection of reusable gadgets for the zk_evm circuits. | ||
#![cfg_attr(docsrs, feature(doc_cfg))] | ||
// We want to have UPPERCASE idents sometimes. | ||
#![allow(clippy::upper_case_acronyms)] | ||
// Catch documentation errors caused by code changes. | ||
#![deny(rustdoc::broken_intra_doc_links)] | ||
#![deny(missing_docs)] | ||
#![deny(unsafe_code)] | ||
#![deny(clippy::debug_assert_with_mut_call)] | ||
|
||
pub mod evm_word; | ||
pub mod is_zero; | ||
pub mod monotone; | ||
|
||
use halo2_proofs::circuit::AssignedCell; | ||
use pairing::arithmetic::FieldExt; | ||
|
||
#[allow(dead_code)] | ||
/// An assigned cell in the circuit. | ||
#[derive(Clone, Debug)] | ||
pub struct Variable<T, F: FieldExt> { | ||
assig_cell: AssignedCell<F, F>, | ||
value: Option<T>, | ||
} | ||
|
||
impl<T, F: FieldExt> Variable<T, F> { | ||
pub(crate) fn new(assig_cell: AssignedCell<F, F>, value: Option<T>) -> Self { | ||
Self { assig_cell, value } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.