AES constructor

AES(
  1. Key key, {
  2. AESMode mode = AESMode.sic,
  3. String? padding = 'PKCS7',
})

Implementation

AES(this.key, {this.mode = AESMode.sic, this.padding = 'PKCS7'})
    : _streamCipher = padding == null && _streamable.contains(mode)
          ? StreamCipher('AES/${_modes[mode]}')
          : null {
  if (mode == AESMode.gcm) {
    _cipher = GCMBlockCipher(AESEngine());
  } else {
    _cipher = padding != null
        ? PaddedBlockCipher('AES/${_modes[mode]}/$padding')
        : BlockCipher('AES/${_modes[mode]}');
  }
}