Skip to content
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

Ensure blake3 inputs are immutable #51

Merged
merged 2 commits into from Apr 27, 2023
Merged

Ensure blake3 inputs are immutable #51

merged 2 commits into from Apr 27, 2023

Conversation

libitx
Copy link
Contributor

@libitx libitx commented Apr 26, 2023

Fixes #50

  • ensures the blake3 IV is copied, not referenced
  • adds tests ensuring inputs are immutable for all the blake family hashing functions

As discussed in #50, I tried to spot if this issue is anywhere else. Looking where toBytes is used doesn't really help as a) it's used all over the place, and b) it doesn't reveal if elsewhere in the code a referenced input is mutated.

Best thing is to add similar tests as I've done for every hash function. But that's a job for a rainy day ;)

@paulmillr
Copy link
Owner

please run npm run format

@libitx
Copy link
Contributor Author

libitx commented Apr 27, 2023

formatting is done 👍

@paulmillr paulmillr merged commit 15d067e into paulmillr:main Apr 27, 2023
1 check passed
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.

blake3 keyed hash blanks out the key uint8array
2 participants