Skip to content
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

Merged
merged 14 commits into from
Oct 31, 2023
Merged

Conversation

tamirhemo
Copy link
Contributor

No description provided.

@tamirhemo tamirhemo marked this pull request as ready for review October 31, 2023 22:30
@@ -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> {
Copy link
Member

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.

Comment on lines 256 to 258
#[test]
#[cfg_attr(feature = "ci", ignore)]
fn test_sha_padding_variable() {}
Copy link
Member

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
Copy link
Member

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)`.
Copy link
Member

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?

Copy link
Member

@ratankaliani ratankaliani left a 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!

@tamirhemo tamirhemo merged commit 5b85909 into main Oct 31, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants