-
Notifications
You must be signed in to change notification settings - Fork 241
Enabling Nova to be used in no_std environments
#376
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
base: main
Are you sure you want to change the base?
Changes from all commits
aca9049
42e7341
9486641
3aaff41
04ee879
0628d50
b7782a0
3cb4f0f
670a842
96fb896
4aa9ebd
c81aecb
c49fa4f
577e8d5
30ddc84
bff6b4d
31b310c
13448ee
b51c4cb
46866bf
58b6783
db76abf
ec35376
84059a1
90679f9
5804c19
339994b
b108ab8
6a91fba
e87ed1d
5b26ac4
6d4c959
ae8a034
27a4de4
b45a5db
402073b
3514046
72b4521
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| //! This example executes a batch of 64-bit AND operations. | ||
| //! It performs the AND operation by first decomposing the operands into bits and then performing the operation bit-by-bit. | ||
| //! We execute a configurable number of AND operations per step of Nova's recursion. | ||
| use bincode::config::legacy; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there an alternative to this? May be I'm misunderstanding this. Are we at the risk of this getting deprecated soon?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, there is no risk of getting deprecated. /// The default config for bincode 2.0. By default this will be:
/// - Little endian
/// - Variable int encoding
pub const fn standard() -> Configuration {
generate()
}
/// Creates the "legacy" default config. This is the default config that was present in bincode 1.0
/// - Little endian
/// - Fixed int length encoding
pub const fn legacy() -> Configuration<LittleEndian, Fixint, NoLimit> {
generate()
}
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the clarification! I'm not sure there's benefit from being backward compatible with a previous version of Nova. If we are updating to bincode 2.0, I think it makes sense to have the bincode 2.0 format.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is possible to have standard config too, it will require some additional changes in tests too, but it should be feasible. Let me know which one you prefer |
||
| use core::marker::PhantomData; | ||
| use ff::{Field, PrimeField, PrimeFieldBits}; | ||
| use flate2::{write::ZlibEncoder, Compression}; | ||
| use nova_snark::{ | ||
| frontend::{ | ||
| num::AllocatedNum, AllocatedBit, ConstraintSystem, LinearCombination, SynthesisError, | ||
|
|
@@ -286,9 +286,8 @@ fn main() { | |
| assert!(res.is_ok()); | ||
| let compressed_snark = res.unwrap(); | ||
|
|
||
| let mut encoder = ZlibEncoder::new(Vec::new(), Compression::default()); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like we are removing flate2 compression. Is there a reason?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, due to the changes in If we use |
||
| bincode::serialize_into(&mut encoder, &compressed_snark).unwrap(); | ||
| let compressed_snark_encoded = encoder.finish().unwrap(); | ||
| let compressed_snark_encoded = | ||
| bincode::serde::encode_to_vec(&compressed_snark, legacy()).unwrap(); | ||
| println!( | ||
| "CompressedSNARK::len {:?} bytes", | ||
| compressed_snark_encoded.len() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.