Skip to content

Commit

Permalink
Bump dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotwutingfeng committed Sep 16, 2024
1 parent dd64da9 commit cea8501
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/src/crypto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import 'package:pointycastle/block/modes/cbc.dart';
import 'package:pointycastle/paddings/pkcs7.dart';

Uint8List hmacSHA256Digest(Uint8List key, Uint8List data) =>
sha256.hmac(key).convert(data).bytes;
sha256.hmac.by(key).convert(data).bytes;

/// Reference: https://en.wikipedia.org/wiki/HKDF
Uint8List hkdfExpand(Uint8List key, Uint8List info, int length) {
Expand Down Expand Up @@ -55,7 +55,10 @@ Uint8List hkdfExpand(Uint8List key, Uint8List info, int length) {
const int keyLength = 32;
late Uint8List key;
if (kdfType == 0) {
key = sha256.pbkdf2(password, salt, kdfIterations, keyLength).bytes;
key = sha256
.pbkdf2(salt, iterations: kdfIterations, keyLength: keyLength)
.convert(password)
.bytes;
} else if (kdfType == 1) {
key = Argon2(
version: Argon2Version.v13,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ environment:

dependencies:
convert: ^3.1.1
hashlib: ^1.19.2
hashlib: ^1.20.4
pointycastle: ^3.9.1

dev_dependencies:
coverage: ^1.9.0
coverage: ^1.9.2
lints: ^4.0.0
mocktail: ^1.0.4
test: ^1.25.8

0 comments on commit cea8501

Please sign in to comment.