Esempio n. 1
0
 /**
  * Sets the key length.
  *
  * Key lengths can be between 32 and 448 bits.
  *
  * @access public
  * @param int $length
  */
 function setKeyLength($length)
 {
     if ($length < 32) {
         $this->key_length = 7;
     } elseif ($length > 448) {
         $this->key_length = 56;
     } else {
         $this->key_length = $length >> 3;
     }
     parent::setKeyLength($length);
 }
Esempio n. 2
0
 /**
  * Sets the key length.
  *
  * Valid key lengths are 128, 192 or 256 bits
  *
  * @access public
  * @param int $length
  */
 function setKeyLength($length)
 {
     switch (true) {
         case $length <= 128:
             $this->key_length = 16;
             break;
         case $length <= 192:
             $this->key_length = 24;
             break;
         default:
             $this->key_length = 32;
     }
     parent::setKeyLength($length);
 }
Esempio n. 3
0
 /**
  * Sets the key length
  *
  * Keys can be between 1 and 256 bytes long.
  *
  * @access public
  * @param int $length
  */
 function setKeyLength($length)
 {
     if ($length < 8) {
         $this->key_length = 1;
     } elseif ($length > 2048) {
         $this->key_length = 248;
     } else {
         $this->key_length = $length >> 3;
     }
     parent::setKeyLength($length);
 }