Lines Matching refs:encrypt

426     private $encrypt = false;
1663 $encrypt = self::array_intersect_first($c2s_encryption_algorithms, $this->encryption_algorithms_client_to_server);
1664 $encryptKeyLength = $this->encryption_algorithm_to_key_size($encrypt);
1909 $this->encrypt = self::encryption_algorithm_to_crypt_instance($encrypt);
1910 if ($this->encrypt) {
1912 $this->encrypt->setPreferredEngine(self::$crypto_engine);
1914 if ($this->encrypt->getBlockLengthInBytes()) {
1915 $this->encrypt_block_size = $this->encrypt->getBlockLengthInBytes();
1917 $this->encrypt->disablePadding();
1919 if ($this->encrypt->usesIV()) {
1924 $this->encrypt->setIV(substr($iv, 0, $this->encrypt_block_size));
1927 switch ($encrypt) {
1937 $this->encrypt->enableContinuousBuffer();
1944 switch ($encrypt) {
1947 $this->lengthEncrypt = self::encryption_algorithm_to_crypt_instance($encrypt);
1950 $this->encrypt->setKey(substr($key, 0, $encryptKeyLength));
1951 $this->encryptName = $encrypt;
2007 if ($encrypt == 'arcfour128' || $encrypt == 'arcfour256') {
2008 $this->encrypt->encrypt(str_repeat("\0", 1536));
2014 if (!$this->encrypt->usesNonce()) {
3484 $this->decrypt = $this->encrypt = false;
3624 $this->decrypt->encrypt(str_repeat("\0", 32))
3779 // don't do this when GCM mode is used since GCM mode doesn't encrypt the length
4310 if ($this->encrypt && $this->encrypt->usesNonce()) {
4318 case $this->encrypt && $this->encrypt->usesNonce():
4339 if ($this->encrypt) {
4343 $this->encrypt->setNonce(
4348 $this->encrypt->setAAD($temp = ($packet & "\xFF\xFF\xFF\xFF"));
4349 $packet = $temp . $this->encrypt->encrypt(substr($packet, 4));
4353 if (!($this->encrypt instanceof ChaCha20)) {
4354 throw new \LogicException('$this->encrypt is not a ' . ChaCha20::class);
4359 $this->encrypt->setNonce($nonce);
4362 $length = $this->lengthEncrypt->encrypt($packet & "\xFF\xFF\xFF\xFF");
4364 $this->encrypt->setCounter(0);
4368 $this->encrypt->setPoly1305Key(
4369 $this->encrypt->encrypt(str_repeat("\0", 32))
4371 $this->encrypt->setAAD($length);
4372 $this->encrypt->setCounter(1);
4373 $packet = $length . $this->encrypt->encrypt(substr($packet, 4));
4377 ($packet & "\xFF\xFF\xFF\xFF") . $this->encrypt->encrypt(substr($packet, 4)) :
4378 $this->encrypt->encrypt($packet);
4393 $packet .= $this->encrypt && $this->encrypt->usesNonce() ? $this->encrypt->getTag() : $hmac;