Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
GideonWhite1029 wants to merge 21 commits into Winds-Studio:ver/1.21.8
base: ver/1.21.8
Choose a base branch
Loading
from GideonWhite1029:ver/1.21.8

Conversation

@GideonWhite1029
Copy link

@GideonWhite1029 GideonWhite1029 commented Jul 21, 2025

@Taiyou06 Taiyou06 requested a review from HaHaWTH July 21, 2025 18:59
@Taiyou06 Taiyou06 added the type: general Pull request for general updates / changes label Jul 21, 2025
Copy link
Member

HaHaWTH commented Jul 22, 2025

Is there any performance benchmark for this BLAKE3 implementation comparing to previous BLAKE2b?

@Taiyou06 Taiyou06 added the status: pending Pending for some reasons and may implement in the future with lower priority label Jul 25, 2025
Copy link
Member

@HaHaWTH HaHaWTH left a 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

Copy link
Author

изображение изображение изображение изображение

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.

private final long[] message = new long[16];
private final long[] cachedInternalState = new long[16];

private static long[] hashingWorldSeed(long[] seed) {
Copy link
Member

@Dreeam-qwq Dreeam-qwq Aug 15, 2025
edited
Loading

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.

Copy link
Member

@HaHaWTH HaHaWTH left a 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.

- 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
Copy link
Author

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@HaHaWTH HaHaWTH HaHaWTH left review comments

@Dreeam-qwq Dreeam-qwq Awaiting requested review from Dreeam-qwq

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

status: pending Pending for some reasons and may implement in the future with lower priority type: general Pull request for general updates / changes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /