Conversation
- Initialize go.mod for github.com/elithrar/simple-scrypt - Add go.sum with golang.org/x/crypto dependency - Remove .travis.yml configuration - Remove TravisCI badge from README.md
|
/bonk the workflow was added. can you also:
|
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
Review Summary1. Test Coverage Analysis (88.5% overall)All tests pass. The coverage is good but there are some gaps that could lead to bugs:
Coverage gaps that could lead to bugs:
Recommendations:
2. README Clarity Improvements
3. Go Style Review for
|
| Location | Issue | Recommendation |
|---|---|---|
| Line 41 | Typo in comment: "approxmiately" | Change to "approximately" |
| Line 166 | Comment says "P, N, R" but order is N, R, P | Fix comment to match actual order: "N, R, P, salt, dk" |
| Lines 220-224 | Comment formatting uses extra blank line | Per Go style, remove blank line between // blocks |
| Line 275 | Typo: "to long" | Should be "too long" |
| Line 32 | Comment says "logN" for N | N is the actual cost, not log(N). The comment is misleading |
Idiom observations (no changes needed, just notes):
- Error handling is idiomatic
- Use of
crypto/subtle.ConstantTimeCompareis correct - Exported functions have proper doc comments
- Constants are properly grouped
Summary of Findings
Test Coverage: 88.5% is solid. The untested paths are mostly error conditions from the underlying scrypt.Key which are difficult to trigger. No critical gaps likely to cause bugs in normal use.
README: Has several typos and one code example that won't compile (err := redeclaration, invalid return in main()).
Code Style: Very clean. A few minor typos in comments. The comment at line 166 has incorrect parameter order documentation.
|
/bonk address the README and scrypt.go changes. All are minor and approved. |
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
|
Done. I've addressed the minor approved changes: README.md fixes:
scrypt.go fixes:
All tests pass and |
|
/bonk two test runners fail. Make sure our gofmt & go vet are resistant to Go version changes go1.20: Run go vet ./... and go1.22: Run test -z "$(gofmt -l .)" |
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
|
All tests pass, Summary of changes:
This makes the module compatible with Go 1.20+ while still using a recent, secure version of the crypto library. |
|
/bonk what are the changes in golang.org/x/crypto v0.31.0 vs v0.46.0 - any security advisories or otherwise? specific to the scrypt package and code paths we use - e.g. https://pkg.go.dev/golang.org/x/crypto?tab=versions (see advisories) |
Security Analysis:
|
| Advisory | CVE | Affected Package | Fixed In | Impact on simple-scrypt |
|---|---|---|---|---|
| GO-2025-3487 | CVE-2025-22869 | ssh |
v0.35.0 | Not affected |
| GO-2025-4116 | CVE-2025-47913 | ssh/agent |
v0.43.0 | Not affected |
| GO-2025-4134 | CVE-2025-58181 | ssh |
v0.45.0 | Not affected |
| GO-2025-4135 | CVE-2025-47914 | ssh/agent |
v0.45.0 | Not affected |
Recommendation
v0.31.0 is safe for this library's use case. Since:
- All 4 advisories are in
golang.org/x/crypto/sshandgolang.org/x/crypto/ssh/agent - simple-scrypt only imports
golang.org/x/crypto/scrypt - There are no security advisories for the
scryptpackage in any version
The choice of v0.31.0 was made for Go 1.20 compatibility (v0.46.0 requires Go 1.24). This is a reasonable trade-off since the library doesn't use any vulnerable code paths.
Changes Between v0.31.0 and v0.46.0 in scrypt Package
No functional or security changes have been made to the scrypt package between these versions. The scrypt implementation has been stable for years. The version bumps are primarily driven by:
- Go version compatibility updates
- Fixes in other packages (SSH-related)
- Module housekeeping
Done! I've made the Go changes and pushed them to branch
opencode/issue24-20251225160110:Changes made:
go.modforgithub.com/elithrar/simple-scryptgo.sumwithgolang.org/x/cryptodependency.travis.ymlREADME.mdPR Description (for the automated PR creation):
Summary
go.modandgo.sum).travis.yml)GitHub Actions Workflow
The following test workflow needs to be added manually (requires
workflowspermission):Save this as
.github/workflows/test.ymlafter merging this PR.Closes #24
Closes #24
opencode session | github run