Skip to content

Add BLAKE3 support#199

Open
aumetra wants to merge 4 commits intomcginty:mainfrom
aumetra:feat/blake3
Open

Add BLAKE3 support#199
aumetra wants to merge 4 commits intomcginty:mainfrom
aumetra:feat/blake3

Conversation

@aumetra
Copy link

@aumetra aumetra commented Sep 22, 2025

Closes #173

This PR adds support for using the BLAKE3 hash function as part of a Noise connection.
Unfortunately I'm not sure if there are any test vectors for it available.

But yeah, this adds a new hash state enum variant for BLAKE3 and adds support for it to the default provider.

@aumetra
Copy link
Author

aumetra commented Sep 22, 2025

(sorry for the reformatting btw, VSCode config doing stupid stuff. I can revert it if wanted)

@mcginty
Copy link
Owner

mcginty commented Sep 22, 2025

Hey @aumetra thanks for the PR, and I'm interested in getting this into snow!

@aumetra aumetra requested a review from mcginty September 26, 2025 15:42
Comment on lines +596 to +606
fn name(&self) -> &'static str {
"BLAKE3"
}

fn block_len(&self) -> usize {
blake3::BLOCK_LEN
}

fn hash_len(&self) -> usize {
blake3::OUT_LEN
}
Copy link

Choose a reason for hiding this comment

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

Would be nice to change these to trait constants once breaking changes are made in the library:

Suggested change
fn name(&self) -> &'static str {
"BLAKE3"
}
fn block_len(&self) -> usize {
blake3::BLOCK_LEN
}
fn hash_len(&self) -> usize {
blake3::OUT_LEN
}
const NAME: &'static str = "BLAKE3";
const BLOCK_LEN: usize = blake3::BLOCK_LEN;
const HASH_LEN: usize = blake3::OUT_LEN;

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.

hope support BLAKE3

3 participants