aes256DecryptBytesAsStream method

Future<Stream<List<int>>> aes256DecryptBytesAsStream({
  1. required FlutterAesGcm algorithm,
  2. required String rawKey,
  3. required int rawKeyLength,
  4. required Stream<List<int>> data,
})

Implementation

Future<Stream<List<int>>> aes256DecryptBytesAsStream({
  required FlutterAesGcm algorithm,
  required String rawKey,
  required int rawKeyLength,
  required Stream<List<int>> data,
}) async {

  final secretKey = await _deriveKey(rawKey, rawKeyLength, [], 5);
  final encryptedStream = algorithm.decryptStream(
      data,
      secretKey: secretKey,
      nonce: [],
      mac: Mac.empty
  );

  return encryptedStream;
}