SymmetricKey: fix indent style to follows the PSR-2 codeing style

This commit is contained in:
Takuya Sawada 2017-10-10 19:02:55 +09:00
parent 18a5867e16
commit 65cbc60918

View File

@ -935,11 +935,11 @@ abstract class SymmetricKey
case self::MODE_CFB8: case self::MODE_CFB8:
$ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $this->encryptIV); $ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $this->encryptIV);
if ($this->continuousBuffer) { if ($this->continuousBuffer) {
if (($len = strlen($ciphertext)) >= $this->block_size) { if (($len = strlen($ciphertext)) >= $this->block_size) {
$this->encryptIV = substr($ciphertext, -$this->block_size); $this->encryptIV = substr($ciphertext, -$this->block_size);
} else { } else {
$this->encryptIV = substr($this->encryptIV, $len - $this->block_size) . substr($ciphertext, -$len); $this->encryptIV = substr($this->encryptIV, $len - $this->block_size) . substr($ciphertext, -$len);
} }
} }
return $ciphertext; return $ciphertext;
case self::MODE_OFB: case self::MODE_OFB:
@ -1126,7 +1126,7 @@ abstract class SymmetricKey
$len = strlen($plaintext); $len = strlen($plaintext);
$iv = $this->encryptIV; $iv = $this->encryptIV;
for ($i=0; $i < $len; ++$i) { for ($i = 0; $i < $len; ++$i) {
$ciphertext .= ($c = $plaintext[$i] ^ $this->encryptBlock($iv)); $ciphertext .= ($c = $plaintext[$i] ^ $this->encryptBlock($iv));
$iv = substr($iv, 1, $this->block_size - 1) . $c; $iv = substr($iv, 1, $this->block_size - 1) . $c;
} }
@ -1437,7 +1437,7 @@ abstract class SymmetricKey
$len = strlen($ciphertext); $len = strlen($ciphertext);
$iv = $this->decryptIV; $iv = $this->decryptIV;
for ($i=0; $i < $len; ++$i) { for ($i = 0; $i < $len; ++$i) {
$plaintext .= $ciphertext[$i] ^ $this->encryptBlock($iv); $plaintext .= $ciphertext[$i] ^ $this->encryptBlock($iv);
$iv = substr($iv, 1, $this->block_size - 1) . $ciphertext[$i]; $iv = substr($iv, 1, $this->block_size - 1) . $ciphertext[$i];
} }