-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix: sha padding asserts and other bug fixes #268
Conversation
@@ -6,6 +6,7 @@ use super::digest_hint::SHADigestHint; | |||
use super::proof_hint::SHAProofHint; | |||
use super::request::SHARequest; | |||
use super::SHA; | |||
use crate::frontend::hint::synchronous::Async; | |||
use crate::prelude::*; | |||
|
|||
impl<L: PlonkParameters<D>, const D: usize> CircuitBuilder<L, D> { |
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.
nit: Add function description as a doc comment.
#[test] | ||
#[cfg_attr(feature = "ci", ignore)] | ||
fn test_sha_padding_variable() {} |
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.
nit: remove this test
bits.push(self.api._true()); | ||
|
||
let l = bits.len() - 1; | ||
let k = 512 - (l + 1 + 64) % 512; // number of padding bits you need |
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.
nit: Comment should be on top of this line, and should not use "you"
#[derive(Debug, Clone)] | ||
pub enum SHARequest { | ||
/// A message of fixed length. | ||
Fixed(Vec<ByteVariable>), | ||
/// A message of variable length, with the actual legnth given by the Variable. | ||
/// A message of variable length, represented by a tuple `(total_message, lengh, chunk_index)`. |
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.
last_chunk
is used elsewhere in the codebase, is there a reason why chunk_index
is used here?
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.
some small nits, but otherwise lgtm!
No description provided.