fix: resolve gochecknoglobals, gosec, lll, and mnd linter errors

- Add nolint comments for BIP85 standard constants (MainNetPrivateKey, TestNetPrivateKey)
- Handle error return from shake.Write() in NewBIP85DRNG
- Fix line length issue by moving nolint comment to separate line
- Add nolint comment for cobra.ExactArgs(2) magic number
- Replace magic number 32 with named constant x25519KeySize in agehd package
This commit is contained in:
2025-07-09 12:49:59 -07:00
parent d710323bd0
commit 95ba80f618
4 changed files with 9 additions and 6 deletions

View File

@@ -37,7 +37,8 @@ func clamp(k []byte) {
// IdentityFromEntropy converts 32 deterministic bytes into an
// *age.X25519Identity by round-tripping through Bech32.
func IdentityFromEntropy(ent []byte) (*age.X25519Identity, error) {
if len(ent) != 32 { // 32 bytes = 256-bit key size for X25519
const x25519KeySize = 32 // 256-bit key size for X25519
if len(ent) != x25519KeySize {
return nil, fmt.Errorf("need 32-byte scalar, got %d", len(ent))
}