blob: 33c95fb46d66eced6ed369f75c2d0c35c3c43124 [file] [log] [blame] [edit]
// See file LICENSE for more information.
import 'dart:typed_data';
import 'package:pointycastle/api.dart';
/// Base implementation of [Padding] which provides shared methods.
abstract class BasePadding implements Padding {
@override
Uint8List process(bool pad, Uint8List data) {
if (pad) {
throw StateError(
'cannot add padding, use PaddedBlockCipher to add padding');
} else {
var len = padCount(data);
return data.sublist(0, data.length - len);
}
}
}