示例#1
0
 /**
  * Construct the instance for the supplied cipher name
  *
  * @param string $cipher The cipher to implement
  *
  * @return void
  * @throws InvalidArgumentException if the cipher is not supported
  */
 public function __construct($cipher)
 {
     parent::__construct($cipher);
     $this->keySize = mcrypt_get_key_size($cipher, MCRYPT_MODE_ECB);
     $this->blockSize = mcrypt_get_block_size($cipher, MCRYPT_MODE_ECB);
 }
示例#2
0
 /**
  * Construct the instance for the supplied cipher name
  *
  * @param string $cipher The cipher to implement
  *
  * @return void
  * @throws InvalidArgumentException if the cipher is not supported
  */
 public function __construct($cipher)
 {
     parent::__construct($cipher);
     list(, $bits) = explode('-', $cipher, 2);
     $this->setBlockSize($bits);
     $this->setKeySize($bits);
     static::init();
 }