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

Simplify hash implementation #237

Merged
merged 3 commits into from
Dec 20, 2024
Merged

Simplify hash implementation #237

merged 3 commits into from
Dec 20, 2024

Conversation

qmuntal
Copy link
Collaborator

@qmuntal qmuntal commented Dec 20, 2024

We have too many almost-duplicated types and functions related to hash objects, which makes it hard to understand the code and also to add new hash types.

This PR simplifies the hash implementation by consolidating the hash types and functions into a single evpHash type. There is only one behavior change: now all hash objects implement the encoding interfaces, but they return an error if the hash is not marshallable. Note that this is not a breaking change, quite the opposite. Hash types implemented by this library have always supported the encoding interfaces, it was in #161 that we conditionally removed it to support the SymCrypt provider. I have made up my mind here, and I now think it is better to just return an error given that upstream Go promises that all the built-in hash types implement the encoding interfaces.

@qmuntal qmuntal merged commit 6e4e578 into v2 Dec 20, 2024
54 checks passed
@qmuntal qmuntal deleted the hashsimpl branch December 20, 2024 14:17
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