-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
base: ver/1.21.8
Are you sure you want to change the base?
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? |
HaHaWTH
left a comment
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
- The execution time decreased from 1.822 ms to 757 ms - Precomputed permutations have been added to compress()
| private final long[] message = new long[16]; | ||
| private final long[] cachedInternalState = new long[16]; | ||
|
|
||
| private static long[] hashingWorldSeed(long[] seed) { |
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.
HaHaWTH
left a comment
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
| private final long[] message = new long[16]; | ||
| private final long[] cachedInternalState = new long[16]; | ||
|
|
||
| private static long[] hashingWorldSeed(long[] seed) { |
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
- Using SIMD instructions - Each round is deployed to speed up hashing - Execution time decreased from 550 ms to 340 ms




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