@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | foreach ($chunks as $i => &$chunk) { |
46 | 46 | // Create the info key based on counter |
47 | - $info = $length . $i; |
|
47 | + $info = $length.$i; |
|
48 | 48 | |
49 | 49 | // Xor the derived key with the data chunk |
50 | 50 | $chunk = $chunk ^ $key->deriveKey($info); |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | |
9 | 9 | use Dcrypt\OpensslStatic; |
10 | 10 | |
11 | -require __DIR__ . '/../vendor/autoload.php'; |
|
11 | +require __DIR__.'/../vendor/autoload.php'; |
|
12 | 12 | |
13 | -$vectors = __DIR__ . '/../tests/.vectors.json'; |
|
13 | +$vectors = __DIR__.'/../tests/.vectors.json'; |
|
14 | 14 | |
15 | 15 | if (file_exists($vectors)) { |
16 | 16 | $key = json_decode(file_get_contents($vectors))->key; |
@@ -56,6 +56,6 @@ discard block |
||
56 | 56 | $out['otp'][$mult] = \base64_encode(\Dcrypt\OneTimePad::crypt(str_repeat('A', $mult), $key)); |
57 | 57 | } |
58 | 58 | |
59 | -file_put_contents(__DIR__ . '/../tests/.vectors.json', \json_encode($out, JSON_PRETTY_PRINT)); |
|
59 | +file_put_contents(__DIR__.'/../tests/.vectors.json', \json_encode($out, JSON_PRETTY_PRINT)); |
|
60 | 60 | |
61 | 61 | var_dump($out); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * |
10 | 10 | * Displays supported ciphers and algos |
11 | 11 | */ |
12 | -require __DIR__ . '/../vendor/autoload.php'; |
|
12 | +require __DIR__.'/../vendor/autoload.php'; |
|
13 | 13 | |
14 | 14 | $key = \Dcrypt\OpensslKey::create(); |
15 | 15 |
@@ -121,6 +121,6 @@ |
||
121 | 121 | $chk = $key->messageChecksum($msg); |
122 | 122 | |
123 | 123 | // Return concatenation of iv + checksum + tag + ciphertext |
124 | - return $ivr . $chk . $tag . $msg; |
|
124 | + return $ivr.$chk.$tag.$msg; |
|
125 | 125 | } |
126 | 126 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function authenticationKey(): string |
108 | 108 | { |
109 | - return $this->deriveKey(__FUNCTION__ . '|' . $this->_cipher); |
|
109 | + return $this->deriveKey(__FUNCTION__.'|'.$this->_cipher); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function encryptionKey(): string |
118 | 118 | { |
119 | - return $this->deriveKey(__FUNCTION__ . '|' . $this->_cipher); |
|
119 | + return $this->deriveKey(__FUNCTION__.'|'.$this->_cipher); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -74,8 +74,7 @@ |
||
74 | 74 | string $algo, |
75 | 75 | string $cipher = '', |
76 | 76 | string $ivr = '' |
77 | - ) |
|
78 | - { |
|
77 | + ) { |
|
79 | 78 | // Store the key as what was supplied |
80 | 79 | $this->_key = \base64_decode($key, true); |
81 | 80 |