@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core_ChaCha20_Ctx |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core_ChaCha20_Ctx extends ParagonIE_Sodium_Core_Util implements ArrayAccess |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core_ChaCha20_Ctx extends ParagonIE_Sodium_Core_Util implements ArrayAccess { |
|
12 | 11 | /** |
13 | 12 | * @var SplFixedArray internally, <int, int> |
14 | 13 | */ |
@@ -26,8 +25,7 @@ discard block |
||
26 | 25 | * @throws InvalidArgumentException |
27 | 26 | * @throws TypeError |
28 | 27 | */ |
29 | - public function __construct($key = '', $iv = '', $counter = '') |
|
30 | - { |
|
28 | + public function __construct($key = '', $iv = '', $counter = '') { |
|
31 | 29 | if (self::strlen($key) !== 32) { |
32 | 30 | throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.'); |
33 | 31 | } |
@@ -70,8 +68,7 @@ discard block |
||
70 | 68 | * @psalm-suppress MixedArrayOffset |
71 | 69 | */ |
72 | 70 | #[ReturnTypeWillChange] |
73 | - public function offsetSet($offset, $value) |
|
74 | - { |
|
71 | + public function offsetSet($offset, $value) { |
|
75 | 72 | if (!is_int($offset)) { |
76 | 73 | throw new InvalidArgumentException('Expected an integer'); |
77 | 74 | } |
@@ -88,8 +85,7 @@ discard block |
||
88 | 85 | * @return bool |
89 | 86 | */ |
90 | 87 | #[ReturnTypeWillChange] |
91 | - public function offsetExists($offset) |
|
92 | - { |
|
88 | + public function offsetExists($offset) { |
|
93 | 89 | return isset($this->container[$offset]); |
94 | 90 | } |
95 | 91 | |
@@ -101,8 +97,7 @@ discard block |
||
101 | 97 | * @psalm-suppress MixedArrayOffset |
102 | 98 | */ |
103 | 99 | #[ReturnTypeWillChange] |
104 | - public function offsetUnset($offset) |
|
105 | - { |
|
100 | + public function offsetUnset($offset) { |
|
106 | 101 | unset($this->container[$offset]); |
107 | 102 | } |
108 | 103 | |
@@ -114,8 +109,7 @@ discard block |
||
114 | 109 | * @psalm-suppress MixedArrayOffset |
115 | 110 | */ |
116 | 111 | #[ReturnTypeWillChange] |
117 | - public function offsetGet($offset) |
|
118 | - { |
|
112 | + public function offsetGet($offset) { |
|
119 | 113 | return isset($this->container[$offset]) |
120 | 114 | ? $this->container[$offset] |
121 | 115 | : null; |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core_ChaCha20_IetfCtx |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core_ChaCha20_Ctx |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core_ChaCha20_Ctx { |
|
12 | 11 | /** |
13 | 12 | * ParagonIE_Sodium_Core_ChaCha20_IetfCtx constructor. |
14 | 13 | * |
@@ -21,8 +20,7 @@ discard block |
||
21 | 20 | * @throws InvalidArgumentException |
22 | 21 | * @throws TypeError |
23 | 22 | */ |
24 | - public function __construct($key = '', $iv = '', $counter = '') |
|
25 | - { |
|
23 | + public function __construct($key = '', $iv = '', $counter = '') { |
|
26 | 24 | if (self::strlen($iv) !== 12) { |
27 | 25 | throw new InvalidArgumentException('ChaCha20 expects a 96-bit nonce in IETF mode.'); |
28 | 26 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | /** |
5 | 5 | * Class SodiumException |
6 | 6 | */ |
7 | - class SodiumException extends Exception |
|
8 | - { |
|
7 | + class SodiumException extends Exception { |
|
9 | 8 | |
10 | 9 | } |
11 | 10 | } |
@@ -9,8 +9,7 @@ discard block |
||
9 | 9 | * |
10 | 10 | * Based on the work of Devi Mandiri in devi/salt. |
11 | 11 | */ |
12 | -abstract class ParagonIE_Sodium_Core32_BLAKE2b extends ParagonIE_Sodium_Core_Util |
|
13 | -{ |
|
12 | +abstract class ParagonIE_Sodium_Core32_BLAKE2b extends ParagonIE_Sodium_Core_Util { |
|
14 | 13 | /** |
15 | 14 | * @var SplFixedArray |
16 | 15 | */ |
@@ -49,8 +48,7 @@ discard block |
||
49 | 48 | * @throws SodiumException |
50 | 49 | * @throws TypeError |
51 | 50 | */ |
52 | - public static function new64($high, $low) |
|
53 | - { |
|
51 | + public static function new64($high, $low) { |
|
54 | 52 | return ParagonIE_Sodium_Core32_Int64::fromInts($low, $high); |
55 | 53 | } |
56 | 54 | |
@@ -65,8 +63,7 @@ discard block |
||
65 | 63 | * @throws SodiumException |
66 | 64 | * @throws TypeError |
67 | 65 | */ |
68 | - protected static function to64($num) |
|
69 | - { |
|
66 | + protected static function to64($num) { |
|
70 | 67 | list($hi, $lo) = self::numericTo64BitInteger($num); |
71 | 68 | return self::new64($hi, $lo); |
72 | 69 | } |
@@ -81,8 +78,7 @@ discard block |
||
81 | 78 | * @param ParagonIE_Sodium_Core32_Int64 $y |
82 | 79 | * @return ParagonIE_Sodium_Core32_Int64 |
83 | 80 | */ |
84 | - protected static function add64($x, $y) |
|
85 | - { |
|
81 | + protected static function add64($x, $y) { |
|
86 | 82 | return $x->addInt64($y); |
87 | 83 | } |
88 | 84 | |
@@ -94,8 +90,7 @@ discard block |
||
94 | 90 | * @param ParagonIE_Sodium_Core32_Int64 $z |
95 | 91 | * @return ParagonIE_Sodium_Core32_Int64 |
96 | 92 | */ |
97 | - public static function add364($x, $y, $z) |
|
98 | - { |
|
93 | + public static function add364($x, $y, $z) { |
|
99 | 94 | return $x->addInt64($y)->addInt64($z); |
100 | 95 | } |
101 | 96 | |
@@ -107,8 +102,7 @@ discard block |
||
107 | 102 | * @return ParagonIE_Sodium_Core32_Int64 |
108 | 103 | * @throws TypeError |
109 | 104 | */ |
110 | - public static function xor64(ParagonIE_Sodium_Core32_Int64 $x, ParagonIE_Sodium_Core32_Int64 $y) |
|
111 | - { |
|
105 | + public static function xor64(ParagonIE_Sodium_Core32_Int64 $x, ParagonIE_Sodium_Core32_Int64 $y) { |
|
112 | 106 | return $x->xorInt64($y); |
113 | 107 | } |
114 | 108 | |
@@ -121,8 +115,7 @@ discard block |
||
121 | 115 | * @throws SodiumException |
122 | 116 | * @throws TypeError |
123 | 117 | */ |
124 | - public static function rotr64(ParagonIE_Sodium_Core32_Int64 $x, $c) |
|
125 | - { |
|
118 | + public static function rotr64(ParagonIE_Sodium_Core32_Int64 $x, $c) { |
|
126 | 119 | return $x->rotateRight($c); |
127 | 120 | } |
128 | 121 | |
@@ -135,8 +128,7 @@ discard block |
||
135 | 128 | * @throws SodiumException |
136 | 129 | * @throws TypeError |
137 | 130 | */ |
138 | - public static function load64($x, $i) |
|
139 | - { |
|
131 | + public static function load64($x, $i) { |
|
140 | 132 | /** @var int $l */ |
141 | 133 | $l = (int) ($x[$i]) |
142 | 134 | | ((int) ($x[$i+1]) << 8) |
@@ -164,8 +156,7 @@ discard block |
||
164 | 156 | * @psalm-suppress MixedArrayAssignment |
165 | 157 | * @psalm-suppress MixedArrayOffset |
166 | 158 | */ |
167 | - public static function store64(SplFixedArray $x, $i, ParagonIE_Sodium_Core32_Int64 $u) |
|
168 | - { |
|
159 | + public static function store64(SplFixedArray $x, $i, ParagonIE_Sodium_Core32_Int64 $u) { |
|
169 | 160 | $v = clone $u; |
170 | 161 | $maxLength = $x->getSize() - 1; |
171 | 162 | for ($j = 0; $j < 8; ++$j) { |
@@ -187,8 +178,7 @@ discard block |
||
187 | 178 | * @throws SodiumException |
188 | 179 | * @throws TypeError |
189 | 180 | */ |
190 | - public static function pseudoConstructor() |
|
191 | - { |
|
181 | + public static function pseudoConstructor() { |
|
192 | 182 | static $called = false; |
193 | 183 | if ($called) { |
194 | 184 | return; |
@@ -221,8 +211,7 @@ discard block |
||
221 | 211 | * @throws SodiumException |
222 | 212 | * @throws TypeError |
223 | 213 | */ |
224 | - protected static function context() |
|
225 | - { |
|
214 | + protected static function context() { |
|
226 | 215 | $ctx = new SplFixedArray(6); |
227 | 216 | $ctx[0] = new SplFixedArray(8); // h |
228 | 217 | $ctx[1] = new SplFixedArray(2); // t |
@@ -260,8 +249,7 @@ discard block |
||
260 | 249 | * @psalm-suppress MixedArrayAssignment |
261 | 250 | * @psalm-suppress MixedAssignment |
262 | 251 | */ |
263 | - protected static function compress(SplFixedArray $ctx, SplFixedArray $buf) |
|
264 | - { |
|
252 | + protected static function compress(SplFixedArray $ctx, SplFixedArray $buf) { |
|
265 | 253 | $m = new SplFixedArray(16); |
266 | 254 | $v = new SplFixedArray(16); |
267 | 255 | |
@@ -318,8 +306,7 @@ discard block |
||
318 | 306 | * @psalm-suppress MixedArgument |
319 | 307 | * @psalm-suppress MixedArrayOffset |
320 | 308 | */ |
321 | - public static function G($r, $i, $a, $b, $c, $d, SplFixedArray $v, SplFixedArray $m) |
|
322 | - { |
|
309 | + public static function G($r, $i, $a, $b, $c, $d, SplFixedArray $v, SplFixedArray $m) { |
|
323 | 310 | $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][$i << 1]]); |
324 | 311 | $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 32); |
325 | 312 | $v[$c] = self::add64($v[$c], $v[$d]); |
@@ -343,8 +330,7 @@ discard block |
||
343 | 330 | * @psalm-suppress MixedArrayAccess |
344 | 331 | * @psalm-suppress MixedArrayAssignment |
345 | 332 | */ |
346 | - public static function increment_counter($ctx, $inc) |
|
347 | - { |
|
333 | + public static function increment_counter($ctx, $inc) { |
|
348 | 334 | if ($inc < 0) { |
349 | 335 | throw new SodiumException('Increasing by a negative number makes no sense.'); |
350 | 336 | } |
@@ -382,8 +368,7 @@ discard block |
||
382 | 368 | * @psalm-suppress MixedMethodCall |
383 | 369 | * @psalm-suppress MixedOperand |
384 | 370 | */ |
385 | - public static function update(SplFixedArray $ctx, SplFixedArray $p, $plen) |
|
386 | - { |
|
371 | + public static function update(SplFixedArray $ctx, SplFixedArray $p, $plen) { |
|
387 | 372 | self::pseudoConstructor(); |
388 | 373 | |
389 | 374 | $offset = 0; |
@@ -446,8 +431,7 @@ discard block |
||
446 | 431 | * @psalm-suppress MixedMethodCall |
447 | 432 | * @psalm-suppress MixedOperand |
448 | 433 | */ |
449 | - public static function finish(SplFixedArray $ctx, SplFixedArray $out) |
|
450 | - { |
|
434 | + public static function finish(SplFixedArray $ctx, SplFixedArray $out) { |
|
451 | 435 | self::pseudoConstructor(); |
452 | 436 | if ($ctx[4] > 128) { |
453 | 437 | self::increment_counter($ctx, 128); |
@@ -579,8 +563,7 @@ discard block |
||
579 | 563 | * @return SplFixedArray |
580 | 564 | * @psalm-suppress MixedArgumentTypeCoercion |
581 | 565 | */ |
582 | - public static function stringToSplFixedArray($str = '') |
|
583 | - { |
|
566 | + public static function stringToSplFixedArray($str = '') { |
|
584 | 567 | $values = unpack('C*', $str); |
585 | 568 | return SplFixedArray::fromArray(array_values($values)); |
586 | 569 | } |
@@ -593,8 +576,7 @@ discard block |
||
593 | 576 | * @param SplFixedArray $a |
594 | 577 | * @return string |
595 | 578 | */ |
596 | - public static function SplFixedArrayToString(SplFixedArray $a) |
|
597 | - { |
|
579 | + public static function SplFixedArrayToString(SplFixedArray $a) { |
|
598 | 580 | /** |
599 | 581 | * @var array<int, string|int> |
600 | 582 | */ |
@@ -615,8 +597,7 @@ discard block |
||
615 | 597 | * @psalm-suppress MixedArrayAssignment |
616 | 598 | * @psalm-suppress MixedMethodCall |
617 | 599 | */ |
618 | - public static function contextToString(SplFixedArray $ctx) |
|
619 | - { |
|
600 | + public static function contextToString(SplFixedArray $ctx) { |
|
620 | 601 | $str = ''; |
621 | 602 | /** @var array<int, ParagonIE_Sodium_Core32_Int64> $ctxA */ |
622 | 603 | $ctxA = $ctx[0]->toArray(); |
@@ -682,8 +663,7 @@ discard block |
||
682 | 663 | * @psalm-suppress MixedArrayAccess |
683 | 664 | * @psalm-suppress MixedArrayAssignment |
684 | 665 | */ |
685 | - public static function stringToContext($string) |
|
686 | - { |
|
666 | + public static function stringToContext($string) { |
|
687 | 667 | $ctx = self::context(); |
688 | 668 | |
689 | 669 | # uint64_t h[8]; |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_Ed25519 |
9 | 9 | */ |
10 | -abstract class ParagonIE_Sodium_Core32_Ed25519 extends ParagonIE_Sodium_Core32_Curve25519 |
|
11 | -{ |
|
10 | +abstract class ParagonIE_Sodium_Core32_Ed25519 extends ParagonIE_Sodium_Core32_Curve25519 { |
|
12 | 11 | const KEYPAIR_BYTES = 96; |
13 | 12 | const SEED_BYTES = 32; |
14 | 13 | |
@@ -20,8 +19,7 @@ discard block |
||
20 | 19 | * @throws SodiumException |
21 | 20 | * @throws TypeError |
22 | 21 | */ |
23 | - public static function keypair() |
|
24 | - { |
|
22 | + public static function keypair() { |
|
25 | 23 | $seed = random_bytes(self::SEED_BYTES); |
26 | 24 | $pk = ''; |
27 | 25 | $sk = ''; |
@@ -39,8 +37,7 @@ discard block |
||
39 | 37 | * @throws SodiumException |
40 | 38 | * @throws TypeError |
41 | 39 | */ |
42 | - public static function seed_keypair(&$pk, &$sk, $seed) |
|
43 | - { |
|
40 | + public static function seed_keypair(&$pk, &$sk, $seed) { |
|
44 | 41 | if (self::strlen($seed) !== self::SEED_BYTES) { |
45 | 42 | throw new RangeException('crypto_sign keypair seed must be 32 bytes long'); |
46 | 43 | } |
@@ -58,8 +55,7 @@ discard block |
||
58 | 55 | * @return string |
59 | 56 | * @throws TypeError |
60 | 57 | */ |
61 | - public static function secretkey($keypair) |
|
62 | - { |
|
58 | + public static function secretkey($keypair) { |
|
63 | 59 | if (self::strlen($keypair) !== self::KEYPAIR_BYTES) { |
64 | 60 | throw new RangeException('crypto_sign keypair must be 96 bytes long'); |
65 | 61 | } |
@@ -74,8 +70,7 @@ discard block |
||
74 | 70 | * @throws RangeException |
75 | 71 | * @throws TypeError |
76 | 72 | */ |
77 | - public static function publickey($keypair) |
|
78 | - { |
|
73 | + public static function publickey($keypair) { |
|
79 | 74 | if (self::strlen($keypair) !== self::KEYPAIR_BYTES) { |
80 | 75 | throw new RangeException('crypto_sign keypair must be 96 bytes long'); |
81 | 76 | } |
@@ -90,8 +85,7 @@ discard block |
||
90 | 85 | * @throws SodiumException |
91 | 86 | * @throws TypeError |
92 | 87 | */ |
93 | - public static function publickey_from_secretkey($sk) |
|
94 | - { |
|
88 | + public static function publickey_from_secretkey($sk) { |
|
95 | 89 | /** @var string $sk */ |
96 | 90 | $sk = hash('sha512', self::substr($sk, 0, 32), true); |
97 | 91 | $sk[0] = self::intToChr( |
@@ -109,8 +103,7 @@ discard block |
||
109 | 103 | * @throws SodiumException |
110 | 104 | * @throws TypeError |
111 | 105 | */ |
112 | - public static function pk_to_curve25519($pk) |
|
113 | - { |
|
106 | + public static function pk_to_curve25519($pk) { |
|
114 | 107 | if (self::small_order($pk)) { |
115 | 108 | throw new SodiumException('Public key is on a small order'); |
116 | 109 | } |
@@ -151,8 +144,7 @@ discard block |
||
151 | 144 | * @throws SodiumException |
152 | 145 | * @throws TypeError |
153 | 146 | */ |
154 | - public static function sk_to_pk($sk) |
|
155 | - { |
|
147 | + public static function sk_to_pk($sk) { |
|
156 | 148 | return self::ge_p3_tobytes( |
157 | 149 | self::ge_scalarmult_base( |
158 | 150 | self::substr($sk, 0, 32) |
@@ -169,8 +161,7 @@ discard block |
||
169 | 161 | * @throws SodiumException |
170 | 162 | * @throws TypeError |
171 | 163 | */ |
172 | - public static function sign($message, $sk) |
|
173 | - { |
|
164 | + public static function sign($message, $sk) { |
|
174 | 165 | /** @var string $signature */ |
175 | 166 | $signature = self::sign_detached($message, $sk); |
176 | 167 | return $signature . $message; |
@@ -185,8 +176,7 @@ discard block |
||
185 | 176 | * @throws SodiumException |
186 | 177 | * @throws TypeError |
187 | 178 | */ |
188 | - public static function sign_open($message, $pk) |
|
189 | - { |
|
179 | + public static function sign_open($message, $pk) { |
|
190 | 180 | /** @var string $signature */ |
191 | 181 | $signature = self::substr($message, 0, 64); |
192 | 182 | |
@@ -209,8 +199,7 @@ discard block |
||
209 | 199 | * @throws TypeError |
210 | 200 | * @psalm-suppress PossiblyInvalidArgument |
211 | 201 | */ |
212 | - public static function sign_detached($message, $sk) |
|
213 | - { |
|
202 | + public static function sign_detached($message, $sk) { |
|
214 | 203 | # crypto_hash_sha512(az, sk, 32); |
215 | 204 | $az = hash('sha512', self::substr($sk, 0, 32), true); |
216 | 205 | |
@@ -274,8 +263,7 @@ discard block |
||
274 | 263 | * @throws SodiumException |
275 | 264 | * @throws TypeError |
276 | 265 | */ |
277 | - public static function verify_detached($sig, $message, $pk) |
|
278 | - { |
|
266 | + public static function verify_detached($sig, $message, $pk) { |
|
279 | 267 | if (self::strlen($sig) < 64) { |
280 | 268 | throw new SodiumException('Signature is too short'); |
281 | 269 | } |
@@ -341,8 +329,7 @@ discard block |
||
341 | 329 | * @throws SodiumException |
342 | 330 | * @throws TypeError |
343 | 331 | */ |
344 | - public static function check_S_lt_L($S) |
|
345 | - { |
|
332 | + public static function check_S_lt_L($S) { |
|
346 | 333 | if (self::strlen($S) < 32) { |
347 | 334 | throw new SodiumException('Signature must be 32 bytes'); |
348 | 335 | } |
@@ -377,8 +364,7 @@ discard block |
||
377 | 364 | * @throws SodiumException |
378 | 365 | * @throws TypeError |
379 | 366 | */ |
380 | - public static function small_order($R) |
|
381 | - { |
|
367 | + public static function small_order($R) { |
|
382 | 368 | static $blocklist = array( |
383 | 369 | /* 0 (order 4) */ |
384 | 370 | array( |
@@ -7,7 +7,6 @@ |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core_Util |
9 | 9 | */ |
10 | -abstract class ParagonIE_Sodium_Core32_Util extends ParagonIE_Sodium_Core_Util |
|
11 | -{ |
|
10 | +abstract class ParagonIE_Sodium_Core32_Util extends ParagonIE_Sodium_Core_Util { |
|
12 | 11 | |
13 | 12 | } |
@@ -9,16 +9,14 @@ discard block |
||
9 | 9 | * |
10 | 10 | * Only uses 32-bit arithmetic, while the original SipHash used 64-bit integers |
11 | 11 | */ |
12 | -class ParagonIE_Sodium_Core32_SipHash extends ParagonIE_Sodium_Core32_Util |
|
13 | -{ |
|
12 | +class ParagonIE_Sodium_Core32_SipHash extends ParagonIE_Sodium_Core32_Util { |
|
14 | 13 | /** |
15 | 14 | * @internal You should not use this directly from another application |
16 | 15 | * |
17 | 16 | * @param array<int, ParagonIE_Sodium_Core32_Int64> $v |
18 | 17 | * @return array<int, ParagonIE_Sodium_Core32_Int64> |
19 | 18 | */ |
20 | - public static function sipRound(array $v) |
|
21 | - { |
|
19 | + public static function sipRound(array $v) { |
|
22 | 20 | # v0 += v1; |
23 | 21 | $v[0] = $v[0]->addInt64($v[1]); |
24 | 22 | |
@@ -73,8 +71,7 @@ discard block |
||
73 | 71 | * @throws SodiumException |
74 | 72 | * @throws TypeError |
75 | 73 | */ |
76 | - public static function sipHash24($in, $key) |
|
77 | - { |
|
74 | + public static function sipHash24($in, $key) { |
|
78 | 75 | $inlen = self::strlen($in); |
79 | 76 | |
80 | 77 | # /* "somepseudorandomlygeneratedbytes" */ |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_XChaCha20 |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core32_XChaCha20 extends ParagonIE_Sodium_Core32_HChaCha20 |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core32_XChaCha20 extends ParagonIE_Sodium_Core32_HChaCha20 { |
|
12 | 11 | /** |
13 | 12 | * @internal You should not use this directly from another application |
14 | 13 | * |
@@ -19,8 +18,7 @@ discard block |
||
19 | 18 | * @throws SodiumException |
20 | 19 | * @throws TypeError |
21 | 20 | */ |
22 | - public static function stream($len = 64, $nonce = '', $key = '') |
|
23 | - { |
|
21 | + public static function stream($len = 64, $nonce = '', $key = '') { |
|
24 | 22 | if (self::strlen($nonce) !== 24) { |
25 | 23 | throw new SodiumException('Nonce must be 24 bytes long'); |
26 | 24 | } |
@@ -47,8 +45,7 @@ discard block |
||
47 | 45 | * @throws SodiumException |
48 | 46 | * @throws TypeError |
49 | 47 | */ |
50 | - public static function streamXorIc($message, $nonce = '', $key = '', $ic = '') |
|
51 | - { |
|
48 | + public static function streamXorIc($message, $nonce = '', $key = '', $ic = '') { |
|
52 | 49 | if (self::strlen($nonce) !== 24) { |
53 | 50 | throw new SodiumException('Nonce must be 24 bytes long'); |
54 | 51 | } |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_X25519 |
9 | 9 | */ |
10 | -abstract class ParagonIE_Sodium_Core32_X25519 extends ParagonIE_Sodium_Core32_Curve25519 |
|
11 | -{ |
|
10 | +abstract class ParagonIE_Sodium_Core32_X25519 extends ParagonIE_Sodium_Core32_Curve25519 { |
|
12 | 11 | /** |
13 | 12 | * Alters the objects passed to this method in place. |
14 | 13 | * |
@@ -100,8 +99,7 @@ discard block |
||
100 | 99 | * @psalm-suppress MixedAssignment |
101 | 100 | * @psalm-suppress MixedMethodCall |
102 | 101 | */ |
103 | - public static function fe_mul121666(ParagonIE_Sodium_Core32_Curve25519_Fe $f) |
|
104 | - { |
|
102 | + public static function fe_mul121666(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { |
|
105 | 103 | /** @var array<int, ParagonIE_Sodium_Core32_Int64> $h */ |
106 | 104 | $h = array(); |
107 | 105 | for ($i = 0; $i < 10; ++$i) { |
@@ -167,8 +165,7 @@ discard block |
||
167 | 165 | * @throws SodiumException |
168 | 166 | * @throws TypeError |
169 | 167 | */ |
170 | - public static function crypto_scalarmult_curve25519_ref10($n, $p) |
|
171 | - { |
|
168 | + public static function crypto_scalarmult_curve25519_ref10($n, $p) { |
|
172 | 169 | # for (i = 0;i < 32;++i) e[i] = n[i]; |
173 | 170 | $e = '' . $n; |
174 | 171 | # e[0] &= 248; |
@@ -315,8 +312,7 @@ discard block |
||
315 | 312 | * @throws SodiumException |
316 | 313 | * @throws TypeError |
317 | 314 | */ |
318 | - public static function crypto_scalarmult_curve25519_ref10_base($n) |
|
319 | - { |
|
315 | + public static function crypto_scalarmult_curve25519_ref10_base($n) { |
|
320 | 316 | # for (i = 0;i < 32;++i) e[i] = n[i]; |
321 | 317 | $e = '' . $n; |
322 | 318 |