Lines Matching refs:iv

249     protected $iv = false;  variable in phpseclib3\\Crypt\\Common\\SymmetricKey
711 * @param string $iv
715 public function setIV($iv) argument
729 if (strlen($iv) != $this->block_size) {
730 …throw new \LengthException('Received initialization vector of size ' . strlen($iv) . ', but size '…
733 $this->iv = $this->origIV = $iv;
1153 $oldIV = $this->iv;
1154 Strings::increment_str($this->iv);
1157 $cipher->setIV($this->iv);
1166 $cipher->encryptIV = $this->iv = $this->encryptIV = $this->decryptIV = $oldIV;
1199 $iv = &$this->encryptIV;
1202 $iv = $this->encryptIV;
1220 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
1221 $iv = substr_replace($iv, $ciphertext, $orig_pos, $i);
1228 …block_size), $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv);
1229 $iv = Strings::pop($ciphertext, $this->block_size);
1232 $block = $iv ^ substr($plaintext, -$overflow);
1233 $iv = substr_replace($iv, $block, 0, $overflow);
1237 …($plaintext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv);
1238 $iv = substr($ciphertext, -$this->block_size);
1255 $iv = $this->encryptIV;
1258 …$xor = openssl_encrypt($iv, $this->cipher_name_openssl_ecb, $this->key, $this->openssl_options, $t…
1260 $iv = substr($iv, 1) . $xor[0];
1264 $this->encryptIV = $iv;
1285 $iv = &$this->encryptIV;
1302 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
1303 $iv = substr_replace($iv, $ciphertext, $orig_pos, $i);
1309 mcrypt_generic_init($this->enmcrypt, $this->key, $iv);
1313 $iv = substr($ciphertext, -$block_size);
1317 … $iv = mcrypt_generic($this->ecb, $iv) ^ substr($plaintext, $i, $block_size);
1318 $ciphertext .= $iv;
1326 $iv = mcrypt_generic($this->ecb, $iv);
1327 $block = $iv ^ substr($plaintext, -$len);
1328 $iv = substr_replace($iv, $block, 0, $len);
1406 $iv = &$this->encryptIV;
1409 $iv = $this->encryptIV;
1427 $ciphertext = substr($iv, $orig_pos) ^ $plaintext;
1428 $iv = substr_replace($iv, $ciphertext, $orig_pos, $i);
1431 $iv = $this->encryptBlock($iv) ^ substr($plaintext, $i, $block_size);
1432 $ciphertext .= $iv;
1437 $iv = $this->encryptBlock($iv);
1438 $block = $iv ^ substr($plaintext, $i);
1439 $iv = substr_replace($iv, $block, 0, $len);
1447 $iv = $this->encryptIV;
1450 $ciphertext .= ($c = $plaintext[$i] ^ $this->encryptBlock($iv));
1451 $iv = substr($iv, 1) . $c;
1465 $iv = $this->encryptIV;
1468 $xor = $this->encryptBlock($iv);
1470 $iv = substr($iv, 1) . $xor[0];
1474 $this->encryptIV = $iv;
1540 $oldIV = $this->iv;
1541 Strings::increment_str($this->iv);
1544 $cipher->setIV($this->iv);
1553 $cipher->encryptIV = $this->iv = $this->encryptIV = $this->decryptIV = $oldIV;
1591 $iv = &$this->decryptIV;
1594 $iv = $this->decryptIV;
1612 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1613 $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);
1618 …-$overflow), $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv);
1620 $iv = substr($ciphertext, -$overflow - $this->block_size, -$overflow);
1622 …$iv = openssl_encrypt(str_repeat("\0", $this->block_size), $this->cipher_name_openssl, $this->key,…
1623 $plaintext .= $iv ^ substr($ciphertext, -$overflow);
1624 $iv = substr_replace($iv, substr($ciphertext, -$overflow), 0, $overflow);
1627 …$ciphertext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv);
1628 $iv = substr($ciphertext, -$this->block_size);
1644 $iv = $this->decryptIV;
1647 …$xor = openssl_encrypt($iv, $this->cipher_name_openssl_ecb, $this->key, $this->openssl_options, $t…
1649 $iv = substr($iv, 1) . $xor[0];
1653 $this->decryptIV = $iv;
1673 $iv = &$this->decryptIV;
1691 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1692 $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);
1696 $plaintext .= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;
1697 $iv = substr($cb, -$block_size);
1701 $iv = mcrypt_generic($this->ecb, $iv);
1702 $plaintext .= $iv ^ substr($ciphertext, -$len);
1703 $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len);
1778 $iv = &$this->decryptIV;
1781 $iv = $this->decryptIV;
1799 $plaintext = substr($iv, $orig_pos) ^ $ciphertext;
1800 $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);
1803 $iv = $this->encryptBlock($iv);
1805 $plaintext .= $iv ^ $cb;
1806 $iv = $cb;
1811 $iv = $this->encryptBlock($iv);
1812 $plaintext .= $iv ^ substr($ciphertext, $i);
1813 $iv = substr_replace($iv, substr($ciphertext, $i), 0, $len);
1820 $iv = $this->decryptIV;
1823 $plaintext .= $ciphertext[$i] ^ $this->encryptBlock($iv);
1824 $iv = substr($iv, 1) . $ciphertext[$i];
1838 $iv = $this->decryptIV;
1841 $xor = $this->encryptBlock($iv);
1843 $iv = substr($iv, 1) . $xor[0];
1847 $this->decryptIV = $iv;
1954 * @param string $iv
1958 protected function getIV($iv) argument
1960 return $this->mode == self::MODE_ECB ? str_repeat("\0", $this->block_size) : $iv;
2496 $this->iv = $this->origIV;
2499 if ($this->iv === false && !in_array($this->mode, [self::MODE_STREAM, self::MODE_ECB])) {
2509 $this->encryptIV = $this->decryptIV = $this->iv;
3295 $this->iv = $this->nonce . "\0\0\0\1";
3297 $this->iv = $this->ghash(