diff --git a/lib/src/kdbx_format.dart b/lib/src/kdbx_format.dart index a542392..1746d17 100644 --- a/lib/src/kdbx_format.dart +++ b/lib/src/kdbx_format.dart @@ -698,8 +698,7 @@ class KdbxFormat { static Future _generateMasterKeyV3( KdbxHeader header, Credentials credentials) async { - final rounds = ReaderHelper.singleUint64( - header.fields[HeaderFields.TransformRounds].bytes); + final rounds = header.v3KdfTransformRounds; final seed = header.fields[HeaderFields.TransformSeed].bytes; final masterSeed = header.fields[HeaderFields.MasterSeed].bytes; _logger.finer( diff --git a/lib/src/kdbx_header.dart b/lib/src/kdbx_header.dart index 01e652c..98d5f7d 100644 --- a/lib/src/kdbx_header.dart +++ b/lib/src/kdbx_header.dart @@ -524,6 +524,9 @@ class KdbxHeader { VarDictionary get readKdfParameters => VarDictionary.read( ReaderHelper(fields[HeaderFields.KdfParameters].bytes)); + int get v3KdfTransformRounds => + ReaderHelper.singleUint64(fields[HeaderFields.TransformRounds].bytes); + void writeKdfParameters(VarDictionary kdfParameters) => _setHeaderField(HeaderFields.KdfParameters, kdfParameters.write());