Repository navigation
Feat/kdf pbkdf2 hkdf - #28
Merged
Merged
Conversation
Coverage Report for CI Build 33257428881Coverage increased (+3.4%) to 83.077%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This PR adds key-derivation functionality to the Go openssl wrapper, introducing PBKDF2 and HKDF APIs along with documentation and test vectors to validate cross-language compatibility claims.
Changes:
- Add PBKDF2 implementation (RFC 2898/8018) and HKDF (RFC 5869) including one-shot and streaming reader APIs.
- Add test coverage with RFC/public vectors for PBKDF2 and RFC 5869 vectors for HKDF, plus error-path tests and a benchmark.
- Update README to document KDF usage and add badges/TOC entries.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| README.md | Adds KDF feature/docs and new badges/TOC entries. |
| kdf.go | Introduces PBKDF2/HKDF implementations and streaming HKDF reader. |
| kdf_test.go | Adds RFC/vector-based tests, error tests, and a PBKDF2 benchmark. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| [](https://pkg.go.dev/github.com/go-think/openssl) | ||
| [](https://pkg.go.dev/github.com/go-think/openssl) | ||
| [](https://github.com/go-think/openssl/releases/latest) | ||
| [](https://github.com/go-think/openssl/blob/master/go.mod) |
leeqvip
force-pushed
the
feat/kdf-pbkdf2-hkdf
branch
from
August 29, 2026 13:39
4f2a371 to
cdaabd3
Compare
Comment on lines
+29
to
+32
| prf := hmac.New(h, password) | ||
| hashLen := prf.Size() | ||
| numBlocks := (keyLen + hashLen - 1) / hashLen | ||
|
|
| dk := make([]byte, 0, numBlocks*hashLen) | ||
| U := make([]byte, hashLen) | ||
|
|
||
| // Zeroize sensitive intermediate buffers upon function exit |
Comment on lines
+369
to
+370
| // Derive a 32-byte AES-256 key: 10000 iterations, HMAC-SHA256 | ||
| key, err := openssl.PBKDF2(crypto.SHA256.New, password, salt, 10000, 32) |
leeqvip
force-pushed
the
feat/kdf-pbkdf2-hkdf
branch
from
August 29, 2026 14:22
491898f to
9729e39
Compare
|
🎉 This PR is included in version 1.25.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
No description provided.