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

crypto.sha3: be big-endian friendly #24045

Merged
merged 1 commit into from
Mar 25, 2025
Merged

crypto.sha3: be big-endian friendly #24045

merged 1 commit into from
Mar 25, 2025

Conversation

tankf33der
Copy link
Contributor

And as a result of these change, the results of sha3 will be the same across all systems, including s390x.

Copy link

Connected to Huly®: V_0.6-22436

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Less code, with more platforms supported 🥳.

@spytheman spytheman merged commit f7f89b3 into vlang:master Mar 25, 2025
62 checks passed
@medvednikov
Copy link
Member

Can you please explain why this change works for big endian systems?

@spytheman
Copy link
Member

Because it always writes in the same order.

@spytheman
Copy link
Member

spytheman commented Mar 25, 2025

The methods that are fixed by the PR are to_bytes and from_bytes, i.e. they are serialization/unserialization related ones, and the needed swapping is already done in little_endian_put_u64_at.

@medvednikov
Copy link
Member

I see, thanks.

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.

3 participants