keep-core icon indicating copy to clipboard operation
keep-core copied to clipboard

Lint: Fix deprecated elliptic.Marshal/Unmarshal usage (SA1019 warnings)

Open jose-blockchain opened this issue 4 months ago • 0 comments

Summary

The codebase contains 16 instances of deprecated elliptic.Marshal and elliptic.Unmarshal functions that have been deprecated since Go 1.21. These should be migrated to use the crypto/ecdh package.

Affected Files

  • pkg/bitcoin/script_test.go (2 instances)
  • pkg/bitcoin/transaction_test.go (1 instance)
  • pkg/chain/ethereum/tbtc.go (2 instances)
  • pkg/protocol/inactivity/member_test.go (1 instance)
  • pkg/tbtc/chain_test.go (1 instance)
  • pkg/tbtc/internal/test/marshaling.go (4 instances)
  • pkg/tbtc/marshaling.go (2 instances)
  • pkg/tbtc/registry.go (1 instance)
  • pkg/tbtc/wallet.go (1 instance)
  • pkg/tecdsa/dkg/protocol_test.go (1 instance)
  • pkg/tecdsa/dkg/result.go (1 instance)

Required Changes

Replace deprecated functions:

  • elliptic.Marshal → Use crypto/ecdh package equivalent
  • elliptic.Unmarshal → Use crypto/ecdh package equivalent

Impact

  • Low Risk: These are deprecation warnings, not errors
  • Backward Compatible: Current code still works
  • Future-Proofing: Migration needed for future Go versions

References

  • Go 1.21 deprecation notice: https://pkg.go.dev/crypto/elliptic#Marshal
  • crypto/ecdh package: https://pkg.go.dev/crypto/ecdh

jose-blockchain avatar Aug 14 '25 14:08 jose-blockchain