Uint8List pad(int blockSize, Iterable<int> input) { if (input.length % blockSize != 0) { throw Exception('Input length must be multiple of blockSize: $blockSize'); } return Uint8List.fromList(input.toList()); }