encryptBinary method

  1. @override
BuBytes encryptBinary({
  1. required List<int> key,
  2. required List<int> pt,
  3. List<int> tweak = const [],
})
override

Encrypts raw bytes pt (binary radix-2 FF1) with 16, 24 or 32-byte key and tweak. Returns same-length ciphertext. Throws on bad key or empty pt.

Implementation

@override
BuBytes encryptBinary({
  required List<int> key,
  required List<int> pt,
  List<int> tweak = const [],
}) {
  final ff1 = FF1Binary(aes: blockCipherApi.aes(key));
  final enc = ff1.encrypt(BinaryNumeralString(pt), tweak: tweak);
  return enc.data;
}