-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Feature] Implement snark.verify opcode
#3004
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
Changes from 32 commits
d08db67
9319273
ff65327
045775f
c3fab05
8ec4b19
528640e
24de8bc
0a0a274
6f14b8f
10ec834
8291d31
8ee686a
dce2aec
4da0200
b6335bd
6b20106
53066d9
435bec8
3e061d4
5d7c92b
8efc127
2a713e6
5ba49c7
c3f26a3
7f70852
e7272b2
9273488
d402b1b
0563439
44727d3
4046c49
d095b17
1bff6b6
fb5fec6
44c09de
1e437ee
8332ee3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
| // limitations under the License. | ||
|
|
||
| use super::*; | ||
| use snarkvm_circuit_types::U8; | ||
| use snarkvm_circuit_types::{U8, U32}; | ||
|
|
||
| impl<A: Aleo> ToBits for Future<A> { | ||
| type Boolean = Boolean<A>; | ||
|
|
@@ -39,7 +39,11 @@ impl<A: Aleo> ToBits for Future<A> { | |
| for argument in &self.arguments { | ||
| let argument_bits = argument.to_bits_le(); | ||
| // Write the size of the argument. | ||
| U16::constant(console::U16::new(argument_bits.len() as u16)).write_bits_le(vec); | ||
| let argument_length = argument_bits.len(); | ||
| match argument_length <= u16::MAX as usize { | ||
| true => U16::constant(console::U16::new(argument_length as u16)).write_bits_le(vec), | ||
| false => U32::constant(console::U32::new(argument_length as u32)).write_bits_le(vec), | ||
| } | ||
|
Comment on lines
+42
to
+46
Collaborator
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. @vicsn @d0cd This section in particular warrants a review. I only updated the bit serialization rather than byte serialization because we do not have The bit serialization is used in generating the field repr preimage of the hash. Had to do some custom muxxing, but should be safe in theory because these argument sizes need to be fixed.
Collaborator
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. Also, do we need to increase the limit for the
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. This seems safe indeed because argument sizes are fixed. Not sure I have context to answer whether the size of other types need to increase. Can you follow the requirements of a motivating unit test?
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. Increasing On a separate note, if we care about recovery of
Collaborator
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. I will be leaving Currently a |
||
| // Write the argument. | ||
| vec.extend_from_slice(&argument_bits); | ||
| } | ||
|
|
@@ -65,7 +69,11 @@ impl<A: Aleo> ToBits for Future<A> { | |
| for argument in &self.arguments { | ||
| let argument_bits = argument.to_bits_be(); | ||
| // Write the size of the argument. | ||
| U16::constant(console::U16::new(argument_bits.len() as u16)).write_bits_be(vec); | ||
| let argument_length = argument_bits.len(); | ||
| match argument_length <= u16::MAX as usize { | ||
| true => U16::constant(console::U16::new(argument_length as u16)).write_bits_be(vec), | ||
| false => U32::constant(console::U32::new(argument_length as u32)).write_bits_be(vec), | ||
| } | ||
| // Write the argument. | ||
| vec.extend_from_slice(&argument_bits); | ||
| } | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.