forked from zcash/halo2
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Plonky3 frontend adaptor (#306)
* feat: copy symbolic from Plonky3 * feat: copy fibo_air test from Plonky3 * feat: complete p3 frontend PoC * chore: clean up * chore: revert changes in middleware * fix: clippy warnings * feat: add keccak test and fixes - Bring back Rc instead of Box in SymbolicExpression so that expressions built with folding avoid many clones - Rewrite Expression doulbe as `e * 2` instead of `e + e` to avoid exponential cloning in expressions built with folding - When a constraint doesn't use a location, change it to use a selector for usable columns to avoid failing in poisoned rows * chore: clean up * fix: clippy warnings * chore: clean up tests * fix: clippy warnings * fix: remove debug print * chore: comment about transition constraints * chore: extend comment about PrimeField64 impl * fix: merge renamings * chore: add unit tests * fix: clippy complaints * chore: extend unit test * chore: replace no coverage directives * chore: remove no coverage directives * chore: apply feedback from @adria0 * fix: clippy warnings and PCS API update
- Loading branch information
Showing
22 changed files
with
1,801 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ members = [ | |
"halo2_frontend", | ||
"halo2_middleware", | ||
"halo2_backend", | ||
"p3_frontend", | ||
] | ||
resolver = "2" |
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 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 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 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,37 @@ | ||
[package] | ||
name = "p3_frontend" | ||
version = "0.3.0" | ||
authors = [ | ||
"Privacy Scaling Explorations team", | ||
] | ||
edition = "2021" | ||
description = """ | ||
Plonky3 frontend implementation. Allows using a circuit defined with the Air trait from plonky3 to be proved with a halo2 backend. | ||
""" | ||
license = "MIT OR Apache-2.0" | ||
categories = ["cryptography"] | ||
keywords = ["halo", "proofs", "zkp", "zkSNARKs", "plonky3"] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "katex-header.html"] | ||
|
||
[dependencies] | ||
p3-air = { git = "https://github.com/Plonky3/Plonky3", rev = "7b5b8a6" } | ||
p3-util = { git = "https://github.com/Plonky3/Plonky3", rev = "7b5b8a6" } | ||
p3-matrix = { git = "https://github.com/Plonky3/Plonky3", rev = "7b5b8a6" } | ||
p3-field = { git = "https://github.com/Plonky3/Plonky3", rev = "7b5b8a6" } | ||
p3-uni-stark = { git = "https://github.com/Plonky3/Plonky3", rev = "7b5b8a6" } | ||
halo2_middleware = { path = "../halo2_middleware" } | ||
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } | ||
num-bigint = { version = "0.4.3", default-features = false } | ||
|
||
[dev-dependencies] | ||
halo2curves = { version = "0.6.0", default-features = false } | ||
rand_core = { version = "0.6", default-features = false, features = ["getrandom"] } | ||
halo2_backend = { path = "../halo2_backend" } | ||
serde_test = { version = "1.0" } | ||
p3-keccak-air = { git = "https://github.com/Plonky3/Plonky3", rev = "7b5b8a6" } | ||
p3-keccak = { git = "https://github.com/Plonky3/Plonky3", rev = "7b5b8a6" } | ||
p3-util = { git = "https://github.com/Plonky3/Plonky3", rev = "7b5b8a6" } | ||
rand = "0.8.5" |
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,7 @@ | ||
//! Alternative `AirBuilderWithPublicValues` trait that uses `Self::Var` instead of `Self::F`. | ||
use p3_air::AirBuilder; | ||
|
||
pub trait AirBuilderWithPublicValues: AirBuilder { | ||
fn public_values(&self) -> &[Self::Var]; | ||
} |
Oops, something went wrong.