transformContentV4ChaCha20 method

Uint8List transformContentV4ChaCha20(
  1. KdbxHeader header,
  2. Uint8List encrypted,
  3. Uint8List cipherKey
)

Implementation

Uint8List transformContentV4ChaCha20(
    KdbxHeader header, Uint8List encrypted, Uint8List cipherKey) {
  final encryptionIv = header.fields[HeaderFields.EncryptionIV]!.bytes;
  final chaCha = ChaCha7539Engine()
    ..init(true, ParametersWithIV(KeyParameter(cipherKey), encryptionIv));
  return chaCha.process(encrypted);
  // return cryptography.chacha20.decrypt(encrypted, key, nonce: nonce);
}