-
Notifications
You must be signed in to change notification settings - Fork 396
feat: integrate circom verifier #1987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
4e98e1e
feat(batcher): integrate circom verifier [not compiling yet]
JuArce 5d4a24a
feat(batcher): integrate circom verifier [not compiling yet part 2]
JuArce 60b70fd
Fix build
MauroToscano 85e8eac
do not run mod tidy
JuArce ab6e68b
Fix build 2
MauroToscano 393102e
Change the go get on batcher's builder to the last circom version
maximopalopoli 57d8195
Update go mod and go sum files
maximopalopoli 21c308d
refactor: use a single ffi for gnark and circom verifiers
JuArce b9cbefe
feat: integrate circom verifier in operator
JuArce 0761b8b
feat: add scripts to generate and send circom proofs
JuArce c9fedd0
docs: add circom verifier
JuArce d8fb28d
fix: cargo fmt
JuArce 894f68d
ci: send proofs on e2e test
JuArce ec9c38a
fix: cargo clippy
JuArce 33dff02
fix: batcher docker path
JuArce 7fadb30
test: update test_some_verifiers_disabled
JuArce f7f7307
ci: update check proofs verified
JuArce 4d3350f
fix: remove ceremony files
JuArce ab166e8
chore: update gitignore
JuArce d434ade
fix: use log.Printf
JuArce ab25058
refactor: separate ffis from code
JuArce 780354f
fix: add missing new lines
JuArce f440424
fix: cargo fmt
JuArce 3c017b2
fix(ci): paths to libraries
JuArce f354ae1
Merge branch 'refs/heads/staging' into 1986-feat-integrate-circom-ver…
JuArce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| pub mod verifier; |
This file contains hidden or 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,54 @@ | ||
| use aligned_sdk::common::types::ProvingSystemId; | ||
|
|
||
| #[derive(Copy, Clone, Debug)] | ||
| #[repr(C)] | ||
| pub struct ListRef { | ||
| data: *const u8, | ||
| len: usize, | ||
| } | ||
|
|
||
| impl From<Vec<u8>> for ListRef { | ||
| fn from(v: Vec<u8>) -> Self { | ||
| Self::from(v.as_slice()) | ||
| } | ||
| } | ||
|
|
||
| impl From<&Vec<u8>> for ListRef { | ||
| fn from(v: &Vec<u8>) -> Self { | ||
| Self::from(v.as_slice()) | ||
| } | ||
| } | ||
|
|
||
| impl From<&[u8]> for ListRef { | ||
| fn from(v: &[u8]) -> Self { | ||
| let len = v.len(); | ||
| let data = v.as_ptr().cast(); | ||
| ListRef { data, len } | ||
| } | ||
| } | ||
|
|
||
| pub fn verify_circom( | ||
| proving_system: &ProvingSystemId, | ||
| proof: &Vec<u8>, | ||
| public_input: &Vec<u8>, | ||
| verification_key: &Vec<u8>, | ||
| ) -> bool { | ||
| let proof = proof.into(); | ||
| let public_input = public_input.into(); | ||
| let verification_key = verification_key.into(); | ||
|
|
||
| match proving_system { | ||
| ProvingSystemId::CircomGroth16Bn128 => unsafe { | ||
| VerifyCircomGroth16ProofBN128(proof, public_input, verification_key) | ||
| }, | ||
| _ => false, | ||
| } | ||
| } | ||
|
|
||
| extern "C" { | ||
| pub fn VerifyCircomGroth16ProofBN128( | ||
| proof: ListRef, | ||
| public_input: ListRef, | ||
| verification_key: ListRef, | ||
| ) -> bool; | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.