Replace MD5 with SHA-256 for FIPS 140 compatibility#26
Merged
abhinavdangeti merged 2 commits intodepsfrom Jan 22, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces the MD5 hashing algorithm with SHA-256 to achieve FIPS 140 compliance in the levenshtein package. The change affects internal hashing logic used for deduplicating MultiState objects during DFA construction.
Changes:
- Updated import from
crypto/md5tocrypto/sha256 - Modified hash map key size from
[16]byteto[32]byteto accommodate SHA-256's 32-byte output - Replaced
md5.Sum()withsha256.Sum256()and updated variable naming for clarity
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
hi @abhinavdangeti, this as well - for the new vellum tag. |
Member
|
Would this work for in-place upgrades? Any API changes downstream on account of this? |
Member
Author
|
Hi @abhinavdangeti, I don't think this will cause any issue. We basically use the |
abhinavdangeti
added a commit
that referenced
this pull request
Jan 22, 2026
#25) - Remove legacy vendor directory - Upgrade dependencies - `bits-and-blooms/bitset`, `blevesearch/mmap-go`, `spf13/cobra` - Requires: blevesearch/mmap-go#6 - Fix README badges - Replace `crypto/md5` with `crypto/sha256` for FIPS 140 compatibility (#26) --------- Co-authored-by: Abhinav Dangeti <abhinav@couchbase.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
crypto/md5withcrypto/sha256for internal hashing to allow compliance with FIPS-140 standard.