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/sha,crypto/sha256: consider dropping extension-less assembly implementations #71525

Closed
rolandshoemaker opened this issue Feb 1, 2025 · 3 comments
Labels
Implementation Issues describing a semantics-preserving change to the Go implementation. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Performance

Comments

@rolandshoemaker
Copy link
Member

We should consider dropping the SHA assembly implementations that are written in pure assembly that target processors lacking either AVX or SHA native instructions. These assembly cores are very large and rather complex, and create a rather large maintenance and testing burden.

The value of these cores is becoming more and more limited, as processors which lack the relevant extensions are becoming relatively rare. The last Intel processor generation that lacked AVX was Nehalem/Westlake, which was succeeded by Sandy Bridge in 2011, and the last AMD processor generation that lacked AVX was Phenom, succeeded by Bulldozer in 2011.

Removing these cores would represent a win in terms of reducing the amount of assembly that needs to be maintained. We should weigh the trade-off here of making SHA operations slower on >14 year old processors.

cc @golang/security @FiloSottile

@rolandshoemaker rolandshoemaker added Performance NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Feb 1, 2025
@gabyhelp
Copy link

gabyhelp commented Feb 1, 2025

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@gabyhelp gabyhelp added the Implementation Issues describing a semantics-preserving change to the Go implementation. label Feb 1, 2025
@FiloSottile
Copy link
Contributor

Duplicate of #69587?

@rolandshoemaker
Copy link
Member Author

Hah yes, the inability of GitHub issue search to actually find things strikes again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation Issues describing a semantics-preserving change to the Go implementation. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Performance
Projects
None yet
Development

No branches or pull requests

3 participants