Skip to content

BLAKE3 finalizeChunk circuit#255

Merged
pirapira merged 71 commits intomainfrom
blake3-finalize-chunk
Sep 4, 2025
Merged

BLAKE3 finalizeChunk circuit#255
pirapira merged 71 commits intomainfrom
blake3-finalize-chunk

Conversation

@pirapira
Copy link
Collaborator

@pirapira pirapira commented Aug 12, 2025

This PR implements and verifies a circuit for finalizeChunk function in the BLAKE3 spec.

This is a part of #250.

pirapira added 30 commits August 7, 2025 11:53
The block_buffer can hold a full block (64 bytes) when splitIntoBlockWords
keeps exactly 64 bytes as remainder instead of processing them.
- Add ByteOrTable lookup table for byte-wise OR verification
- Implement Or32 circuit following the same pattern as Xor32
- Add or_mul_two_pow and or_sum lemmas to Bitwise.lean
- Prove soundness and completeness theorems for Or32

The Or32 gadget will be used in BLAKE3's finalizeChunk for combining flags.
- Add spaces before colons in type annotations (x : Type)
- Remove spaces in polynomial multiplication (x*256 not x * 256)
- Remove spaces in angle brackets destructuring patterns
@pirapira pirapira marked this pull request as draft September 1, 2025 10:56
@pirapira pirapira marked this pull request as ready for review September 1, 2025 17:21
Copy link
Collaborator

@mitschabaude mitschabaude left a comment

Choose a reason for hiding this comment

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

💪🏻

just a few comments

@pirapira pirapira merged commit 62eb4ed into main Sep 4, 2025
1 check passed
@pirapira pirapira deleted the blake3-finalize-chunk branch September 4, 2025 16:41
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