Skip to content

fix: requiring blake3 inputs to have less than 1024 bytes #14628

Merged
ludamad merged 14 commits intonextfrom
kb/blake3_1024_range_limit
Jun 6, 2025
Merged

fix: requiring blake3 inputs to have less than 1024 bytes #14628
ludamad merged 14 commits intonextfrom
kb/blake3_1024_range_limit

Conversation

@kashbrti
Copy link
Contributor

resolves #12517
also see: noir-lang/noir#8690

@suyash67
Copy link
Contributor

Maybe worth adding this assertion in barretenberg as well?

@kashbrti kashbrti requested a review from suyash67 June 3, 2025 13:31

template <typename Builder> byte_array<Builder> blake3s(const byte_array<Builder>& input)
{
ASSERT(input.size() <= 1024, "Barretenberg does not support blake3s with input lengths greater than 1024 bytes.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! Could you please also add tests that trigger this ASSERT for completeness? You probably need to use EXPECT_DEATH for such a test, see this test for example.


std::vector<uint8_t> blake3s(std::vector<uint8_t> const& input)
{
ASSERT(input.size() <= 1024, "Barretenberg does not support blake3s with input lengths greater than 1024 bytes.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test here as well that triggers this ASSERT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was actually not building. Since this is outside stdlib, I decided to change it to an error throw and catch it in the test.

pub global IPA_PROOF_LENGTH: u32 = 69;
pub global RECURSIVE_ROLLUP_HONK_PROOF_LENGTH: u32 = RECURSIVE_PROOF_LENGTH + IPA_CLAIM_SIZE + IPA_PROOF_LENGTH;
pub global RECURSIVE_ROLLUP_HONK_PROOF_LENGTH: u32 =
RECURSIVE_PROOF_LENGTH + IPA_CLAIM_SIZE + IPA_PROOF_LENGTH;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the formatter just made these changes

@kashbrti kashbrti enabled auto-merge June 6, 2025 13:53
@kashbrti kashbrti added this pull request to the merge queue Jun 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 6, 2025
@ludamad ludamad added this pull request to the merge queue Jun 6, 2025
Merged via the queue into next with commit 12be10e Jun 6, 2025
4 checks passed
@ludamad ludamad deleted the kb/blake3_1024_range_limit branch June 6, 2025 17:22
danielntmd pushed a commit to danielntmd/aztec-packages that referenced this pull request Jul 16, 2025
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.

ram_blowup_regression is generating invalid proofs which then fail to verify

3 participants