@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | // let the ciphertext be: |
149 | 149 | // C[0] | C[1] = ENC(K, A | P[1]). |
150 | 150 | if (8 == strlen($key)) { |
151 | - return $this->_encrypt($kek, $aiv . $key); |
|
151 | + return $this->_encrypt($kek, $aiv.$key); |
|
152 | 152 | } |
153 | 153 | // build plaintext blocks and apply normal wrapping with AIV as an |
154 | 154 | // initial value |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | // For i = 1 to n |
231 | 231 | for ($i = 1; $i <= $n; ++$i) { |
232 | 232 | // B = AES(K, A | R[i]) |
233 | - $B = $this->_encrypt($kek, $A . $R[$i]); |
|
233 | + $B = $this->_encrypt($kek, $A.$R[$i]); |
|
234 | 234 | // A = MSB(64, B) ^ t where t = (n*j)+i |
235 | 235 | $t = $n * $j + $i; |
236 | 236 | $A = $this->_msb64($B) ^ $this->_uint64($t); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | // if key consists of only one block, recover AIV and padded key as: |
265 | 265 | // A | P[1] = DEC(K, C[0] | C[1]) |
266 | 266 | if ($n == 1) { |
267 | - $P = str_split($this->_decrypt($kek, $C[0] . $C[1]), 8); |
|
267 | + $P = str_split($this->_decrypt($kek, $C[0].$C[1]), 8); |
|
268 | 268 | $A = $P[0]; |
269 | 269 | unset($P[0]); |
270 | 270 | } else { |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | for ($i = $n; $i >= 1; --$i) { |
309 | 309 | // B = AES-1(K, (A ^ t) | R[i]) where t = n*j+i |
310 | 310 | $t = $n * $j + $i; |
311 | - $B = $this->_decrypt($kek, ($A ^ $this->_uint64($t)) . $R[$i]); |
|
311 | + $B = $this->_decrypt($kek, ($A ^ $this->_uint64($t)).$R[$i]); |
|
312 | 312 | // A = MSB(64, B) |
313 | 313 | $A = $this->_msb64($B); |
314 | 314 | // R[i] = LSB(64, B) |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | } |
334 | 334 | // compute AIV |
335 | 335 | $mli = pack("N", $len); |
336 | - $aiv = self::AIV_HI . $mli; |
|
336 | + $aiv = self::AIV_HI.$mli; |
|
337 | 337 | return [$key, $aiv]; |
338 | 338 | } |
339 | 339 | |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING); |
398 | 398 | if (false === $str) { |
399 | 399 | throw new \RuntimeException( |
400 | - "openssl_encrypt() failed: " . $this->_getLastOpenSSLError()); |
|
400 | + "openssl_encrypt() failed: ".$this->_getLastOpenSSLError()); |
|
401 | 401 | } |
402 | 402 | return $str; |
403 | 403 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING); |
417 | 417 | if (false === $str) { |
418 | 418 | throw new \RuntimeException( |
419 | - "openssl_decrypt() failed: " . $this->_getLastOpenSSLError()); |
|
419 | + "openssl_decrypt() failed: ".$this->_getLastOpenSSLError()); |
|
420 | 420 | } |
421 | 421 | return $str; |
422 | 422 | } |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | { |
469 | 469 | // truncate on 32 bit hosts |
470 | 470 | if (PHP_INT_SIZE < 8) { |
471 | - return "\0\0\0\0" . pack("N", $num); |
|
471 | + return "\0\0\0\0".pack("N", $num); |
|
472 | 472 | } |
473 | 473 | return pack("J", $num); |
474 | 474 | } |