From 1940a324f37d0f544f200ea71f41866f0ac4b207 Mon Sep 17 00:00:00 2001 From: Toby1009 <69885352+Toby1009@users.noreply.github.com> Date: Sun, 31 Aug 2025 05:00:22 +0800 Subject: [PATCH] chore(deps): bump pointycastle from ^3.0.0-nullsafety.2 to ^4.0.0 ### Description - Updated dependency: bumped `pointycastle` from ^3.0.0-nullsafety.2 to ^4.0.0 ### Motivation - The old implementation relied on a pre-release (`-nullsafety`) version of pointycastle - Upgrading ensures compatibility with the stable ^4.0.0 release - This makes the library usable in new projects without dependency conflicts --- lib/src/utils/pbkdf2.dart | 10 ++++------ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/src/utils/pbkdf2.dart b/lib/src/utils/pbkdf2.dart index 16f2efb..a0af020 100644 --- a/lib/src/utils/pbkdf2.dart +++ b/lib/src/utils/pbkdf2.dart @@ -18,14 +18,12 @@ class PBKDF2 { this.blockLength = 128, this.iterationCount = 2048, this.desiredKeyLength = 64, - }) : _derivator = - new PBKDF2KeyDerivator(new HMac(new SHA512Digest(), blockLength)); + }) : _derivator = PBKDF2KeyDerivator(HMac(SHA512Digest(), blockLength)); - Uint8List process(String mnemonic, {passphrase: ""}) { + Uint8List process(String mnemonic, {passphrase = ""}) { final salt = Uint8List.fromList(utf8.encode(saltPrefix + passphrase)); _derivator.reset(); - _derivator - .init(new Pbkdf2Parameters(salt, iterationCount, desiredKeyLength)); - return _derivator.process(new Uint8List.fromList(mnemonic.codeUnits)); + _derivator.init(Pbkdf2Parameters(salt, iterationCount, desiredKeyLength)); + return _derivator.process(Uint8List.fromList(mnemonic.codeUnits)); } } diff --git a/pubspec.yaml b/pubspec.yaml index 59a1227..1d92510 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: ">=2.12.0 <3.0.0" dependencies: - pointycastle: ^3.0.0-nullsafety.2 + pointycastle: ^4.0.0 hex: ^0.2.0 crypto: ^3.0.0 dev_dependencies: