-
Notifications
You must be signed in to change notification settings - Fork 382
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
Move Towards Generic API #170
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
58ae580
Start to rearrange code to concentrate under api.
sjudson f2b72f4
More moving.
sjudson 0fdb20b
More renaming.
sjudson 027403b
Push more stuff through the api.
sjudson ed738ef
Ditto.
sjudson 0727d51
Remove backups accidently committed.
sjudson 8b6556e
Start to reorganize.
sjudson 3d831f3
More work on new abstractions.
sjudson b311d02
Yet more.
sjudson f37e9b5
More generics.
sjudson 565c127
Finish converting key.
sjudson 724c4ec
Various fixes to bounds.
sjudson 7abe4db
Revert circuit.
sjudson a098ae6
Revert key.
sjudson cbe79c8
Revert mod, partially.
sjudson 94268d5
Finish most of the conversion.
sjudson 767d547
Format.
sjudson 38e9ef7
Finish conversion.
sjudson 8d5ed5c
Significant cleanup.
sjudson d56dc70
Getting there.
sjudson 76de249
Closer.
sjudson b8693bd
Mostly clippy.
sjudson 1d186a8
More clippy.
sjudson 8ed3702
Pass Jolt interfaces through the API as well.
sjudson d4e1fe3
Improve misuse resistance.
sjudson 9922deb
Minor.
sjudson 29bd92d
Format.
sjudson 49dad42
Restore independent config crate.
sjudson f621dd5
Clippy.
sjudson 447773a
Format again.
sjudson 2bcb1f7
Remove tools-dev accidently restored.
sjudson 06ac774
Post-rebase cleanup.
sjudson 7044e03
Push RPC through API.
sjudson 8d5ca3c
Formatting.
sjudson 6973670
Fix reversion of config.
sjudson 5b02f25
Further cleanup.
sjudson 1260ad3
Cleanup cargo.
sjudson a27bb31
Fix rpc building.
sjudson a17df18
Formatting.
sjudson 64050fe
Adapt to removal of tools-dev.
sjudson f76193f
Fix imports.
sjudson 709edf8
Move to purer reexport model for Jolt.
sjudson 2eaf91b
Formatting.
sjudson 045f9d3
Fix rebasing mistake.
sjudson 4cb619a
Remove unnecessary imports.
sjudson fde39c0
Add feature gating.
sjudson 577798d
Formatting.
sjudson a52fd62
Remove unnecessary imports.
sjudson 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 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,3 @@ | ||
pub use nexus_jolt::{parse, preprocess, prove, trace, verify, VM}; | ||
|
||
pub mod types; |
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,3 @@ | ||
//! Default types and traits for use by zkVM + Jolt pipeline | ||
|
||
pub use nexus_jolt::{JoltCommitments, JoltPreprocessing, JoltProof, F, PCS}; |
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,4 @@ | ||
#[cfg(feature = "prover_jolt")] | ||
pub mod jolt; | ||
#[cfg(feature = "prover_nova")] | ||
pub mod nova; |
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
File renamed without changes.
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,52 @@ | ||
use std::fs::File; | ||
use zstd::stream::{Decoder, Encoder}; | ||
|
||
pub use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; | ||
use nexus_nova::nova::pcd::compression::SNARK; | ||
|
||
use super::error::*; | ||
use super::types::*; | ||
use super::LOG_TARGET; | ||
|
||
pub fn gen_key(pp: &ComPP, srs: &SRS) -> Result<SpartanKey, ProofError> { | ||
tracing::info!( | ||
target: LOG_TARGET, | ||
"Generating Spartan key parameters", | ||
); | ||
|
||
let key = SNARK::setup(pp, srs)?; | ||
Ok(key) | ||
} | ||
|
||
pub fn save_key(key: SpartanKey, file: &str) -> Result<(), ProofError> { | ||
tracing::info!( | ||
target: LOG_TARGET, | ||
pp_file =?file, | ||
"Saving Spartan key parameters", | ||
); | ||
|
||
let f = File::create(file)?; | ||
let mut enc = Encoder::new(&f, 0)?; | ||
key.serialize_compressed(&mut enc)?; | ||
enc.finish()?; | ||
f.sync_all()?; | ||
Ok(()) | ||
} | ||
|
||
pub fn load_key(file: &str) -> Result<SpartanKey, ProofError> { | ||
tracing::info!( | ||
target: LOG_TARGET, | ||
pp_file =?file, | ||
"Loading Spartan key parameters", | ||
); | ||
|
||
let f = File::open(file)?; | ||
let mut dec = Decoder::new(&f)?; | ||
let key = SpartanKey::deserialize_compressed_unchecked(&mut dec)?; | ||
Ok(key) | ||
} | ||
|
||
pub fn gen_key_to_file(pp: &ComPP, srs: &SRS, key_file: &str) -> Result<(), ProofError> { | ||
let key: SpartanKey = gen_key(pp, srs)?; | ||
save_key(key, key_file) | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file needs a cleanup, e.g. I don't think it should depend on
tui
and haveverbose
feature anymore