Completed
Pull Request — master (#19)
by Michael
05:29
created
src/OpensslKeyGenerator.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
      */
110 110
     public function deriveKey(string $info): string
111 111
     {
112
-        $info = $info . '|' . $this->cipher;
112
+        $info = $info.'|'.$this->cipher;
113 113
 
114 114
         $key = \hash_hkdf($this->algo, $this->key, 0, $info, $this->ivr);
115 115
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
24 24
  * @link     https://github.com/mmeyer2k/dcrypt
25 25
  */
26
-final class OpensslKeyGenerator
27
-{
26
+final class OpensslKeyGenerator
27
+{
28 28
     /**
29 29
      * @var string
30 30
      */
@@ -54,18 +54,18 @@  discard block
 block discarded – undo
54 54
      * @param string $ivr
55 55
      * @param int    $cost
56 56
      */
57
-    public function __construct(string $algo, string $passkey, string $cipher, string $ivr, int $cost)
58
-    {
57
+    public function __construct(string $algo, string $passkey, string $cipher, string $ivr, int $cost)
58
+    {
59 59
         // When cost is 0 then we are in key mode
60
-        if ($cost === 0) {
60
+        if ($cost === 0) {
61 61
             // Make sure key meets minimum required length
62
-            if (Str::strlen($passkey) < 256) {
62
+            if (Str::strlen($passkey) < 256) {
63 63
                 throw new Exceptions\InvalidKeyException("Key must be at least 2048 bits long.");
64 64
             }
65 65
 
66 66
             // Store the key as what was supplied
67 67
             $this->key = $passkey;
68
-        } else {
68
+        } else {
69 69
             // Derive the key from the password and store in object
70 70
             $this->key = \hash_pbkdf2($algo, $passkey, $ivr, $cost, 0, true);
71 71
         }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         $key = \hash_hkdf($this->algo, $this->key, 0, $info, $this->ivr);
115 115
 
116
-        if ($key === false) {
116
+        if ($key === false) {
117 117
             throw new Exceptions\InvalidAlgoException("Hash algo $this->algo is not supported");
118 118
         }
119 119
 
Please login to merge, or discard this patch.