-
-
Notifications
You must be signed in to change notification settings - Fork 116
Updating Blake2 hash function to Blake3 #414
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
Updating Blake2 hash function to Blake3 #414
Conversation
Update hash function from Blake2 to Blake3
Is there any performance benchmark for this BLAKE3 implementation comparing to previous BLAKE2b?
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.
Generally good, but need some benchmarks to make sure it's faster than original blake2b impl. Leave the old implementation as a compatibility option is better i assume
There are places in the current Blake3 implementation that need to be optimized, and at the moment Blake2b will be faster compared to Blake3. Alternatively, you can leave both variations of the hash function and select the version through the configuration file.
- The execution time decreased from 1.822 ms to 757 ms - Precomputed permutations have been added to compress()
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.
Should we move hashing algo type to config, and use interface-impl for 2b and 3?
cc @HaHaWTH
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
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.
Will run some performance benchmarks and validations later
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
- The execution time decreased from 757 ms to 550 ms - Changed logic of the type of hashing in WorldgenCryptoRandom
- Added hashing for structures: MineshaftStructure, OceanMonumentStructure, RuinedPortalStructure - Small fix Balke3
@Dreeam-qwq Consider the current changes in the implementation of Blake3, as well as evaluate the purity of the code?
Update hash function from Blake2 to Blake3
- The execution time decreased from 1.822 ms to 757 ms - Precomputed permutations have been added to compress()
- The execution time decreased from 757 ms to 550 ms - Changed logic of the type of hashing in WorldgenCryptoRandom
- Added hashing for structures: MineshaftStructure, OceanMonumentStructure, RuinedPortalStructure - Small fix Balke3
# Conflicts: # leaf-server/minecraft-patches/features/0132-Faster-random-generator.patch
The code from this repository was used for the reference: https://github.com/bcgit/bc-java/blob/main/core/src/main/java/org/bouncycastle/crypto/digests/Blake3Digest.java