@@ -7,8 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P3 |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_P3 |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_P3 { |
|
12 | 11 | /** |
13 | 12 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
14 | 13 | */ |
@@ -7,8 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P2 |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_P2 |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_P2 { |
|
12 | 11 | /** |
13 | 12 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
14 | 13 | */ |
@@ -6,8 +6,7 @@ |
||
6 | 6 | /** |
7 | 7 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 |
8 | 8 | */ |
9 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 |
|
10 | -{ |
|
9 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 { |
|
11 | 10 | /** |
12 | 11 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
13 | 12 | */ |
@@ -7,8 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_Cached |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_Cached |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_Cached { |
|
12 | 11 | /** |
13 | 12 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
14 | 13 | */ |
@@ -7,8 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp { |
|
12 | 11 | /** |
13 | 12 | * @var ParagonIE_Sodium_Core32_Curve25519_Fe |
14 | 13 | */ |
@@ -13,8 +13,7 @@ discard block |
||
13 | 13 | * |
14 | 14 | * @ref https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c |
15 | 15 | */ |
16 | -abstract class ParagonIE_Sodium_Core32_Curve25519 extends ParagonIE_Sodium_Core32_Curve25519_H |
|
17 | -{ |
|
16 | +abstract class ParagonIE_Sodium_Core32_Curve25519 extends ParagonIE_Sodium_Core32_Curve25519_H { |
|
18 | 17 | /** |
19 | 18 | * Get a field element of size 10 with a value of 0 |
20 | 19 | * |
@@ -24,8 +23,7 @@ discard block |
||
24 | 23 | * @throws SodiumException |
25 | 24 | * @throws TypeError |
26 | 25 | */ |
27 | - public static function fe_0() |
|
28 | - { |
|
26 | + public static function fe_0() { |
|
29 | 27 | return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( |
30 | 28 | array( |
31 | 29 | new ParagonIE_Sodium_Core32_Int32(), |
@@ -51,8 +49,7 @@ discard block |
||
51 | 49 | * @throws SodiumException |
52 | 50 | * @throws TypeError |
53 | 51 | */ |
54 | - public static function fe_1() |
|
55 | - { |
|
52 | + public static function fe_1() { |
|
56 | 53 | return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( |
57 | 54 | array( |
58 | 55 | ParagonIE_Sodium_Core32_Int32::fromInt(1), |
@@ -138,8 +135,7 @@ discard block |
||
138 | 135 | * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f |
139 | 136 | * @return ParagonIE_Sodium_Core32_Curve25519_Fe |
140 | 137 | */ |
141 | - public static function fe_copy(ParagonIE_Sodium_Core32_Curve25519_Fe $f) |
|
142 | - { |
|
138 | + public static function fe_copy(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { |
|
143 | 139 | $h = clone $f; |
144 | 140 | return $h; |
145 | 141 | } |
@@ -157,8 +153,7 @@ discard block |
||
157 | 153 | * @throws TypeError |
158 | 154 | * @psalm-suppress MixedMethodCall |
159 | 155 | */ |
160 | - public static function fe_frombytes($s) |
|
161 | - { |
|
156 | + public static function fe_frombytes($s) { |
|
162 | 157 | if (self::strlen($s) !== 32) { |
163 | 158 | throw new RangeException('Expected a 32-byte string.'); |
164 | 159 | } |
@@ -260,8 +255,7 @@ discard block |
||
260 | 255 | * @psalm-suppress MixedAssignment |
261 | 256 | * @psalm-suppress MixedMethodCall |
262 | 257 | */ |
263 | - public static function fe_tobytes(ParagonIE_Sodium_Core32_Curve25519_Fe $h) |
|
264 | - { |
|
258 | + public static function fe_tobytes(ParagonIE_Sodium_Core32_Curve25519_Fe $h) { |
|
265 | 259 | /** |
266 | 260 | * @var ParagonIE_Sodium_Core32_Int64[] $f |
267 | 261 | * @var ParagonIE_Sodium_Core32_Int64 $q |
@@ -396,8 +390,7 @@ discard block |
||
396 | 390 | * @throws SodiumException |
397 | 391 | * @throws TypeError |
398 | 392 | */ |
399 | - public static function fe_isnegative(ParagonIE_Sodium_Core32_Curve25519_Fe $f) |
|
400 | - { |
|
393 | + public static function fe_isnegative(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { |
|
401 | 394 | $str = self::fe_tobytes($f); |
402 | 395 | return (int) (self::chrToInt($str[0]) & 1); |
403 | 396 | } |
@@ -412,8 +405,7 @@ discard block |
||
412 | 405 | * @throws SodiumException |
413 | 406 | * @throws TypeError |
414 | 407 | */ |
415 | - public static function fe_isnonzero(ParagonIE_Sodium_Core32_Curve25519_Fe $f) |
|
416 | - { |
|
408 | + public static function fe_isnonzero(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { |
|
417 | 409 | static $zero; |
418 | 410 | if ($zero === null) { |
419 | 411 | $zero = str_repeat("\x00", 32); |
@@ -751,8 +743,7 @@ discard block |
||
751 | 743 | * @psalm-suppress MixedAssignment |
752 | 744 | * @psalm-suppress MixedMethodCall |
753 | 745 | */ |
754 | - public static function fe_neg(ParagonIE_Sodium_Core32_Curve25519_Fe $f) |
|
755 | - { |
|
746 | + public static function fe_neg(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { |
|
756 | 747 | $h = new ParagonIE_Sodium_Core32_Curve25519_Fe(); |
757 | 748 | for ($i = 0; $i < 10; ++$i) { |
758 | 749 | $h[$i] = $h[$i]->subInt32($f[$i]); |
@@ -773,8 +764,7 @@ discard block |
||
773 | 764 | * @throws TypeError |
774 | 765 | * @psalm-suppress MixedMethodCall |
775 | 766 | */ |
776 | - public static function fe_sq(ParagonIE_Sodium_Core32_Curve25519_Fe $f) |
|
777 | - { |
|
767 | + public static function fe_sq(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { |
|
778 | 768 | /** @var ParagonIE_Sodium_Core32_Int64 $f0 */ |
779 | 769 | $f0 = $f[0]->toInt64(); |
780 | 770 | /** @var ParagonIE_Sodium_Core32_Int64 $f1 */ |
@@ -977,8 +967,7 @@ discard block |
||
977 | 967 | * @throws TypeError |
978 | 968 | * @psalm-suppress MixedMethodCall |
979 | 969 | */ |
980 | - public static function fe_sq2(ParagonIE_Sodium_Core32_Curve25519_Fe $f) |
|
981 | - { |
|
970 | + public static function fe_sq2(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { |
|
982 | 971 | /** @var ParagonIE_Sodium_Core32_Int64 $f0 */ |
983 | 972 | $f0 = $f[0]->toInt64(); |
984 | 973 | /** @var ParagonIE_Sodium_Core32_Int64 $f1 */ |
@@ -1170,8 +1159,7 @@ discard block |
||
1170 | 1159 | * @throws SodiumException |
1171 | 1160 | * @throws TypeError |
1172 | 1161 | */ |
1173 | - public static function fe_invert(ParagonIE_Sodium_Core32_Curve25519_Fe $Z) |
|
1174 | - { |
|
1162 | + public static function fe_invert(ParagonIE_Sodium_Core32_Curve25519_Fe $Z) { |
|
1175 | 1163 | $z = clone $Z; |
1176 | 1164 | $t0 = self::fe_sq($z); |
1177 | 1165 | $t1 = self::fe_sq($t0); |
@@ -1232,8 +1220,7 @@ discard block |
||
1232 | 1220 | * @throws SodiumException |
1233 | 1221 | * @throws TypeError |
1234 | 1222 | */ |
1235 | - public static function fe_pow22523(ParagonIE_Sodium_Core32_Curve25519_Fe $z) |
|
1236 | - { |
|
1223 | + public static function fe_pow22523(ParagonIE_Sodium_Core32_Curve25519_Fe $z) { |
|
1237 | 1224 | # fe_sq(t0, z); |
1238 | 1225 | # fe_sq(t1, t0); |
1239 | 1226 | # fe_sq(t1, t1); |
@@ -1362,8 +1349,7 @@ discard block |
||
1362 | 1349 | * @psalm-suppress MixedMethodCall |
1363 | 1350 | * @psalm-suppress MixedTypeCoercion |
1364 | 1351 | */ |
1365 | - public static function fe_sub(ParagonIE_Sodium_Core32_Curve25519_Fe $f, ParagonIE_Sodium_Core32_Curve25519_Fe $g) |
|
1366 | - { |
|
1352 | + public static function fe_sub(ParagonIE_Sodium_Core32_Curve25519_Fe $f, ParagonIE_Sodium_Core32_Curve25519_Fe $g) { |
|
1367 | 1353 | return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( |
1368 | 1354 | array( |
1369 | 1355 | $f[0]->subInt32($g[0]), |
@@ -1422,8 +1408,7 @@ discard block |
||
1422 | 1408 | * @throws TypeError |
1423 | 1409 | * @psalm-suppress MixedArrayOffset |
1424 | 1410 | */ |
1425 | - public static function slide($a) |
|
1426 | - { |
|
1411 | + public static function slide($a) { |
|
1427 | 1412 | if (self::strlen($a) < 256) { |
1428 | 1413 | if (self::strlen($a) < 16) { |
1429 | 1414 | $a = str_pad($a, 256, '0', STR_PAD_RIGHT); |
@@ -1475,8 +1460,7 @@ discard block |
||
1475 | 1460 | * @throws SodiumException |
1476 | 1461 | * @throws TypeError |
1477 | 1462 | */ |
1478 | - public static function ge_frombytes_negate_vartime($s) |
|
1479 | - { |
|
1463 | + public static function ge_frombytes_negate_vartime($s) { |
|
1480 | 1464 | static $d = null; |
1481 | 1465 | if (!$d) { |
1482 | 1466 | /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d */ |
@@ -1639,8 +1623,7 @@ discard block |
||
1639 | 1623 | * @throws SodiumException |
1640 | 1624 | * @throws TypeError |
1641 | 1625 | */ |
1642 | - public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p) |
|
1643 | - { |
|
1626 | + public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p) { |
|
1644 | 1627 | $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P2(); |
1645 | 1628 | $r->X = self::fe_mul($p->X, $p->T); |
1646 | 1629 | $r->Y = self::fe_mul($p->Y, $p->Z); |
@@ -1656,8 +1639,7 @@ discard block |
||
1656 | 1639 | * @throws SodiumException |
1657 | 1640 | * @throws TypeError |
1658 | 1641 | */ |
1659 | - public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p) |
|
1660 | - { |
|
1642 | + public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p) { |
|
1661 | 1643 | $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P3(); |
1662 | 1644 | $r->X = self::fe_mul($p->X, $p->T); |
1663 | 1645 | $r->Y = self::fe_mul($p->Y, $p->Z); |
@@ -1673,8 +1655,7 @@ discard block |
||
1673 | 1655 | * @throws SodiumException |
1674 | 1656 | * @throws TypeError |
1675 | 1657 | */ |
1676 | - public static function ge_p2_0() |
|
1677 | - { |
|
1658 | + public static function ge_p2_0() { |
|
1678 | 1659 | return new ParagonIE_Sodium_Core32_Curve25519_Ge_P2( |
1679 | 1660 | self::fe_0(), |
1680 | 1661 | self::fe_1(), |
@@ -1690,8 +1671,7 @@ discard block |
||
1690 | 1671 | * @throws SodiumException |
1691 | 1672 | * @throws TypeError |
1692 | 1673 | */ |
1693 | - public static function ge_p2_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $p) |
|
1694 | - { |
|
1674 | + public static function ge_p2_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $p) { |
|
1695 | 1675 | $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); |
1696 | 1676 | |
1697 | 1677 | $r->X = self::fe_sq($p->X); |
@@ -1714,8 +1694,7 @@ discard block |
||
1714 | 1694 | * @throws SodiumException |
1715 | 1695 | * @throws TypeError |
1716 | 1696 | */ |
1717 | - public static function ge_p3_0() |
|
1718 | - { |
|
1697 | + public static function ge_p3_0() { |
|
1719 | 1698 | return new ParagonIE_Sodium_Core32_Curve25519_Ge_P3( |
1720 | 1699 | self::fe_0(), |
1721 | 1700 | self::fe_1(), |
@@ -1732,8 +1711,7 @@ discard block |
||
1732 | 1711 | * @throws SodiumException |
1733 | 1712 | * @throws TypeError |
1734 | 1713 | */ |
1735 | - public static function ge_p3_to_cached(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) |
|
1736 | - { |
|
1714 | + public static function ge_p3_to_cached(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) { |
|
1737 | 1715 | static $d2 = null; |
1738 | 1716 | if ($d2 === null) { |
1739 | 1717 | $d2 = ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( |
@@ -1766,8 +1744,7 @@ discard block |
||
1766 | 1744 | * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p |
1767 | 1745 | * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 |
1768 | 1746 | */ |
1769 | - public static function ge_p3_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) |
|
1770 | - { |
|
1747 | + public static function ge_p3_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) { |
|
1771 | 1748 | return new ParagonIE_Sodium_Core32_Curve25519_Ge_P2( |
1772 | 1749 | $p->X, |
1773 | 1750 | $p->Y, |
@@ -1783,8 +1760,7 @@ discard block |
||
1783 | 1760 | * @throws SodiumException |
1784 | 1761 | * @throws TypeError |
1785 | 1762 | */ |
1786 | - public static function ge_p3_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h) |
|
1787 | - { |
|
1763 | + public static function ge_p3_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h) { |
|
1788 | 1764 | $recip = self::fe_invert($h->Z); |
1789 | 1765 | $x = self::fe_mul($h->X, $recip); |
1790 | 1766 | $y = self::fe_mul($h->Y, $recip); |
@@ -1803,8 +1779,7 @@ discard block |
||
1803 | 1779 | * @throws SodiumException |
1804 | 1780 | * @throws TypeError |
1805 | 1781 | */ |
1806 | - public static function ge_p3_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) |
|
1807 | - { |
|
1782 | + public static function ge_p3_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) { |
|
1808 | 1783 | $q = self::ge_p3_to_p2($p); |
1809 | 1784 | return self::ge_p2_dbl($q); |
1810 | 1785 | } |
@@ -1814,8 +1789,7 @@ discard block |
||
1814 | 1789 | * @throws SodiumException |
1815 | 1790 | * @throws TypeError |
1816 | 1791 | */ |
1817 | - public static function ge_precomp_0() |
|
1818 | - { |
|
1792 | + public static function ge_precomp_0() { |
|
1819 | 1793 | return new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( |
1820 | 1794 | self::fe_1(), |
1821 | 1795 | self::fe_1(), |
@@ -1831,8 +1805,7 @@ discard block |
||
1831 | 1805 | * @return int |
1832 | 1806 | * @psalm-suppress MixedReturnStatement |
1833 | 1807 | */ |
1834 | - public static function equal($b, $c) |
|
1835 | - { |
|
1808 | + public static function equal($b, $c) { |
|
1836 | 1809 | return (int) ((($b ^ $c) - 1 & 0xffffffff) >> 31); |
1837 | 1810 | } |
1838 | 1811 | |
@@ -1844,8 +1817,7 @@ discard block |
||
1844 | 1817 | * @throws SodiumException |
1845 | 1818 | * @throws TypeError |
1846 | 1819 | */ |
1847 | - public static function negative($char) |
|
1848 | - { |
|
1820 | + public static function negative($char) { |
|
1849 | 1821 | if (is_int($char)) { |
1850 | 1822 | return $char < 0 ? 1 : 0; |
1851 | 1823 | } |
@@ -1894,8 +1866,7 @@ discard block |
||
1894 | 1866 | * @psalm-suppress MixedArrayOffset |
1895 | 1867 | * @psalm-suppress MixedArgument |
1896 | 1868 | */ |
1897 | - public static function ge_select($pos = 0, $b = 0) |
|
1898 | - { |
|
1869 | + public static function ge_select($pos = 0, $b = 0) { |
|
1899 | 1870 | static $base = null; |
1900 | 1871 | if ($base === null) { |
1901 | 1872 | $base = array(); |
@@ -2017,8 +1988,7 @@ discard block |
||
2017 | 1988 | * @throws SodiumException |
2018 | 1989 | * @throws TypeError |
2019 | 1990 | */ |
2020 | - public static function ge_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $h) |
|
2021 | - { |
|
1991 | + public static function ge_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $h) { |
|
2022 | 1992 | $recip = self::fe_invert($h->Z); |
2023 | 1993 | $x = self::fe_mul($h->X, $recip); |
2024 | 1994 | $y = self::fe_mul($h->Y, $recip); |
@@ -2213,8 +2183,7 @@ discard block |
||
2213 | 2183 | * @throws SodiumException |
2214 | 2184 | * @throws TypeError |
2215 | 2185 | */ |
2216 | - public static function ge_scalarmult_base($a) |
|
2217 | - { |
|
2186 | + public static function ge_scalarmult_base($a) { |
|
2218 | 2187 | /** @var array<int, int> $e */ |
2219 | 2188 | $e = array(); |
2220 | 2189 | $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); |
@@ -2280,8 +2249,7 @@ discard block |
||
2280 | 2249 | * @throws SodiumException |
2281 | 2250 | * @throws TypeError |
2282 | 2251 | */ |
2283 | - public static function sc_muladd($a, $b, $c) |
|
2284 | - { |
|
2252 | + public static function sc_muladd($a, $b, $c) { |
|
2285 | 2253 | $a0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($a, 0, 3))); |
2286 | 2254 | $a1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5)); |
2287 | 2255 | $a2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2)); |
@@ -2781,8 +2749,7 @@ discard block |
||
2781 | 2749 | * @throws SodiumException |
2782 | 2750 | * @throws TypeError |
2783 | 2751 | */ |
2784 | - public static function sc_reduce($s) |
|
2785 | - { |
|
2752 | + public static function sc_reduce($s) { |
|
2786 | 2753 | /** |
2787 | 2754 | * @var ParagonIE_Sodium_Core32_Int64 $s0 |
2788 | 2755 | * @var ParagonIE_Sodium_Core32_Int64 $s1 |
@@ -3138,8 +3105,7 @@ discard block |
||
3138 | 3105 | * @throws SodiumException |
3139 | 3106 | * @throws TypeError |
3140 | 3107 | */ |
3141 | - public static function ge_mul_l(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A) |
|
3142 | - { |
|
3108 | + public static function ge_mul_l(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A) { |
|
3143 | 3109 | /** @var array<int, int> $aslide */ |
3144 | 3110 | $aslide = array( |
3145 | 3111 | 13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_ChaCha20_Ctx |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core32_ChaCha20_Ctx extends ParagonIE_Sodium_Core32_Util implements ArrayAccess |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core32_ChaCha20_Ctx extends ParagonIE_Sodium_Core32_Util implements ArrayAccess { |
|
12 | 11 | /** |
13 | 12 | * @var SplFixedArray internally, <int, ParagonIE_Sodium_Core32_Int32> |
14 | 13 | */ |
@@ -27,8 +26,7 @@ discard block |
||
27 | 26 | * @throws SodiumException |
28 | 27 | * @throws TypeError |
29 | 28 | */ |
30 | - public function __construct($key = '', $iv = '', $counter = '') |
|
31 | - { |
|
29 | + public function __construct($key = '', $iv = '', $counter = '') { |
|
32 | 30 | if (self::strlen($key) !== 32) { |
33 | 31 | throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.'); |
34 | 32 | } |
@@ -71,8 +69,7 @@ discard block |
||
71 | 69 | * @return void |
72 | 70 | */ |
73 | 71 | #[ReturnTypeWillChange] |
74 | - public function offsetSet($offset, $value) |
|
75 | - { |
|
72 | + public function offsetSet($offset, $value) { |
|
76 | 73 | if (!is_int($offset)) { |
77 | 74 | throw new InvalidArgumentException('Expected an integer'); |
78 | 75 | } |
@@ -95,8 +92,7 @@ discard block |
||
95 | 92 | * @psalm-suppress MixedArrayOffset |
96 | 93 | */ |
97 | 94 | #[ReturnTypeWillChange] |
98 | - public function offsetExists($offset) |
|
99 | - { |
|
95 | + public function offsetExists($offset) { |
|
100 | 96 | return isset($this->container[$offset]); |
101 | 97 | } |
102 | 98 | |
@@ -108,8 +104,7 @@ discard block |
||
108 | 104 | * @psalm-suppress MixedArrayOffset |
109 | 105 | */ |
110 | 106 | #[ReturnTypeWillChange] |
111 | - public function offsetUnset($offset) |
|
112 | - { |
|
107 | + public function offsetUnset($offset) { |
|
113 | 108 | unset($this->container[$offset]); |
114 | 109 | } |
115 | 110 | |
@@ -121,8 +116,7 @@ discard block |
||
121 | 116 | * @psalm-suppress MixedArrayOffset |
122 | 117 | */ |
123 | 118 | #[ReturnTypeWillChange] |
124 | - public function offsetGet($offset) |
|
125 | - { |
|
119 | + public function offsetGet($offset) { |
|
126 | 120 | return isset($this->container[$offset]) |
127 | 121 | ? $this->container[$offset] |
128 | 122 | : null; |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx |
9 | 9 | */ |
10 | -class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core32_ChaCha20_Ctx |
|
11 | -{ |
|
10 | +class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core32_ChaCha20_Ctx { |
|
12 | 11 | /** |
13 | 12 | * ParagonIE_Sodium_Core_ChaCha20_IetfCtx constructor. |
14 | 13 | * |
@@ -22,8 +21,7 @@ discard block |
||
22 | 21 | * @throws SodiumException |
23 | 22 | * @throws TypeError |
24 | 23 | */ |
25 | - public function __construct($key = '', $iv = '', $counter = '') |
|
26 | - { |
|
24 | + public function __construct($key = '', $iv = '', $counter = '') { |
|
27 | 25 | if (self::strlen($iv) !== 12) { |
28 | 26 | throw new InvalidArgumentException('ChaCha20 expects a 96-bit nonce in IETF mode.'); |
29 | 27 | } |
@@ -2,6 +2,5 @@ |
||
2 | 2 | |
3 | 3 | namespace Psr\Log; |
4 | 4 | |
5 | -class InvalidArgumentException extends \InvalidArgumentException |
|
6 | -{ |
|
5 | +class InvalidArgumentException extends \InvalidArgumentException { |
|
7 | 6 | } |