Skip to content

Conversation

@Coralesoft
Copy link

I saw the feature request and had some time, so I've added BLAKE3 support.

What's included:

  • Full implementation of BLAKE3 hash function
  • Standard hashing (default 32-byte output)
  • Keyed hashing (MAC mode with 32-byte keys)
  • Key derivation function (KDF mode with context strings)
  • Variable-length output (1-1024 bytes) via extended output function (XOF)
  • Merkle tree construction for efficient streaming
  • Integration with the existing test suite

Testing:
I've verified the implementation against all official BLAKE3 test vectors
from the reference implementation:

  • 1024-byte input (1 chunk)
  • 2048-byte input (2 chunks, tree merging)
  • 4096-byte input (4 chunks, full tree)
  • Extended output (64-byte XOF)
  • Empty string, short messages, keyed hashing

All test vectors passed.

Implementation notes:

  • Based on the official specification at https://github.com/BLAKE3-team/BLAKE3-specs
  • Uses ChaCha20-based compression function
  • Implements lazy Merkle tree construction for streaming efficiency
  • 1024-byte chunks with 64-byte blocks
  • Fully integrated with cryptest.exe validation suite

Let me know if you'd like me to make any changes or if you have questions.

Thanks

Resolves #1313

- Implement BLAKE3 hash with 32-byte default output
- Support keyed hashing (MAC mode) and key derivation (KDF mode)
- Add variable-length output (XOF) support
- Implement tree hashing with Merkle structure for parallelization
- Add official test vectors from BLAKE3 team reference implementation
- Integrate with existing test suite (test.cpp case 88)
- All test vectors verified against official BLAKE3 specification
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.

[feature request] Please provide support for BLAKE3.

1 participant