Completed
Push — develop ( 045e9f...7fb967 )
by Zack
17:47
created
vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Cached.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace ParagonIE\Sodium\Core\Curve25519\Ge;
3 3
 
4
-class Cached extends \ParagonIE_Sodium_Core_Curve25519_Ge_Cached
5
-{
4
+class Cached extends \ParagonIE_Sodium_Core_Curve25519_Ge_Cached {
6 5
 
7 6
 }
Please login to merge, or discard this patch.
vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Precomp.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace ParagonIE\Sodium\Core\Curve25519\Ge;
3 3
 
4
-class Precomp extends \ParagonIE_Sodium_Core_Curve25519_Ge_Precomp
5
-{
4
+class Precomp extends \ParagonIE_Sodium_Core_Curve25519_Ge_Precomp {
6 5
 
7 6
 }
Please login to merge, or discard this patch.
vendor/paragonie/sodium_compat/namespaced/Core/Curve25519.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace ParagonIE\Sodium\Core;
3 3
 
4
-class Curve25519 extends \ParagonIE_Sodium_Core_Curve25519
5
-{
4
+class Curve25519 extends \ParagonIE_Sodium_Core_Curve25519 {
6 5
 
7 6
 }
Please login to merge, or discard this patch.
vendor/paragonie/sodium_compat/namespaced/Core/ChaCha20/Ctx.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace ParagonIE\Sodium\Core\ChaCha20;
3 3
 
4
-class Ctx extends \ParagonIE_Sodium_Core_ChaCha20_Ctx
5
-{
4
+class Ctx extends \ParagonIE_Sodium_Core_ChaCha20_Ctx {
6 5
 
7 6
 }
Please login to merge, or discard this patch.
vendor/paragonie/sodium_compat/namespaced/Core/ChaCha20/IetfCtx.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace ParagonIE\Sodium\Core\ChaCha20;
3 3
 
4
-class IetfCtx extends \ParagonIE_Sodium_Core_ChaCha20_IetfCtx
5
-{
4
+class IetfCtx extends \ParagonIE_Sodium_Core_ChaCha20_IetfCtx {
6 5
 
7 6
 }
Please login to merge, or discard this patch.
vendor/paragonie/sodium_compat/autoload.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@
 block discarded – undo
9 9
          *
10 10
          * @return bool         Stop autoloading?
11 11
          */
12
-        function sodiumCompatAutoloader($class)
13
-        {
12
+        function sodiumCompatAutoloader($class) {
14 13
             $namespace = 'ParagonIE_Sodium_';
15 14
             // Does the class use the namespace prefix?
16 15
             $len = strlen($namespace);
Please login to merge, or discard this patch.
vendor/paragonie/sodium_compat/src/Crypto.php 1 patch
Braces   +35 added lines, -70 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
  * If you are using this library, you should be using
13 13
  * ParagonIE_Sodium_Compat in your code, not this class.
14 14
  */
15
-abstract class ParagonIE_Sodium_Crypto
16
-{
15
+abstract class ParagonIE_Sodium_Crypto {
17 16
     const aead_chacha20poly1305_KEYBYTES = 32;
18 17
     const aead_chacha20poly1305_NSECBYTES = 0;
19 18
     const aead_chacha20poly1305_NPUBBYTES = 8;
@@ -381,8 +380,7 @@  discard block
 block discarded – undo
381 380
      * @return string
382 381
      * @throws TypeError
383 382
      */
384
-    public static function auth($message, $key)
385
-    {
383
+    public static function auth($message, $key) {
386 384
         return ParagonIE_Sodium_Core_Util::substr(
387 385
             hash_hmac('sha512', $message, $key, true),
388 386
             0,
@@ -402,8 +400,7 @@  discard block
 block discarded – undo
402 400
      * @throws SodiumException
403 401
      * @throws TypeError
404 402
      */
405
-    public static function auth_verify($mac, $message, $key)
406
-    {
403
+    public static function auth_verify($mac, $message, $key) {
407 404
         return ParagonIE_Sodium_Core_Util::hashEquals(
408 405
             $mac,
409 406
             self::auth($message, $key)
@@ -422,8 +419,7 @@  discard block
 block discarded – undo
422 419
      * @throws SodiumException
423 420
      * @throws TypeError
424 421
      */
425
-    public static function box($plaintext, $nonce, $keypair)
426
-    {
422
+    public static function box($plaintext, $nonce, $keypair) {
427 423
         $c = self::secretbox(
428 424
             $plaintext,
429 425
             $nonce,
@@ -446,8 +442,7 @@  discard block
 block discarded – undo
446 442
      * @throws SodiumException
447 443
      * @throws TypeError
448 444
      */
449
-    public static function box_seal($message, $publicKey)
450
-    {
445
+    public static function box_seal($message, $publicKey) {
451 446
         /** @var string $ephemeralKeypair */
452 447
         $ephemeralKeypair = self::box_keypair();
453 448
 
@@ -492,8 +487,7 @@  discard block
 block discarded – undo
492 487
      * @throws SodiumException
493 488
      * @throws TypeError
494 489
      */
495
-    public static function box_seal_open($message, $keypair)
496
-    {
490
+    public static function box_seal_open($message, $keypair) {
497 491
         /** @var string $ephemeralPK */
498 492
         $ephemeralPK = ParagonIE_Sodium_Core_Util::substr($message, 0, 32);
499 493
 
@@ -541,8 +535,7 @@  discard block
 block discarded – undo
541 535
      * @throws SodiumException
542 536
      * @throws TypeError
543 537
      */
544
-    public static function box_beforenm($sk, $pk)
545
-    {
538
+    public static function box_beforenm($sk, $pk) {
546 539
         return ParagonIE_Sodium_Core_HSalsa20::hsalsa20(
547 540
             str_repeat("\x00", 16),
548 541
             self::scalarmult($sk, $pk)
@@ -557,8 +550,7 @@  discard block
 block discarded – undo
557 550
      * @throws SodiumException
558 551
      * @throws TypeError
559 552
      */
560
-    public static function box_keypair()
561
-    {
553
+    public static function box_keypair() {
562 554
         $sKey = random_bytes(32);
563 555
         $pKey = self::scalarmult_base($sKey);
564 556
         return $sKey . $pKey;
@@ -570,8 +562,7 @@  discard block
 block discarded – undo
570 562
      * @throws SodiumException
571 563
      * @throws TypeError
572 564
      */
573
-    public static function box_seed_keypair($seed)
574
-    {
565
+    public static function box_seed_keypair($seed) {
575 566
         $sKey = ParagonIE_Sodium_Core_Util::substr(
576 567
             hash('sha512', $seed, true),
577 568
             0,
@@ -589,8 +580,7 @@  discard block
 block discarded – undo
589 580
      * @return string
590 581
      * @throws TypeError
591 582
      */
592
-    public static function box_keypair_from_secretkey_and_publickey($sKey, $pKey)
593
-    {
583
+    public static function box_keypair_from_secretkey_and_publickey($sKey, $pKey) {
594 584
         return ParagonIE_Sodium_Core_Util::substr($sKey, 0, 32) .
595 585
             ParagonIE_Sodium_Core_Util::substr($pKey, 0, 32);
596 586
     }
@@ -603,8 +593,7 @@  discard block
 block discarded – undo
603 593
      * @throws RangeException
604 594
      * @throws TypeError
605 595
      */
606
-    public static function box_secretkey($keypair)
607
-    {
596
+    public static function box_secretkey($keypair) {
608 597
         if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== 64) {
609 598
             throw new RangeException(
610 599
                 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.'
@@ -621,8 +610,7 @@  discard block
 block discarded – undo
621 610
      * @throws RangeException
622 611
      * @throws TypeError
623 612
      */
624
-    public static function box_publickey($keypair)
625
-    {
613
+    public static function box_publickey($keypair) {
626 614
         if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) {
627 615
             throw new RangeException(
628 616
                 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.'
@@ -640,8 +628,7 @@  discard block
 block discarded – undo
640 628
      * @throws SodiumException
641 629
      * @throws TypeError
642 630
      */
643
-    public static function box_publickey_from_secretkey($sKey)
644
-    {
631
+    public static function box_publickey_from_secretkey($sKey) {
645 632
         if (ParagonIE_Sodium_Core_Util::strlen($sKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES) {
646 633
             throw new RangeException(
647 634
                 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES bytes long.'
@@ -662,8 +649,7 @@  discard block
 block discarded – undo
662 649
      * @throws SodiumException
663 650
      * @throws TypeError
664 651
      */
665
-    public static function box_open($ciphertext, $nonce, $keypair)
666
-    {
652
+    public static function box_open($ciphertext, $nonce, $keypair) {
667 653
         return self::secretbox_open(
668 654
             $ciphertext,
669 655
             $nonce,
@@ -687,8 +673,7 @@  discard block
 block discarded – undo
687 673
      * @throws SodiumException
688 674
      * @throws TypeError
689 675
      */
690
-    public static function generichash($message, $key = '', $outlen = 32)
691
-    {
676
+    public static function generichash($message, $key = '', $outlen = 32) {
692 677
         // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized
693 678
         ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor();
694 679
 
@@ -728,8 +713,7 @@  discard block
 block discarded – undo
728 713
      * @throws SodiumException
729 714
      * @throws TypeError
730 715
      */
731
-    public static function generichash_final($ctx, $outlen = 32)
732
-    {
716
+    public static function generichash_final($ctx, $outlen = 32) {
733 717
         if (!is_string($ctx)) {
734 718
             throw new TypeError('Context must be a string');
735 719
         }
@@ -758,8 +742,7 @@  discard block
 block discarded – undo
758 742
      * @throws SodiumException
759 743
      * @throws TypeError
760 744
      */
761
-    public static function generichash_init($key = '', $outputLength = 32)
762
-    {
745
+    public static function generichash_init($key = '', $outputLength = 32) {
763 746
         // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized
764 747
         ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor();
765 748
 
@@ -835,8 +818,7 @@  discard block
 block discarded – undo
835 818
      * @throws SodiumException
836 819
      * @throws TypeError
837 820
      */
838
-    public static function generichash_update($ctx, $message)
839
-    {
821
+    public static function generichash_update($ctx, $message) {
840 822
         // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized
841 823
         ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor();
842 824
 
@@ -864,8 +846,7 @@  discard block
 block discarded – undo
864 846
      * @throws SodiumException
865 847
      * @throws TypeError
866 848
      */
867
-    public static function keyExchange($my_sk, $their_pk, $client_pk, $server_pk)
868
-    {
849
+    public static function keyExchange($my_sk, $their_pk, $client_pk, $server_pk) {
869 850
         return ParagonIE_Sodium_Compat::crypto_generichash(
870 851
             ParagonIE_Sodium_Compat::crypto_scalarmult($my_sk, $their_pk) .
871 852
             $client_pk .
@@ -885,8 +866,7 @@  discard block
 block discarded – undo
885 866
      * @throws SodiumException
886 867
      * @throws TypeError
887 868
      */
888
-    public static function scalarmult($sKey, $pKey)
889
-    {
869
+    public static function scalarmult($sKey, $pKey) {
890 870
         $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10($sKey, $pKey);
891 871
         self::scalarmult_throw_if_zero($q);
892 872
         return $q;
@@ -902,8 +882,7 @@  discard block
 block discarded – undo
902 882
      * @throws SodiumException
903 883
      * @throws TypeError
904 884
      */
905
-    public static function scalarmult_base($secret)
906
-    {
885
+    public static function scalarmult_base($secret) {
907 886
         $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10_base($secret);
908 887
         self::scalarmult_throw_if_zero($q);
909 888
         return $q;
@@ -917,8 +896,7 @@  discard block
 block discarded – undo
917 896
      * @throws SodiumException
918 897
      * @throws TypeError
919 898
      */
920
-    protected static function scalarmult_throw_if_zero($q)
921
-    {
899
+    protected static function scalarmult_throw_if_zero($q) {
922 900
         $d = 0;
923 901
         for ($i = 0; $i < self::box_curve25519xsalsa20poly1305_SECRETKEYBYTES; ++$i) {
924 902
             $d |= ParagonIE_Sodium_Core_Util::chrToInt($q[$i]);
@@ -942,8 +920,7 @@  discard block
 block discarded – undo
942 920
      * @throws SodiumException
943 921
      * @throws TypeError
944 922
      */
945
-    public static function secretbox($plaintext, $nonce, $key)
946
-    {
923
+    public static function secretbox($plaintext, $nonce, $key) {
947 924
         /** @var string $subkey */
948 925
         $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key);
949 926
 
@@ -1017,8 +994,7 @@  discard block
 block discarded – undo
1017 994
      * @throws SodiumException
1018 995
      * @throws TypeError
1019 996
      */
1020
-    public static function secretbox_open($ciphertext, $nonce, $key)
1021
-    {
997
+    public static function secretbox_open($ciphertext, $nonce, $key) {
1022 998
         /** @var string $mac */
1023 999
         $mac = ParagonIE_Sodium_Core_Util::substr(
1024 1000
             $ciphertext,
@@ -1090,8 +1066,7 @@  discard block
 block discarded – undo
1090 1066
      * @throws SodiumException
1091 1067
      * @throws TypeError
1092 1068
      */
1093
-    public static function secretbox_xchacha20poly1305($plaintext, $nonce, $key)
1094
-    {
1069
+    public static function secretbox_xchacha20poly1305($plaintext, $nonce, $key) {
1095 1070
         /** @var string $subkey */
1096 1071
         $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20(
1097 1072
             ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16),
@@ -1169,8 +1144,7 @@  discard block
 block discarded – undo
1169 1144
      * @throws SodiumException
1170 1145
      * @throws TypeError
1171 1146
      */
1172
-    public static function secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key)
1173
-    {
1147
+    public static function secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key) {
1174 1148
         /** @var string $mac */
1175 1149
         $mac = ParagonIE_Sodium_Core_Util::substr(
1176 1150
             $ciphertext,
@@ -1238,8 +1212,7 @@  discard block
 block discarded – undo
1238 1212
      * @throws Exception
1239 1213
      * @throws SodiumException
1240 1214
      */
1241
-    public static function secretstream_xchacha20poly1305_init_push($key)
1242
-    {
1215
+    public static function secretstream_xchacha20poly1305_init_push($key) {
1243 1216
         # randombytes_buf(out, crypto_secretstream_xchacha20poly1305_HEADERBYTES);
1244 1217
         $out = random_bytes(24);
1245 1218
 
@@ -1268,8 +1241,7 @@  discard block
 block discarded – undo
1268 1241
      * @return string Returns a state.
1269 1242
      * @throws Exception
1270 1243
      */
1271
-    public static function secretstream_xchacha20poly1305_init_pull($key, $header)
1272
-    {
1244
+    public static function secretstream_xchacha20poly1305_init_pull($key, $header) {
1273 1245
         # crypto_core_hchacha20(state->k, in, k, NULL);
1274 1246
         $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20(
1275 1247
             ParagonIE_Sodium_Core_Util::substr($header, 0, 16),
@@ -1295,8 +1267,7 @@  discard block
 block discarded – undo
1295 1267
      * @return string
1296 1268
      * @throws SodiumException
1297 1269
      */
1298
-    public static function secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0)
1299
-    {
1270
+    public static function secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) {
1300 1271
         $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state);
1301 1272
         # crypto_onetimeauth_poly1305_state poly1305_state;
1302 1273
         # unsigned char                     block[64U];
@@ -1424,8 +1395,7 @@  discard block
 block discarded – undo
1424 1395
      * @return bool|array{0: string, 1: int}
1425 1396
      * @throws SodiumException
1426 1397
      */
1427
-    public static function secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '')
1428
-    {
1398
+    public static function secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '') {
1429 1399
         $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state);
1430 1400
 
1431 1401
         $cipherlen = ParagonIE_Sodium_Core_Util::strlen($cipher);
@@ -1547,8 +1517,7 @@  discard block
 block discarded – undo
1547 1517
      * @return void
1548 1518
      * @throws SodiumException
1549 1519
      */
1550
-    public static function secretstream_xchacha20poly1305_rekey(&$state)
1551
-    {
1520
+    public static function secretstream_xchacha20poly1305_rekey(&$state) {
1552 1521
         $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state);
1553 1522
         # unsigned char new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES +
1554 1523
         # crypto_secretstream_xchacha20poly1305_INONCEBYTES];
@@ -1599,8 +1568,7 @@  discard block
 block discarded – undo
1599 1568
      * @throws SodiumException
1600 1569
      * @throws TypeError
1601 1570
      */
1602
-    public static function sign_detached($message, $sk)
1603
-    {
1571
+    public static function sign_detached($message, $sk) {
1604 1572
         return ParagonIE_Sodium_Core_Ed25519::sign_detached($message, $sk);
1605 1573
     }
1606 1574
 
@@ -1615,8 +1583,7 @@  discard block
 block discarded – undo
1615 1583
      * @throws SodiumException
1616 1584
      * @throws TypeError
1617 1585
      */
1618
-    public static function sign($message, $sk)
1619
-    {
1586
+    public static function sign($message, $sk) {
1620 1587
         return ParagonIE_Sodium_Core_Ed25519::sign($message, $sk);
1621 1588
     }
1622 1589
 
@@ -1631,8 +1598,7 @@  discard block
 block discarded – undo
1631 1598
      * @throws SodiumException
1632 1599
      * @throws TypeError
1633 1600
      */
1634
-    public static function sign_open($signedMessage, $pk)
1635
-    {
1601
+    public static function sign_open($signedMessage, $pk) {
1636 1602
         return ParagonIE_Sodium_Core_Ed25519::sign_open($signedMessage, $pk);
1637 1603
     }
1638 1604
 
@@ -1648,8 +1614,7 @@  discard block
 block discarded – undo
1648 1614
      * @throws SodiumException
1649 1615
      * @throws TypeError
1650 1616
      */
1651
-    public static function sign_verify_detached($signature, $message, $pk)
1652
-    {
1617
+    public static function sign_verify_detached($signature, $message, $pk) {
1653 1618
         return ParagonIE_Sodium_Core_Ed25519::verify_detached($signature, $message, $pk);
1654 1619
     }
1655 1620
 }
Please login to merge, or discard this patch.
vendor/paragonie/sodium_compat/src/File.php 1 patch
Braces   +20 added lines, -40 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
 /**
7 7
  * Class ParagonIE_Sodium_File
8 8
  */
9
-class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util
10
-{
9
+class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util {
11 10
     /* PHP's default buffer size is 8192 for fread()/fwrite(). */
12 11
     const BUFFER_SIZE = 8192;
13 12
 
@@ -25,8 +24,7 @@  discard block
 block discarded – undo
25 24
      * @throws SodiumException
26 25
      * @throws TypeError
27 26
      */
28
-    public static function box($inputFile, $outputFile, $nonce, $keyPair)
29
-    {
27
+    public static function box($inputFile, $outputFile, $nonce, $keyPair) {
30 28
         /* Type checks: */
31 29
         if (!is_string($inputFile)) {
32 30
             throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
@@ -91,8 +89,7 @@  discard block
 block discarded – undo
91 89
      * @throws SodiumException
92 90
      * @throws TypeError
93 91
      */
94
-    public static function box_open($inputFile, $outputFile, $nonce, $keypair)
95
-    {
92
+    public static function box_open($inputFile, $outputFile, $nonce, $keypair) {
96 93
         /* Type checks: */
97 94
         if (!is_string($inputFile)) {
98 95
             throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
@@ -161,8 +158,7 @@  discard block
 block discarded – undo
161 158
      * @throws SodiumException
162 159
      * @throws TypeError
163 160
      */
164
-    public static function box_seal($inputFile, $outputFile, $publicKey)
165
-    {
161
+    public static function box_seal($inputFile, $outputFile, $publicKey) {
166 162
         /* Type checks: */
167 163
         if (!is_string($inputFile)) {
168 164
             throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
@@ -265,8 +261,7 @@  discard block
 block discarded – undo
265 261
      * @throws SodiumException
266 262
      * @throws TypeError
267 263
      */
268
-    public static function box_seal_open($inputFile, $outputFile, $ecdhKeypair)
269
-    {
264
+    public static function box_seal_open($inputFile, $outputFile, $ecdhKeypair) {
270 265
         /* Type checks: */
271 266
         if (!is_string($inputFile)) {
272 267
             throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
@@ -350,8 +345,7 @@  discard block
 block discarded – undo
350 345
      * @throws TypeError
351 346
      * @psalm-suppress FailedTypeResolution
352 347
      */
353
-    public static function generichash($filePath, $key = '', $outputLength = 32)
354
-    {
348
+    public static function generichash($filePath, $key = '', $outputLength = 32) {
355 349
         /* Type checks: */
356 350
         if (!is_string($filePath)) {
357 351
             throw new TypeError('Argument 1 must be a string, ' . gettype($filePath) . ' given.');
@@ -428,8 +422,7 @@  discard block
 block discarded – undo
428 422
      * @throws SodiumException
429 423
      * @throws TypeError
430 424
      */
431
-    public static function secretbox($inputFile, $outputFile, $nonce, $key)
432
-    {
425
+    public static function secretbox($inputFile, $outputFile, $nonce, $key) {
433 426
         /* Type checks: */
434 427
         if (!is_string($inputFile)) {
435 428
             throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given..');
@@ -493,8 +486,7 @@  discard block
 block discarded – undo
493 486
      * @throws SodiumException
494 487
      * @throws TypeError
495 488
      */
496
-    public static function secretbox_open($inputFile, $outputFile, $nonce, $key)
497
-    {
489
+    public static function secretbox_open($inputFile, $outputFile, $nonce, $key) {
498 490
         /* Type checks: */
499 491
         if (!is_string($inputFile)) {
500 492
             throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
@@ -560,8 +552,7 @@  discard block
 block discarded – undo
560 552
      * @throws SodiumException
561 553
      * @throws TypeError
562 554
      */
563
-    public static function sign($filePath, $secretKey)
564
-    {
555
+    public static function sign($filePath, $secretKey) {
565 556
         /* Type checks: */
566 557
         if (!is_string($filePath)) {
567 558
             throw new TypeError('Argument 1 must be a string, ' . gettype($filePath) . ' given.');
@@ -656,8 +647,7 @@  discard block
 block discarded – undo
656 647
      * @throws TypeError
657 648
      * @throws Exception
658 649
      */
659
-    public static function verify($sig, $filePath, $publicKey)
660
-    {
650
+    public static function verify($sig, $filePath, $publicKey) {
661 651
         /* Type checks: */
662 652
         if (!is_string($sig)) {
663 653
             throw new TypeError('Argument 1 must be a string, ' . gettype($sig) . ' given.');
@@ -766,8 +756,7 @@  discard block
 block discarded – undo
766 756
      * @throws SodiumException
767 757
      * @throws TypeError
768 758
      */
769
-    protected static function box_encrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair)
770
-    {
759
+    protected static function box_encrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair) {
771 760
         if (PHP_INT_SIZE === 4) {
772 761
             return self::secretbox_encrypt(
773 762
                 $ifp,
@@ -803,8 +792,7 @@  discard block
 block discarded – undo
803 792
      * @throws SodiumException
804 793
      * @throws TypeError
805 794
      */
806
-    protected static function box_decrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair)
807
-    {
795
+    protected static function box_decrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair) {
808 796
         if (PHP_INT_SIZE === 4) {
809 797
             return self::secretbox_decrypt(
810 798
                 $ifp,
@@ -841,8 +829,7 @@  discard block
 block discarded – undo
841 829
      * @throws SodiumException
842 830
      * @throws TypeError
843 831
      */
844
-    protected static function secretbox_encrypt($ifp, $ofp, $mlen, $nonce, $key)
845
-    {
832
+    protected static function secretbox_encrypt($ifp, $ofp, $mlen, $nonce, $key) {
846 833
         if (PHP_INT_SIZE === 4) {
847 834
             return self::secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key);
848 835
         }
@@ -962,8 +949,7 @@  discard block
 block discarded – undo
962 949
      * @throws SodiumException
963 950
      * @throws TypeError
964 951
      */
965
-    protected static function secretbox_decrypt($ifp, $ofp, $mlen, $nonce, $key)
966
-    {
952
+    protected static function secretbox_decrypt($ifp, $ofp, $mlen, $nonce, $key) {
967 953
         if (PHP_INT_SIZE === 4) {
968 954
             return self::secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key);
969 955
         }
@@ -1095,8 +1081,7 @@  discard block
 block discarded – undo
1095 1081
      * @psalm-suppress TypeCoercion
1096 1082
      *                 Ditto.
1097 1083
      */
1098
-    public static function updateHashWithFile($hash, $fp, $size = 0)
1099
-    {
1084
+    public static function updateHashWithFile($hash, $fp, $size = 0) {
1100 1085
         /* Type checks: */
1101 1086
         if (PHP_VERSION_ID < 70200) {
1102 1087
             if (!is_resource($hash)) {
@@ -1152,8 +1137,7 @@  discard block
 block discarded – undo
1152 1137
      * @throws SodiumException
1153 1138
      * @throws TypeError
1154 1139
      */
1155
-    private static function sign_core32($filePath, $secretKey)
1156
-    {
1140
+    private static function sign_core32($filePath, $secretKey) {
1157 1141
         /** @var int|bool $size */
1158 1142
         $size = filesize($filePath);
1159 1143
         if (!is_int($size)) {
@@ -1234,8 +1218,7 @@  discard block
 block discarded – undo
1234 1218
      * @throws SodiumException
1235 1219
      * @throws Exception
1236 1220
      */
1237
-    public static function verify_core32($sig, $filePath, $publicKey)
1238
-    {
1221
+    public static function verify_core32($sig, $filePath, $publicKey) {
1239 1222
         /* Security checks */
1240 1223
         if (ParagonIE_Sodium_Core32_Ed25519::check_S_lt_L(self::substr($sig, 32, 32))) {
1241 1224
             throw new SodiumException('S < L - Invalid signature');
@@ -1318,8 +1301,7 @@  discard block
 block discarded – undo
1318 1301
      * @throws SodiumException
1319 1302
      * @throws TypeError
1320 1303
      */
1321
-    protected static function secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key)
1322
-    {
1304
+    protected static function secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key) {
1323 1305
         $plaintext = fread($ifp, 32);
1324 1306
         if (!is_string($plaintext)) {
1325 1307
             throw new SodiumException('Could not read input file');
@@ -1435,8 +1417,7 @@  discard block
 block discarded – undo
1435 1417
      * @throws SodiumException
1436 1418
      * @throws TypeError
1437 1419
      */
1438
-    protected static function secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key)
1439
-    {
1420
+    protected static function secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key) {
1440 1421
         $tag = fread($ifp, 16);
1441 1422
         if (!is_string($tag)) {
1442 1423
             throw new SodiumException('Could not read input file');
@@ -1549,8 +1530,7 @@  discard block
 block discarded – undo
1549 1530
      * @return int
1550 1531
      * @throws SodiumException
1551 1532
      */
1552
-    private static function ftell($resource)
1553
-    {
1533
+    private static function ftell($resource) {
1554 1534
         $return = ftell($resource);
1555 1535
         if (!is_int($return)) {
1556 1536
             throw new SodiumException('ftell() returned false');
Please login to merge, or discard this patch.
vendor/paragonie/sodium_compat/src/PHP52/SplFixedArray.php 1 patch
Braces   +16 added lines, -32 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
23 23
      * SplFixedArray constructor.
24 24
      * @param int $size
25 25
      */
26
-    public function __construct($size = 0)
27
-    {
26
+    public function __construct($size = 0) {
28 27
         $this->size = $size;
29 28
         $this->internalArray = array();
30 29
     }
@@ -32,16 +31,14 @@  discard block
 block discarded – undo
32 31
     /**
33 32
      * @return int
34 33
      */
35
-    public function count()
36
-    {
34
+    public function count() {
37 35
         return count($this->internalArray);
38 36
     }
39 37
 
40 38
     /**
41 39
      * @return array
42 40
      */
43
-    public function toArray()
44
-    {
41
+    public function toArray() {
45 42
         ksort($this->internalArray);
46 43
         return (array) $this->internalArray;
47 44
     }
@@ -52,8 +49,7 @@  discard block
 block discarded – undo
52 49
      * @return SplFixedArray
53 50
      * @psalm-suppress MixedAssignment
54 51
      */
55
-    public static function fromArray(array $array, $save_indexes = true)
56
-    {
52
+    public static function fromArray(array $array, $save_indexes = true) {
57 53
         $self = new SplFixedArray(count($array));
58 54
         if($save_indexes) {
59 55
             foreach($array as $key => $value) {
@@ -72,8 +68,7 @@  discard block
 block discarded – undo
72 68
     /**
73 69
      * @return int
74 70
      */
75
-    public function getSize()
76
-    {
71
+    public function getSize() {
77 72
         return $this->size;
78 73
     }
79 74
 
@@ -81,8 +76,7 @@  discard block
 block discarded – undo
81 76
      * @param int $size
82 77
      * @return bool
83 78
      */
84
-    public function setSize($size)
85
-    {
79
+    public function setSize($size) {
86 80
         $this->size = $size;
87 81
         return true;
88 82
     }
@@ -91,8 +85,7 @@  discard block
 block discarded – undo
91 85
      * @param string|int $index
92 86
      * @return bool
93 87
      */
94
-    public function offsetExists($index)
95
-    {
88
+    public function offsetExists($index) {
96 89
         return array_key_exists((int) $index, $this->internalArray);
97 90
     }
98 91
 
@@ -100,8 +93,7 @@  discard block
 block discarded – undo
100 93
      * @param string|int $index
101 94
      * @return mixed
102 95
      */
103
-    public function offsetGet($index)
104
-    {
96
+    public function offsetGet($index) {
105 97
         /** @psalm-suppress MixedReturnStatement */
106 98
         return $this->internalArray[(int) $index];
107 99
     }
@@ -111,16 +103,14 @@  discard block
 block discarded – undo
111 103
      * @param mixed $newval
112 104
      * @psalm-suppress MixedAssignment
113 105
      */
114
-    public function offsetSet($index, $newval)
115
-    {
106
+    public function offsetSet($index, $newval) {
116 107
         $this->internalArray[(int) $index] = $newval;
117 108
     }
118 109
 
119 110
     /**
120 111
      * @param string|int $index
121 112
      */
122
-    public function offsetUnset($index)
123
-    {
113
+    public function offsetUnset($index) {
124 114
         unset($this->internalArray[(int) $index]);
125 115
     }
126 116
 
@@ -130,8 +120,7 @@  discard block
 block discarded – undo
130 120
      * @return void
131 121
      * @since 5.3.0
132 122
      */
133
-    public function rewind()
134
-    {
123
+    public function rewind() {
135 124
         reset($this->internalArray);
136 125
     }
137 126
 
@@ -141,8 +130,7 @@  discard block
 block discarded – undo
141 130
      * @return mixed The current element value.
142 131
      * @since 5.3.0
143 132
      */
144
-    public function current()
145
-    {
133
+    public function current() {
146 134
         /** @psalm-suppress MixedReturnStatement */
147 135
         return current($this->internalArray);
148 136
     }
@@ -151,16 +139,14 @@  discard block
 block discarded – undo
151 139
      * Return current array index
152 140
      * @return int The current array index.
153 141
      */
154
-    public function key()
155
-    {
142
+    public function key() {
156 143
         return key($this->internalArray);
157 144
     }
158 145
 
159 146
     /**
160 147
      * @return void
161 148
      */
162
-    public function next()
163
-    {
149
+    public function next() {
164 150
         next($this->internalArray);
165 151
     }
166 152
 
@@ -169,8 +155,7 @@  discard block
 block discarded – undo
169 155
      * @link https://php.net/manual/en/splfixedarray.valid.php
170 156
      * @return bool true if the array contains any more elements, false otherwise.
171 157
      */
172
-    public function valid()
173
-    {
158
+    public function valid() {
174 159
         if (empty($this->internalArray)) {
175 160
             return false;
176 161
         }
@@ -182,8 +167,7 @@  discard block
 block discarded – undo
182 167
     /**
183 168
      * Do nothing.
184 169
      */
185
-    public function __wakeup()
186
-    {
170
+    public function __wakeup() {
187 171
         // NOP
188 172
     }
189 173
 }
190 174
\ No newline at end of file
Please login to merge, or discard this patch.