-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start to rearrange code to concentrate under api. * More moving. * More renaming. * Push more stuff through the api. * Ditto. * Remove backups accidently committed. * Start to reorganize. * More work on new abstractions. * Yet more. * More generics. * Finish converting key. * Various fixes to bounds. * Revert circuit. * Revert key. * Revert mod, partially. * Finish most of the conversion. * Format. * Finish conversion. * Significant cleanup. * Getting there. * Closer. * Mostly clippy. * More clippy. * Pass Jolt interfaces through the API as well. * Improve misuse resistance. * Minor. * Format. * Restore independent config crate. * Clippy. * Format again. * Remove tools-dev accidently restored. * Post-rebase cleanup. * Push RPC through API. * Formatting. * Fix reversion of config. * Further cleanup. * Cleanup cargo. * Fix rpc building. * Formatting. * Adapt to removal of tools-dev. * Fix imports. * Move to purer reexport model for Jolt. * Formatting. * Fix rebasing mistake. * Remove unnecessary imports. * Add feature gating. * Formatting. * Remove unnecessary imports.
- Loading branch information
Showing
41 changed files
with
810 additions
and
1,039 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
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.