@@ -36,7 +36,7 @@ |
||
36 | 36 | ); |
37 | 37 | |
38 | 38 | foreach ($files as $f) { |
39 | - require_once __DIR__ . "/src/$f.php"; |
|
39 | + require_once __DIR__."/src/$f.php"; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | // @codeCoverageIgnoreEnd |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $pad = self::paddingString(self::strlen($input), $blocksize); |
42 | 42 | |
43 | 43 | // Return input + padding |
44 | - return $input . $pad; |
|
44 | + return $input.$pad; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -70,8 +70,8 @@ |
||
70 | 70 | while ($i < $n) { |
71 | 71 | $a = \substr($hexstr, $i, 2); |
72 | 72 | $c = \pack('H*', $a); |
73 | - $sbin.= $c; |
|
74 | - $i+=2; |
|
73 | + $sbin .= $c; |
|
74 | + $i += 2; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $sbin; |
@@ -102,10 +102,10 @@ |
||
102 | 102 | $message = \mcrypt_encrypt($cipher, $key, $padded, $mode, $iv); |
103 | 103 | |
104 | 104 | // Create the cypher text prefix (iv + checksum) |
105 | - $prefix = $iv . self::checksum($message, $iv, $key, $cipher, $mode, $algo); |
|
105 | + $prefix = $iv.self::checksum($message, $iv, $key, $cipher, $mode, $algo); |
|
106 | 106 | |
107 | 107 | // Return prefix + cyphertext |
108 | - return $prefix . $message; |
|
108 | + return $prefix.$message; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $chunks = \str_split($input, self::hashSize($algo)); |
53 | 53 | |
54 | 54 | foreach ($chunks as $i => &$chunk) { |
55 | - $chunk = $chunk ^ \hash($algo, $password . $i, true); |
|
55 | + $chunk = $chunk ^ \hash($algo, $password.$i, true); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return \implode($chunks); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $hash = self::ihmac($input, $key, $cost, self::ALGO); |
61 | 61 | |
62 | 62 | // Return the salt + cost blob + hmac |
63 | - return $salt . self::costHash($cost, $salt, $password) . $hash; |
|
63 | + return $salt.self::costHash($cost, $salt, $password).$hash; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | // Convert cost to base 256 then encrypt with OTP stream cipher |
84 | 84 | $cost = Otp::crypt(self::dec2bin($cost), $password); |
85 | 85 | |
86 | - return $hash . $cost; |
|
86 | + return $hash.$cost; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $iter = abs($iter); |
105 | 105 | |
106 | 106 | for ($i = 0; $i <= $iter; $i++) { |
107 | - $data = \hash_hmac($algo, $data . $i . $iter, $key, true); |
|
107 | + $data = \hash_hmac($algo, $data.$i.$iter, $key, true); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | return $data; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__ . '/vendor/autoload.php'; |
|
3 | +require __DIR__.'/vendor/autoload.php'; |
|
4 | 4 | |
5 | 5 | date_default_timezone_set('UTC'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $sum = \hash_hmac($algo, $cyphertext, $key, true); |
47 | 47 | |
48 | 48 | // ... then hash other elements with previous hmac and return |
49 | - return \hash_hmac($algo, $sum . $iv . $mode . $cipher, $key, true); |
|
49 | + return \hash_hmac($algo, $sum.$iv.$mode.$cipher, $key, true); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | // Perform key derivation |
99 | - $key = Hash::ihmac($iv . $cipher . $mode, $password, $cost, $algo); |
|
99 | + $key = Hash::ihmac($iv.$cipher.$mode, $password, $cost, $algo); |
|
100 | 100 | |
101 | 101 | // Return hash normalized to key length |
102 | 102 | return self::hashNormalize($key, $keysize, $algo); |
@@ -108,10 +108,10 @@ |
||
108 | 108 | $message = \openssl_encrypt($plaintext, static::CIPHER, $key, 1, $iv); |
109 | 109 | |
110 | 110 | // Create the cypher text prefix (iv + checksum) |
111 | - $prefix = $iv . self::checksum($message, $iv, $key, self::RIJNDA, self::mode()); |
|
111 | + $prefix = $iv.self::checksum($message, $iv, $key, self::RIJNDA, self::mode()); |
|
112 | 112 | |
113 | 113 | // Return prefix + cyphertext |
114 | - return $prefix . $message; |
|
114 | + return $prefix.$message; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |