Skip to content

Conversation

@kailuo
Copy link

@kailuo kailuo commented Sep 9, 2025

  • Added support for Xcode 26
  • Fixed a potential memory leak

Copilot AI review requested due to automatic review settings September 9, 2025 03:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Xcode 26 and fixes a potential memory leak by migrating from deprecated .bytes property to the Swift standard [UInt8]() initializer for Data-to-byte array conversions across cryptographic operations.

  • Replaced deprecated .bytes property with [UInt8](data) for Data-to-byte array conversions
  • Fixed memory leak by properly managing secp256k1 context destruction
  • Updated cryptographic functions to use modern Swift Data handling

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Sources/HDWalletKit/Mnemonic/Mnemonic.swift Updated PBKDF2 function to use modern Data-to-bytes conversion
Sources/HDWalletKit/Core/Crypto/Encryption/EllipticCurveEncrypterSecp256k1.swift Migrated cryptographic key operations from deprecated .bytes to [UInt8]()
Sources/HDWalletKit/Core/Crypto/Encryption/ECDSA.swift Fixed memory leak and updated signature verification to use modern Data handling
Comments suppressed due to low confidence (1)

Sources/HDWalletKit/Core/Crypto/Encryption/ECDSA.swift:1

  • Variable shadowing issue: the parameter hash is being shadowed by the local variable hash. This makes the precondition check the converted array instead of the original Data parameter. Move the conversion after the precondition check.
//

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant