Use initial 128bit as loginKey

This commit is contained in:
Neeraj Gupta 2023-07-24 15:11:43 +05:30
parent a88cd75a5c
commit 9a80bf2cb2

View file

@ -462,8 +462,8 @@ class CryptoUtil {
// `loginSubKeyLen` and `loginSubKeyContext` as context
static Future<Uint8List> deriveLoginKey(
Uint8List key,
) {
return _computer.compute(
) async {
final Uint8List derivedKey = await _computer.compute(
cryptoKdfDeriveFromKey,
param: {
"key": key,
@ -473,6 +473,8 @@ class CryptoUtil {
},
taskName: "deriveLoginKey",
);
// return the first 16 bytes of the derived key
return derivedKey.sublist(0, 16);
}
// Computes and returns the hash of the source file