Completed
Push — master ( 82d3b6...287b9a )
by Joni
03:31
created
lib/AESKW/Algorithm.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		// let the ciphertext be:
146 146
 		// C[0] | C[1] = ENC(K, A | P[1]).
147 147
 		if (8 == strlen($key)) {
148
-			return $this->_encrypt($kek, $aiv . $key);
148
+			return $this->_encrypt($kek, $aiv.$key);
149 149
 		}
150 150
 		// build plaintext blocks and apply normal wrapping with AIV as an
151 151
 		// initial value
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 			// For i = 1 to n
225 225
 			for ($i = 1; $i <= $n; ++$i) {
226 226
 				// B = AES(K, A | R[i])
227
-				$B = $this->_encrypt($kek, $A . $R[$i]);
227
+				$B = $this->_encrypt($kek, $A.$R[$i]);
228 228
 				// A = MSB(64, B) ^ t where t = (n*j)+i
229 229
 				$t = $n * $j + $i;
230 230
 				$A = $this->_msb64($B) ^ $this->_uint64($t);
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		// if key consists of only one block, recover AIV and padded key as:
258 258
 		// A | P[1] = DEC(K, C[0] | C[1])
259 259
 		if ($n == 1) {
260
-			$P = str_split($this->_decrypt($kek, $C[0] . $C[1]), 8);
260
+			$P = str_split($this->_decrypt($kek, $C[0].$C[1]), 8);
261 261
 			$A = $P[0];
262 262
 			unset($P[0]);
263 263
 		} else {
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 			for ($i = $n; $i >= 1; --$i) {
301 301
 				// B = AES-1(K, (A ^ t) | R[i]) where t = n*j+i
302 302
 				$t = $n * $j + $i;
303
-				$B = $this->_decrypt($kek, ($A ^ $this->_uint64($t)) . $R[$i]);
303
+				$B = $this->_decrypt($kek, ($A ^ $this->_uint64($t)).$R[$i]);
304 304
 				// A = MSB(64, B)
305 305
 				$A = $this->_msb64($B);
306 306
 				// R[i] = LSB(64, B)
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 		}
325 325
 		// compute AIV
326 326
 		$mli = pack("N", $len);
327
-		$aiv = self::AIV_HI . $mli;
327
+		$aiv = self::AIV_HI.$mli;
328 328
 		return [$key, $aiv];
329 329
 	}
330 330
 	
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 			OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);
386 386
 		if (false === $str) {
387 387
 			throw new \RuntimeException(
388
-				"openssl_encrypt() failed: " . $this->_getLastOpenSSLError());
388
+				"openssl_encrypt() failed: ".$this->_getLastOpenSSLError());
389 389
 		}
390 390
 		return $str;
391 391
 	}
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 			OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);
404 404
 		if (false === $str) {
405 405
 			throw new \RuntimeException(
406
-				"openssl_decrypt() failed: " . $this->_getLastOpenSSLError());
406
+				"openssl_decrypt() failed: ".$this->_getLastOpenSSLError());
407 407
 		}
408 408
 		return $str;
409 409
 	}
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 	protected function _uint64($num) {
452 452
 		// truncate on 32 bit hosts
453 453
 		if (PHP_INT_SIZE < 8) {
454
-			return "\0\0\0\0" . pack("N", $num);
454
+			return "\0\0\0\0".pack("N", $num);
455 455
 		}
456 456
 		return pack("J", $num);
457 457
 	}
Please login to merge, or discard this patch.