original_string: private function _validateIv($iv = null)
      {
          if (self::$allowedCiphers[$this->cipher]['iv']) {
              $this->blockSize = openssl_cipher_iv_length($this->cipher);
  
              $ivLength = mb_strlen($iv, '8bit');
              if ($ivLength !== $this->blockSize) {
                  throw new InvalidArgumentException(sprintf(
                      'Initialization vector of %d bytes is required for cipher "%s", %d given.',
                      $this->blockSize,
                      $this->cipher,
                      $ivLength
                  ));
              }
          }
      }
code: private function _validateIv($iv = null)
      {
          if (self::$allowedCiphers[$this->cipher]['iv']) {
              $this->blockSize = openssl_cipher_iv_length($this->cipher);
  
              $ivLength = mb_strlen($iv, '8bit');
              if ($ivLength !== $this->blockSize) {
                  throw new InvalidArgumentException(sprintf(
                      'Initialization vector of %d bytes is required for cipher "%s", %d given.',
                      $this->blockSize,
                      $this->cipher,
                      $ivLength
                  ));
              }
          }
      }
code_tokens: private function _validateIv ( $ iv = null ) { if ( self :: $ allowedCiphers [ $ this -> cipher ] [ 'iv' ] ) { $ this -> blockSize = openssl_cipher_iv_length ( $ this -> cipher ) ; $ ivLength = mb_strlen ( $ iv , '8bit' ) ; if ( $ ivLength !== $ this -> blockSize ) { throw new InvalidArgumentException ( sprintf ( 'Initialization vector of %d bytes is required for cipher "%s", %d given.' , $ this -> blockSize , $ this -> cipher , $ ivLength ) ) ; } } }
docstring: Validates initialization vector.
  
  @param string|null $iv
docstring_tokens: Validates initialization vector .