Updating Blake2 hash function to Blake3#414
Updating Blake2 hash function to Blake3#414GideonWhite1029 wants to merge 26 commits intoWinds-Studio:ver/1.21.8from
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.
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.
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.
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