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:
@@ -40,9 +40,9 @@ const (
|
||||
// Version bytes for extended keys
|
||||
var (
|
||||
// MainNetPrivateKey is the version for mainnet private keys
|
||||
MainNetPrivateKey = []byte{0x04, 0x88, 0xAD, 0xE4}
|
||||
MainNetPrivateKey = []byte{0x04, 0x88, 0xAD, 0xE4} //nolint:gochecknoglobals // Standard BIP32 constant
|
||||
// TestNetPrivateKey is the version for testnet private keys
|
||||
TestNetPrivateKey = []byte{0x04, 0x35, 0x83, 0x94}
|
||||
TestNetPrivateKey = []byte{0x04, 0x35, 0x83, 0x94} //nolint:gochecknoglobals // Standard BIP32 constant
|
||||
)
|
||||
|
||||
// DRNG is a deterministic random number generator seeded by BIP85 entropy
|
||||
@@ -59,7 +59,7 @@ func NewBIP85DRNG(entropy []byte) *DRNG {
|
||||
|
||||
// Initialize SHAKE256 with the entropy
|
||||
shake := sha3.NewShake256()
|
||||
shake.Write(entropy)
|
||||
_, _ = shake.Write(entropy) // Write to hash functions never returns an error
|
||||
|
||||
return &DRNG{
|
||||
shake: shake,
|
||||
|
||||
Reference in New Issue
Block a user