encryptBytes method

Encrypted encryptBytes(
  1. List<int> input, {
  2. IV? iv,
  3. Uint8List? associatedData,
})

Calls encrypt on the wrapped Algorithm using a raw binary.

Implementation

Encrypted encryptBytes(List<int> input, {IV? iv, Uint8List? associatedData}) {
  if (input is Uint8List) {
    return algo.encrypt(input, iv: iv, associatedData: associatedData);
  }

  return algo.encrypt(
    Uint8List.fromList(input),
    iv: iv,
    associatedData: associatedData,
  );
}