-
Notifications
You must be signed in to change notification settings - Fork 598
fix: requiring blake3 inputs to have less than 1024 bytes #14628
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 all commits
776b9d1
4aea203
f6d0509
584efa2
c88ad04
56e869a
78e4083
9f2d524
d5fce38
41bd5fa
845d91a
0f5a206
9f0a87b
ff8399f
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 +1 @@ | ||
| barretenberg_module(crypto_blake3s) | ||
| barretenberg_module(crypto_blake3s common) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,6 +246,8 @@ using namespace blake3_internal; | |
|
|
||
| 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."); | ||
|
Contributor
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. nice! Could you please also add tests that trigger this ASSERT for completeness? You probably need to use |
||
|
|
||
| if constexpr (HasPlookup<Builder>) { | ||
| return blake3s_plookup::blake3s<Builder>(input); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| // Constants for UltraHonk recursive verifier inputs | ||
| pub global PROOF_TYPE_HONK: u32 = 1; // identifier for UltraHonk verfier | ||
| pub global RECURSIVE_PROOF_LENGTH: u32 = 456; | ||
| pub global RECURSIVE_PROOF_LENGTH: u32 = 456; | ||
| pub global HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS: u32 = 112; | ||
|
|
||
| pub type UltraHonkProof = [Field; RECURSIVE_PROOF_LENGTH]; | ||
|
|
@@ -10,7 +10,8 @@ pub type UltraHonkVerificationKey = [Field; HONK_VERIFICATION_KEY_LENGTH_IN_FIEL | |
| pub global PROOF_TYPE_ROLLUP_HONK: u32 = 5; // identifier for rollup-UltraHonk verfier | ||
| pub global IPA_CLAIM_SIZE: u32 = 10; | ||
| 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; | ||
|
Contributor
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. the formatter just made these changes |
||
| pub global ROLLUP_HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS: u32 = 113; | ||
|
|
||
| pub type RollupHonkProof = [Field; RECURSIVE_ROLLUP_HONK_PROOF_LENGTH]; | ||
|
|
||
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.
Can you add a test here as well that triggers this ASSERT?
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.
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.