cipher method

BlockCipher cipher(
  1. int id
)

Implementation

static BlockCipher cipher(int id) {
  switch (id) {
    case AES128_CTR:
      AESFastEngine aes = AESFastEngine();
      return CTRBlockCipher(aes.blockSize, CTRStreamCipher(aes));
    case AES128_CBC:
      return CBCBlockCipher(AESFastEngine());
    case AES256_CTR:
      AESFastEngine aes = AESFastEngine();
      return CTRBlockCipher(aes.blockSize, CTRStreamCipher(aes));
    case AES256_CBC:
      return CBCBlockCipher(AESFastEngine());
    default:
      throw FormatException('$id');
  }
}