Changeset 58752 for trunk/src/wp-includes/sodium_compat/src/Compat.php
- Timestamp:
- 07/18/2024 12:58:40 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/sodium_compat/src/Compat.php
r54310 r58752 60 60 const CRYPTO_AEAD_AES256GCM_NPUBBYTES = 12; 61 61 const CRYPTO_AEAD_AES256GCM_ABYTES = 16; 62 const CRYPTO_AEAD_AEGIS128L_KEYBYTES = 16; 63 const CRYPTO_AEAD_AEGIS128L_NSECBYTES = 0; 64 const CRYPTO_AEAD_AEGIS128L_NPUBBYTES = 16; 65 const CRYPTO_AEAD_AEGIS128L_ABYTES = 32; 66 const CRYPTO_AEAD_AEGIS256_KEYBYTES = 32; 67 const CRYPTO_AEAD_AEGIS256_NSECBYTES = 0; 68 const CRYPTO_AEAD_AEGIS256_NPUBBYTES = 32; 69 const CRYPTO_AEAD_AEGIS256_ABYTES = 32; 62 70 const CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = 32; 63 71 const CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = 0; … … 156 164 * @throws SodiumException 157 165 */ 158 public static function add(&$val, $addv) 159 { 166 public static function add( 167 #[\SensitiveParameter] 168 &$val, 169 #[\SensitiveParameter] 170 $addv 171 ) { 160 172 $val_len = ParagonIE_Sodium_Core_Util::strlen($val); 161 173 $addv_len = ParagonIE_Sodium_Core_Util::strlen($addv); … … 182 194 * @throws SodiumException 183 195 */ 184 public static function base642bin($encoded, $variant, $ignore = '') 185 { 196 public static function base642bin( 197 #[\SensitiveParameter] 198 $encoded, 199 $variant, 200 $ignore = '' 201 ) { 186 202 /* Type checks: */ 187 203 ParagonIE_Sodium_Core_Util::declareScalarType($encoded, 'string', 1); … … 225 241 * @throws SodiumException 226 242 */ 227 public static function bin2base64($decoded, $variant) 228 { 243 public static function bin2base64( 244 #[\SensitiveParameter] 245 $decoded, 246 $variant 247 ) { 229 248 /* Type checks: */ 230 249 ParagonIE_Sodium_Core_Util::declareScalarType($decoded, 'string', 1); … … 258 277 * @psalm-suppress MixedArgument 259 278 */ 260 public static function bin2hex($string) 261 { 279 public static function bin2hex( 280 #[\SensitiveParameter] 281 $string 282 ) { 262 283 /* Type checks: */ 263 284 ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1); … … 285 306 * @psalm-suppress MixedArgument 286 307 */ 287 public static function compare($left, $right) 288 { 308 public static function compare( 309 #[\SensitiveParameter] 310 $left, 311 #[\SensitiveParameter] 312 $right 313 ) { 289 314 /* Type checks: */ 290 315 ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1); … … 298 323 } 299 324 return ParagonIE_Sodium_Core_Util::compare($left, $right); 325 } 326 327 /** 328 * Authenticated Encryption with Associated Data: Decryption 329 * 330 * Algorithm: 331 * AEGIS-128L 332 * 333 * @param string $ciphertext Encrypted message (with MAC appended) 334 * @param string $assocData Authenticated Associated Data (unencrypted) 335 * @param string $nonce Number to be used only Once; must be 32 bytes 336 * @param string $key Encryption key 337 * 338 * @return string The original plaintext message 339 * @throws SodiumException 340 * @throws TypeError 341 * @psalm-suppress MixedArgument 342 * @psalm-suppress MixedInferredReturnType 343 * @psalm-suppress MixedReturnStatement 344 */ 345 public static function crypto_aead_aegis128l_decrypt( 346 $ciphertext = '', 347 $assocData = '', 348 $nonce = '', 349 #[\SensitiveParameter] 350 $key = '' 351 ) { 352 ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); 353 ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); 354 ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); 355 ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); 356 357 /* Input validation: */ 358 if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AEGIS128L_NPUBBYTES) { 359 throw new SodiumException('Nonce must be CRYPTO_AEAD_AEGIS_128L_NPUBBYTES long'); 360 } 361 if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AEGIS128L_KEYBYTES) { 362 throw new SodiumException('Key must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long'); 363 } 364 $ct_length = ParagonIE_Sodium_Core_Util::strlen($ciphertext); 365 if ($ct_length < self::CRYPTO_AEAD_AEGIS128L_ABYTES) { 366 throw new SodiumException('Message must be at least CRYPTO_AEAD_AEGIS128L_ABYTES long'); 367 } 368 369 $ct = ParagonIE_Sodium_Core_Util::substr( 370 $ciphertext, 371 0, 372 $ct_length - self::CRYPTO_AEAD_AEGIS128L_ABYTES 373 ); 374 $tag = ParagonIE_Sodium_Core_Util::substr( 375 $ciphertext, 376 $ct_length - self::CRYPTO_AEAD_AEGIS128L_ABYTES, 377 self::CRYPTO_AEAD_AEGIS128L_ABYTES 378 ); 379 return ParagonIE_Sodium_Core_AEGIS128L::decrypt($ct, $tag, $assocData, $key, $nonce); 380 } 381 382 /** 383 * Authenticated Encryption with Associated Data: Encryption 384 * 385 * Algorithm: 386 * AEGIS-128L 387 * 388 * @param string $plaintext Message to be encrypted 389 * @param string $assocData Authenticated Associated Data (unencrypted) 390 * @param string $nonce Number to be used only Once; must be 32 bytes 391 * @param string $key Encryption key 392 * 393 * @return string Ciphertext with 32-byte authentication tag appended 394 * @throws SodiumException 395 * @throws TypeError 396 * @psalm-suppress MixedArgument 397 */ 398 public static function crypto_aead_aegis128l_encrypt( 399 #[\SensitiveParameter] 400 $plaintext = '', 401 $assocData = '', 402 $nonce = '', 403 #[\SensitiveParameter] 404 $key = '' 405 ) { 406 ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); 407 ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); 408 ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); 409 ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); 410 411 /* Input validation: */ 412 if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AEGIS128L_NPUBBYTES) { 413 throw new SodiumException('Nonce must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long'); 414 } 415 if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AEGIS128L_KEYBYTES) { 416 throw new SodiumException('Key must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long'); 417 } 418 419 list($ct, $tag) = ParagonIE_Sodium_Core_AEGIS128L::encrypt($plaintext, $assocData, $key, $nonce); 420 return $ct . $tag; 421 } 422 423 /** 424 * Return a secure random key for use with the AEGIS-128L 425 * symmetric AEAD interface. 426 * 427 * @return string 428 * @throws Exception 429 * @throws Error 430 */ 431 public static function crypto_aead_aegis128l_keygen() 432 { 433 return random_bytes(self::CRYPTO_AEAD_AEGIS128L_KEYBYTES); 434 } 435 436 /** 437 * Authenticated Encryption with Associated Data: Decryption 438 * 439 * Algorithm: 440 * AEGIS-256 441 * 442 * @param string $ciphertext Encrypted message (with MAC appended) 443 * @param string $assocData Authenticated Associated Data (unencrypted) 444 * @param string $nonce Number to be used only Once; must be 32 bytes 445 * @param string $key Encryption key 446 * 447 * @return string The original plaintext message 448 * @throws SodiumException 449 * @throws TypeError 450 * @psalm-suppress MixedArgument 451 * @psalm-suppress MixedInferredReturnType 452 * @psalm-suppress MixedReturnStatement 453 */ 454 public static function crypto_aead_aegis256_decrypt( 455 $ciphertext = '', 456 $assocData = '', 457 $nonce = '', 458 #[\SensitiveParameter] 459 $key = '' 460 ) { 461 ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); 462 ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); 463 ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); 464 ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); 465 466 /* Input validation: */ 467 if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AEGIS256_NPUBBYTES) { 468 throw new SodiumException('Nonce must be CRYPTO_AEAD_AEGIS256_NPUBBYTES long'); 469 } 470 if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AEGIS256_KEYBYTES) { 471 throw new SodiumException('Key must be CRYPTO_AEAD_AEGIS256_KEYBYTES long'); 472 } 473 $ct_length = ParagonIE_Sodium_Core_Util::strlen($ciphertext); 474 if ($ct_length < self::CRYPTO_AEAD_AEGIS256_ABYTES) { 475 throw new SodiumException('Message must be at least CRYPTO_AEAD_AEGIS256_ABYTES long'); 476 } 477 478 $ct = ParagonIE_Sodium_Core_Util::substr( 479 $ciphertext, 480 0, 481 $ct_length - self::CRYPTO_AEAD_AEGIS256_ABYTES 482 ); 483 $tag = ParagonIE_Sodium_Core_Util::substr( 484 $ciphertext, 485 $ct_length - self::CRYPTO_AEAD_AEGIS256_ABYTES, 486 self::CRYPTO_AEAD_AEGIS256_ABYTES 487 ); 488 return ParagonIE_Sodium_Core_AEGIS256::decrypt($ct, $tag, $assocData, $key, $nonce); 489 } 490 491 /** 492 * Authenticated Encryption with Associated Data: Encryption 493 * 494 * Algorithm: 495 * AEGIS-256 496 * 497 * @param string $plaintext Message to be encrypted 498 * @param string $assocData Authenticated Associated Data (unencrypted) 499 * @param string $nonce Number to be used only Once; must be 32 bytes 500 * @param string $key Encryption key 501 * 502 * @return string Ciphertext with 32-byte authentication tag appended 503 * @throws SodiumException 504 * @throws TypeError 505 * @psalm-suppress MixedArgument 506 */ 507 public static function crypto_aead_aegis256_encrypt( 508 #[\SensitiveParameter] 509 $plaintext = '', 510 $assocData = '', 511 $nonce = '', 512 #[\SensitiveParameter] 513 $key = '' 514 ) { 515 ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); 516 ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); 517 ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); 518 ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); 519 520 /* Input validation: */ 521 if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AEGIS256_NPUBBYTES) { 522 throw new SodiumException('Nonce must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long'); 523 } 524 if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AEGIS256_KEYBYTES) { 525 throw new SodiumException('Key must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long'); 526 } 527 528 list($ct, $tag) = ParagonIE_Sodium_Core_AEGIS256::encrypt($plaintext, $assocData, $key, $nonce); 529 return $ct . $tag; 530 } 531 532 /** 533 * Return a secure random key for use with the AEGIS-256 534 * symmetric AEAD interface. 535 * 536 * @return string 537 * @throws Exception 538 * @throws Error 539 */ 540 public static function crypto_aead_aegis256_keygen() 541 { 542 return random_bytes(self::CRYPTO_AEAD_AEGIS256_KEYBYTES); 300 543 } 301 544 … … 352 595 $assocData = '', 353 596 $nonce = '', 597 #[\SensitiveParameter] 354 598 $key = '' 355 599 ) { … … 409 653 */ 410 654 public static function crypto_aead_aes256gcm_encrypt( 655 #[\SensitiveParameter] 411 656 $plaintext = '', 412 657 $assocData = '', 413 658 $nonce = '', 659 #[\SensitiveParameter] 414 660 $key = '' 415 661 ) { … … 485 731 $assocData = '', 486 732 $nonce = '', 733 #[\SensitiveParameter] 487 734 $key = '' 488 735 ) { … … 562 809 */ 563 810 public static function crypto_aead_chacha20poly1305_encrypt( 811 #[\SensitiveParameter] 564 812 $plaintext = '', 565 813 $assocData = '', 566 814 $nonce = '', 815 #[\SensitiveParameter] 567 816 $key = '' 568 817 ) { … … 639 888 $assocData = '', 640 889 $nonce = '', 890 #[\SensitiveParameter] 641 891 $key = '' 642 892 ) { … … 729 979 */ 730 980 public static function crypto_aead_chacha20poly1305_ietf_encrypt( 981 #[\SensitiveParameter] 731 982 $plaintext = '', 732 983 $assocData = '', 733 984 $nonce = '', 985 #[\SensitiveParameter] 734 986 $key = '' 735 987 ) { … … 820 1072 $assocData = '', 821 1073 $nonce = '', 1074 #[\SensitiveParameter] 822 1075 $key = '', 823 1076 $dontFallback = false … … 892 1145 */ 893 1146 public static function crypto_aead_xchacha20poly1305_ietf_encrypt( 1147 #[\SensitiveParameter] 894 1148 $plaintext = '', 895 1149 $assocData = '', 896 1150 $nonce = '', 1151 #[\SensitiveParameter] 897 1152 $key = '', 898 1153 $dontFallback = false … … 972 1227 * @psalm-suppress MixedArgument 973 1228 */ 974 public static function crypto_auth($message, $key) 975 { 1229 public static function crypto_auth( 1230 $message, 1231 #[\SensitiveParameter] 1232 $key 1233 ) { 976 1234 /* Type checks: */ 977 1235 ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); … … 1017 1275 * @psalm-suppress MixedArgument 1018 1276 */ 1019 public static function crypto_auth_verify($mac, $message, $key) 1020 { 1277 public static function crypto_auth_verify( 1278 $mac, 1279 $message, 1280 #[\SensitiveParameter] 1281 $key 1282 ) { 1021 1283 /* Type checks: */ 1022 1284 ParagonIE_Sodium_Core_Util::declareScalarType($mac, 'string', 1); … … 1061 1323 * @psalm-suppress MixedArgument 1062 1324 */ 1063 public static function crypto_box($plaintext, $nonce, $keypair) 1064 { 1325 public static function crypto_box( 1326 $plaintext, 1327 $nonce, 1328 #[\SensitiveParameter] 1329 $keypair 1330 ) { 1065 1331 /* Type checks: */ 1066 1332 ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); … … 1105 1371 * @psalm-suppress MixedArgument 1106 1372 */ 1107 public static function crypto_box_seal($plaintext, $publicKey) 1108 { 1373 public static function crypto_box_seal( 1374 #[\SensitiveParameter] 1375 $plaintext, 1376 $publicKey 1377 ) { 1109 1378 /* Type checks: */ 1110 1379 ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); … … 1143 1412 * @psalm-suppress MixedReturnStatement 1144 1413 */ 1145 public static function crypto_box_seal_open($ciphertext, $keypair) 1146 { 1414 public static function crypto_box_seal_open( 1415 $ciphertext, 1416 #[\SensitiveParameter] 1417 $keypair 1418 ) { 1147 1419 /* Type checks: */ 1148 1420 ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); … … 1206 1478 * @psalm-suppress MixedArgument 1207 1479 */ 1208 public static function crypto_box_keypair_from_secretkey_and_publickey($secretKey, $publicKey) 1209 { 1480 public static function crypto_box_keypair_from_secretkey_and_publickey( 1481 #[\SensitiveParameter] 1482 $secretKey, 1483 $publicKey 1484 ) { 1210 1485 /* Type checks: */ 1211 1486 ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); … … 1245 1520 * @psalm-suppress MixedReturnStatement 1246 1521 */ 1247 public static function crypto_box_open($ciphertext, $nonce, $keypair) 1248 { 1522 public static function crypto_box_open( 1523 $ciphertext, 1524 $nonce, 1525 #[\SensitiveParameter] 1526 $keypair 1527 ) { 1249 1528 /* Type checks: */ 1250 1529 ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); … … 1288 1567 * @psalm-suppress MixedArgument 1289 1568 */ 1290 public static function crypto_box_publickey($keypair) 1291 { 1569 public static function crypto_box_publickey( 1570 #[\SensitiveParameter] 1571 $keypair 1572 ) { 1292 1573 /* Type checks: */ 1293 1574 ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); … … 1319 1600 * @psalm-suppress MixedArgument 1320 1601 */ 1321 public static function crypto_box_publickey_from_secretkey($secretKey) 1322 { 1602 public static function crypto_box_publickey_from_secretkey( 1603 #[\SensitiveParameter] 1604 $secretKey 1605 ) { 1323 1606 /* Type checks: */ 1324 1607 ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); … … 1350 1633 * @psalm-suppress MixedArgument 1351 1634 */ 1352 public static function crypto_box_secretkey($keypair) 1353 { 1635 public static function crypto_box_secretkey( 1636 #[\SensitiveParameter] 1637 $keypair 1638 ) { 1354 1639 /* Type checks: */ 1355 1640 ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); … … 1382 1667 * @psalm-suppress UndefinedFunction 1383 1668 */ 1384 public static function crypto_box_seed_keypair($seed) 1385 { 1669 public static function crypto_box_seed_keypair( 1670 #[\SensitiveParameter] 1671 $seed 1672 ) { 1386 1673 /* Type checks: */ 1387 1674 ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); … … 1412 1699 * @psalm-suppress MixedArgument 1413 1700 */ 1414 public static function crypto_generichash($message, $key = '', $length = self::CRYPTO_GENERICHASH_BYTES) 1415 { 1701 public static function crypto_generichash( 1702 $message, 1703 #[\SensitiveParameter] 1704 $key = '', 1705 $length = self::CRYPTO_GENERICHASH_BYTES 1706 ) { 1416 1707 /* Type checks: */ 1417 1708 ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); … … 1456 1747 * @psalm-suppress ConflictingReferenceConstraint 1457 1748 */ 1458 public static function crypto_generichash_final(&$ctx, $length = self::CRYPTO_GENERICHASH_BYTES) 1459 { 1749 public static function crypto_generichash_final( 1750 #[\SensitiveParameter] 1751 &$ctx, 1752 $length = self::CRYPTO_GENERICHASH_BYTES 1753 ) { 1460 1754 /* Type checks: */ 1461 1755 ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1); … … 1501 1795 * @psalm-suppress MixedArgument 1502 1796 */ 1503 public static function crypto_generichash_init($key = '', $length = self::CRYPTO_GENERICHASH_BYTES) 1504 { 1797 public static function crypto_generichash_init( 1798 #[\SensitiveParameter] 1799 $key = '', 1800 $length = self::CRYPTO_GENERICHASH_BYTES 1801 ) { 1505 1802 /* Type checks: */ 1506 1803 if (is_null($key)) { … … 1546 1843 */ 1547 1844 public static function crypto_generichash_init_salt_personal( 1845 #[\SensitiveParameter] 1548 1846 $key = '', 1549 1847 $length = self::CRYPTO_GENERICHASH_BYTES, … … 1592 1890 * @psalm-suppress ReferenceConstraintViolation 1593 1891 */ 1594 public static function crypto_generichash_update(&$ctx, $message) 1595 { 1892 public static function crypto_generichash_update( 1893 #[\SensitiveParameter] 1894 &$ctx, 1895 $message 1896 ) { 1596 1897 /* Type checks: */ 1597 1898 ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1); … … 1636 1937 $subkey_id, 1637 1938 $context, 1939 #[\SensitiveParameter] 1638 1940 $key 1639 1941 ) { … … 1713 2015 * @psalm-suppress MixedArgument 1714 2016 */ 1715 public static function crypto_kx($my_secret, $their_public, $client_public, $server_public, $dontFallback = false) 1716 { 2017 public static function crypto_kx( 2018 #[\SensitiveParameter] 2019 $my_secret, 2020 $their_public, 2021 $client_public, 2022 $server_public, 2023 $dontFallback = false 2024 ) { 1717 2025 /* Type checks: */ 1718 2026 ParagonIE_Sodium_Core_Util::declareScalarType($my_secret, 'string', 1); … … 1775 2083 * @throws SodiumException 1776 2084 */ 1777 public static function crypto_kx_seed_keypair($seed) 1778 { 2085 public static function crypto_kx_seed_keypair( 2086 #[\SensitiveParameter] 2087 $seed 2088 ) { 1779 2089 ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); 1780 2090 … … 1807 2117 * @throws SodiumException 1808 2118 */ 1809 public static function crypto_kx_client_session_keys($keypair, $serverPublicKey) 1810 { 2119 public static function crypto_kx_client_session_keys( 2120 #[\SensitiveParameter] 2121 $keypair, 2122 $serverPublicKey 2123 ) { 1811 2124 ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); 1812 2125 ParagonIE_Sodium_Core_Util::declareScalarType($serverPublicKey, 'string', 2); … … 1849 2162 * @throws SodiumException 1850 2163 */ 1851 public static function crypto_kx_server_session_keys($keypair, $clientPublicKey) 1852 { 2164 public static function crypto_kx_server_session_keys( 2165 #[\SensitiveParameter] 2166 $keypair, 2167 $clientPublicKey 2168 ) { 1853 2169 ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); 1854 2170 ParagonIE_Sodium_Core_Util::declareScalarType($clientPublicKey, 'string', 2); … … 1890 2206 * @throws SodiumException 1891 2207 */ 1892 public static function crypto_kx_secretkey($kp) 1893 { 2208 public static function crypto_kx_secretkey( 2209 #[\SensitiveParameter] 2210 $kp 2211 ) { 1894 2212 return ParagonIE_Sodium_Core_Util::substr( 1895 2213 $kp, … … 1925 2243 * @psalm-suppress MixedArgument 1926 2244 */ 1927 public static function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg = null) 1928 { 2245 public static function crypto_pwhash( 2246 $outlen, 2247 #[\SensitiveParameter] 2248 $passwd, 2249 $salt, 2250 $opslimit, 2251 $memlimit, 2252 $alg = null 2253 ) { 1929 2254 ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1); 1930 2255 ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2); … … 1977 2302 * @psalm-suppress MixedArgument 1978 2303 */ 1979 public static function crypto_pwhash_str($passwd, $opslimit, $memlimit) 1980 { 2304 public static function crypto_pwhash_str( 2305 #[\SensitiveParameter] 2306 $passwd, 2307 $opslimit, 2308 $memlimit 2309 ) { 1981 2310 ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); 1982 2311 ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); … … 2004 2333 * @throws SodiumException 2005 2334 */ 2006 public static function crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit) 2007 { 2335 public static function crypto_pwhash_str_needs_rehash( 2336 #[\SensitiveParameter] 2337 $hash, 2338 $opslimit, 2339 $memlimit 2340 ) { 2008 2341 ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 1); 2009 2342 ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); … … 2033 2366 * @psalm-suppress MixedArgument 2034 2367 */ 2035 public static function crypto_pwhash_str_verify($passwd, $hash) 2036 { 2368 public static function crypto_pwhash_str_verify( 2369 #[\SensitiveParameter] 2370 $passwd, 2371 #[\SensitiveParameter] 2372 $hash 2373 ) { 2037 2374 ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); 2038 2375 ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2); … … 2060 2397 * @throws TypeError 2061 2398 */ 2062 public static function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit) 2063 { 2399 public static function crypto_pwhash_scryptsalsa208sha256( 2400 $outlen, 2401 #[\SensitiveParameter] 2402 $passwd, 2403 $salt, 2404 $opslimit, 2405 $memlimit 2406 ) { 2064 2407 ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1); 2065 2408 ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2); … … 2120 2463 * @throws TypeError 2121 2464 */ 2122 public static function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit) 2123 { 2465 public static function crypto_pwhash_scryptsalsa208sha256_str( 2466 #[\SensitiveParameter] 2467 $passwd, 2468 $opslimit, 2469 $memlimit 2470 ) { 2124 2471 ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); 2125 2472 ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); … … 2154 2501 * @throws TypeError 2155 2502 */ 2156 public static function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash) 2157 { 2503 public static function crypto_pwhash_scryptsalsa208sha256_str_verify( 2504 #[\SensitiveParameter] 2505 $passwd, 2506 #[\SensitiveParameter] 2507 $hash 2508 ) { 2158 2509 ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); 2159 2510 ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2); … … 2191 2542 * @psalm-suppress MixedArgument 2192 2543 */ 2193 public static function crypto_scalarmult($secretKey, $publicKey) 2194 { 2544 public static function crypto_scalarmult( 2545 #[\SensitiveParameter] 2546 $secretKey, 2547 $publicKey 2548 ) { 2195 2549 /* Type checks: */ 2196 2550 ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); … … 2235 2589 * @psalm-suppress MixedArgument 2236 2590 */ 2237 public static function crypto_scalarmult_base($secretKey) 2238 { 2591 public static function crypto_scalarmult_base( 2592 #[\SensitiveParameter] 2593 $secretKey 2594 ) { 2239 2595 /* Type checks: */ 2240 2596 ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); … … 2273 2629 * @psalm-suppress MixedArgument 2274 2630 */ 2275 public static function crypto_secretbox($plaintext, $nonce, $key) 2276 { 2631 public static function crypto_secretbox( 2632 #[\SensitiveParameter] 2633 $plaintext, 2634 $nonce, 2635 #[\SensitiveParameter] 2636 $key 2637 ) { 2277 2638 /* Type checks: */ 2278 2639 ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); … … 2313 2674 * @psalm-suppress MixedReturnStatement 2314 2675 */ 2315 public static function crypto_secretbox_open($ciphertext, $nonce, $key) 2316 { 2676 public static function crypto_secretbox_open( 2677 $ciphertext, 2678 $nonce, 2679 #[\SensitiveParameter] 2680 $key 2681 ) { 2317 2682 /* Type checks: */ 2318 2683 ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); … … 2399 2764 * @psalm-suppress MixedArgument 2400 2765 */ 2401 public static function crypto_secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key) 2402 { 2766 public static function crypto_secretbox_xchacha20poly1305_open( 2767 $ciphertext, 2768 $nonce, 2769 #[\SensitiveParameter] 2770 $key 2771 ) { 2403 2772 /* Type checks: */ 2404 2773 ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); … … 2426 2795 * @throws SodiumException 2427 2796 */ 2428 public static function crypto_secretstream_xchacha20poly1305_init_push($key) 2429 { 2797 public static function crypto_secretstream_xchacha20poly1305_init_push( 2798 #[\SensitiveParameter] 2799 $key 2800 ) { 2430 2801 if (PHP_INT_SIZE === 4) { 2431 2802 return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_push($key); … … 2440 2811 * @throws Exception 2441 2812 */ 2442 public static function crypto_secretstream_xchacha20poly1305_init_pull($header, $key) 2443 { 2813 public static function crypto_secretstream_xchacha20poly1305_init_pull( 2814 $header, 2815 #[\SensitiveParameter] 2816 $key 2817 ) { 2444 2818 if (ParagonIE_Sodium_Core_Util::strlen($header) < self::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES) { 2445 2819 throw new SodiumException( … … 2461 2835 * @throws SodiumException 2462 2836 */ 2463 public static function crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) 2464 { 2837 public static function crypto_secretstream_xchacha20poly1305_push( 2838 #[\SensitiveParameter] 2839 &$state, 2840 #[\SensitiveParameter] 2841 $msg, 2842 $aad = '', 2843 $tag = 0 2844 ) { 2465 2845 if (PHP_INT_SIZE === 4) { 2466 2846 return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_push( … … 2486 2866 * @throws SodiumException 2487 2867 */ 2488 public static function crypto_secretstream_xchacha20poly1305_pull(&$state, $msg, $aad = '') 2489 { 2868 public static function crypto_secretstream_xchacha20poly1305_pull( 2869 #[\SensitiveParameter] 2870 &$state, 2871 $msg, 2872 $aad = '' 2873 ) { 2490 2874 if (PHP_INT_SIZE === 4) { 2491 2875 return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_pull( … … 2516 2900 * @throws SodiumException 2517 2901 */ 2518 public static function crypto_secretstream_xchacha20poly1305_rekey(&$state) 2519 { 2902 public static function crypto_secretstream_xchacha20poly1305_rekey( 2903 #[\SensitiveParameter] 2904 &$state 2905 ) { 2520 2906 if (PHP_INT_SIZE === 4) { 2521 2907 ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_rekey($state); … … 2537 2923 * @psalm-suppress MixedReturnStatement 2538 2924 */ 2539 public static function crypto_shorthash($message, $key) 2540 { 2925 public static function crypto_shorthash( 2926 $message, 2927 #[\SensitiveParameter] 2928 $key 2929 ) { 2541 2930 /* Type checks: */ 2542 2931 ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); … … 2587 2976 * @psalm-suppress MixedReturnStatement 2588 2977 */ 2589 public static function crypto_sign($message, $secretKey) 2590 { 2978 public static function crypto_sign( 2979 $message, 2980 #[\SensitiveParameter] 2981 $secretKey 2982 ) { 2591 2983 /* Type checks: */ 2592 2984 ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); … … 2623 3015 * @psalm-suppress MixedReturnStatement 2624 3016 */ 2625 public static function crypto_sign_open($signedMessage, $publicKey) 2626 { 3017 public static function crypto_sign_open( 3018 $signedMessage, 3019 $publicKey 3020 ) { 2627 3021 /* Type checks: */ 2628 3022 ParagonIE_Sodium_Core_Util::declareScalarType($signedMessage, 'string', 1); … … 2680 3074 * @throws SodiumException 2681 3075 */ 2682 public static function crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk) 2683 { 3076 public static function crypto_sign_keypair_from_secretkey_and_publickey( 3077 #[\SensitiveParameter] 3078 $sk, 3079 $pk 3080 ) { 2684 3081 ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1); 2685 3082 ParagonIE_Sodium_Core_Util::declareScalarType($pk, 'string', 1); … … 2709 3106 * @psalm-suppress MixedArgument 2710 3107 */ 2711 public static function crypto_sign_seed_keypair($seed) 2712 { 3108 public static function crypto_sign_seed_keypair( 3109 #[\SensitiveParameter] 3110 $seed 3111 ) { 2713 3112 ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); 2714 3113 … … 2738 3137 * @psalm-suppress MixedArgument 2739 3138 */ 2740 public static function crypto_sign_publickey($keypair) 2741 { 3139 public static function crypto_sign_publickey( 3140 #[\SensitiveParameter] 3141 $keypair 3142 ) { 2742 3143 /* Type checks: */ 2743 3144 ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); … … 2769 3170 * @psalm-suppress MixedArgument 2770 3171 */ 2771 public static function crypto_sign_publickey_from_secretkey($secretKey) 2772 { 3172 public static function crypto_sign_publickey_from_secretkey( 3173 #[\SensitiveParameter] 3174 $secretKey 3175 ) { 2773 3176 /* Type checks: */ 2774 3177 ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); … … 2800 3203 * @psalm-suppress MixedArgument 2801 3204 */ 2802 public static function crypto_sign_secretkey($keypair) 2803 { 3205 public static function crypto_sign_secretkey( 3206 #[\SensitiveParameter] 3207 $keypair 3208 ) { 2804 3209 /* Type checks: */ 2805 3210 ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); … … 2834 3239 * @psalm-suppress MixedArgument 2835 3240 */ 2836 public static function crypto_sign_detached($message, $secretKey) 2837 { 3241 public static function crypto_sign_detached( 3242 $message, 3243 #[\SensitiveParameter] 3244 $secretKey 3245 ) { 2838 3246 /* Type checks: */ 2839 3247 ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); … … 2942 3350 * @psalm-suppress MixedArgument 2943 3351 */ 2944 public static function crypto_sign_ed25519_sk_to_curve25519($sk) 2945 { 3352 public static function crypto_sign_ed25519_sk_to_curve25519( 3353 #[\SensitiveParameter] 3354 $sk 3355 ) { 2946 3356 /* Type checks: */ 2947 3357 ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1); … … 2984 3394 * @psalm-suppress MixedArgument 2985 3395 */ 2986 public static function crypto_stream($len, $nonce, $key) 2987 { 3396 public static function crypto_stream( 3397 $len, 3398 $nonce, 3399 #[\SensitiveParameter] 3400 $key 3401 ) { 2988 3402 /* Type checks: */ 2989 3403 ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1); … … 3031 3445 * @psalm-suppress MixedArgument 3032 3446 */ 3033 public static function crypto_stream_xor($message, $nonce, $key) 3034 { 3447 public static function crypto_stream_xor( 3448 #[\SensitiveParameter] 3449 $message, 3450 $nonce, 3451 #[\SensitiveParameter] 3452 $key 3453 ) { 3035 3454 /* Type checks: */ 3036 3455 ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); … … 3086 3505 * @psalm-suppress MixedArgument 3087 3506 */ 3088 public static function crypto_stream_xchacha20($len, $nonce, $key, $dontFallback = false) 3089 { 3507 public static function crypto_stream_xchacha20( 3508 $len, 3509 $nonce, 3510 #[\SensitiveParameter] 3511 $key, 3512 $dontFallback = false 3513 ) { 3090 3514 /* Type checks: */ 3091 3515 ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1); … … 3131 3555 * @psalm-suppress MixedArgument 3132 3556 */ 3133 public static function crypto_stream_xchacha20_xor($message, $nonce, $key, $dontFallback = false) 3134 { 3557 public static function crypto_stream_xchacha20_xor( 3558 #[\SensitiveParameter] 3559 $message, 3560 $nonce, 3561 #[\SensitiveParameter] 3562 $key, 3563 $dontFallback = false 3564 ) { 3135 3565 /* Type checks: */ 3136 3566 ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); … … 3177 3607 * @psalm-suppress MixedArgument 3178 3608 */ 3179 public static function crypto_stream_xchacha20_xor_ic($message, $nonce, $counter, $key, $dontFallback = false) 3180 { 3609 public static function crypto_stream_xchacha20_xor_ic( 3610 #[\SensitiveParameter] 3611 $message, 3612 $nonce, 3613 $counter, 3614 #[\SensitiveParameter] 3615 $key, 3616 $dontFallback = false 3617 ) { 3181 3618 /* Type checks: */ 3182 3619 ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); … … 3227 3664 * @psalm-suppress MixedArgument 3228 3665 */ 3229 public static function hex2bin($string, $ignore = '') 3230 { 3666 public static function hex2bin( 3667 #[\SensitiveParameter] 3668 $string, 3669 $ignore = '' 3670 ) { 3231 3671 /* Type checks: */ 3232 3672 ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1); … … 3254 3694 * @psalm-suppress MixedArgument 3255 3695 */ 3256 public static function increment(&$var) 3257 { 3696 public static function increment( 3697 #[\SensitiveParameter] 3698 &$var 3699 ) { 3258 3700 /* Type checks: */ 3259 3701 ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1); … … 3288 3730 * @throws SodiumException 3289 3731 */ 3290 public static function is_zero($str) 3291 { 3732 public static function is_zero( 3733 #[\SensitiveParameter] 3734 $str 3735 ) { 3292 3736 $d = 0; 3293 3737 for ($i = 0; $i < 32; ++$i) { … … 3343 3787 * @psalm-suppress MixedArgument 3344 3788 */ 3345 public static function memcmp($left, $right) 3346 { 3789 public static function memcmp( 3790 #[\SensitiveParameter] 3791 $left, 3792 #[\SensitiveParameter] 3793 $right 3794 ) { 3347 3795 /* Type checks: */ 3348 3796 ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1); … … 3372 3820 * @psalm-suppress TooFewArguments 3373 3821 */ 3374 public static function memzero(&$var) 3375 { 3822 public static function memzero( 3823 #[\SensitiveParameter] 3824 &$var 3825 ) { 3376 3826 /* Type checks: */ 3377 3827 ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1); … … 3403 3853 * @throws SodiumException 3404 3854 */ 3405 public static function pad($unpadded, $blockSize, $dontFallback = false) 3406 { 3855 public static function pad( 3856 #[\SensitiveParameter] 3857 $unpadded, 3858 $blockSize, 3859 $dontFallback = false 3860 ) { 3407 3861 /* Type checks: */ 3408 3862 ParagonIE_Sodium_Core_Util::declareScalarType($unpadded, 'string', 1); … … 3489 3943 * @throws SodiumException 3490 3944 */ 3491 public static function unpad($padded, $blockSize, $dontFallback = false) 3492 { 3945 public static function unpad( 3946 #[\SensitiveParameter] 3947 $padded, 3948 $blockSize, 3949 $dontFallback = false 3950 ) { 3493 3951 /* Type checks: */ 3494 3952 ParagonIE_Sodium_Core_Util::declareScalarType($padded, 'string', 1); … … 3644 4102 * @throws SodiumException 3645 4103 */ 3646 public static function ristretto255_is_valid_point($p, $dontFallback = false) 3647 { 4104 public static function ristretto255_is_valid_point( 4105 #[\SensitiveParameter] 4106 $p, 4107 $dontFallback = false 4108 ) { 3648 4109 if (self::useNewSodiumAPI() && !$dontFallback) { 3649 4110 return sodium_crypto_core_ristretto255_is_valid_point($p); … … 3668 4129 * @throws SodiumException 3669 4130 */ 3670 public static function ristretto255_add($p, $q, $dontFallback = false) 3671 { 4131 public static function ristretto255_add( 4132 #[\SensitiveParameter] 4133 $p, 4134 #[\SensitiveParameter] 4135 $q, 4136 $dontFallback = false 4137 ) { 3672 4138 if (self::useNewSodiumAPI() && !$dontFallback) { 3673 4139 return sodium_crypto_core_ristretto255_add($p, $q); … … 3683 4149 * @throws SodiumException 3684 4150 */ 3685 public static function ristretto255_sub($p, $q, $dontFallback = false) 3686 { 4151 public static function ristretto255_sub( 4152 #[\SensitiveParameter] 4153 $p, 4154 #[\SensitiveParameter] 4155 $q, 4156 $dontFallback = false 4157 ) { 3687 4158 if (self::useNewSodiumAPI() && !$dontFallback) { 3688 4159 return sodium_crypto_core_ristretto255_sub($p, $q); … … 3698 4169 * @throws SodiumException 3699 4170 */ 3700 public static function ristretto255_from_hash($r, $dontFallback = false) 3701 { 4171 public static function ristretto255_from_hash( 4172 #[\SensitiveParameter] 4173 $r, 4174 $dontFallback = false 4175 ) { 3702 4176 if (self::useNewSodiumAPI() && !$dontFallback) { 3703 4177 return sodium_crypto_core_ristretto255_from_hash($r); … … 3740 4214 * @throws SodiumException 3741 4215 */ 3742 public static function ristretto255_scalar_invert($s, $dontFallback = false) 3743 { 4216 public static function ristretto255_scalar_invert( 4217 #[\SensitiveParameter] 4218 $s, 4219 $dontFallback = false 4220 ) { 3744 4221 if (self::useNewSodiumAPI() && !$dontFallback) { 3745 4222 return sodium_crypto_core_ristretto255_scalar_invert($s); … … 3753 4230 * @throws SodiumException 3754 4231 */ 3755 public static function ristretto255_scalar_negate($s, $dontFallback = false) 3756 { 4232 public static function ristretto255_scalar_negate( 4233 #[\SensitiveParameter] 4234 $s, 4235 $dontFallback = false 4236 ) { 3757 4237 if (self::useNewSodiumAPI() && !$dontFallback) { 3758 4238 return sodium_crypto_core_ristretto255_scalar_negate($s); … … 3767 4247 * @throws SodiumException 3768 4248 */ 3769 public static function ristretto255_scalar_complement($s, $dontFallback = false) 3770 { 4249 public static function ristretto255_scalar_complement( 4250 #[\SensitiveParameter] 4251 $s, 4252 $dontFallback = false 4253 ) { 3771 4254 if (self::useNewSodiumAPI() && !$dontFallback) { 3772 4255 return sodium_crypto_core_ristretto255_scalar_complement($s); … … 3782 4265 * @throws SodiumException 3783 4266 */ 3784 public static function ristretto255_scalar_add($x, $y, $dontFallback = false) 3785 { 4267 public static function ristretto255_scalar_add( 4268 #[\SensitiveParameter] 4269 $x, 4270 #[\SensitiveParameter] 4271 $y, 4272 $dontFallback = false 4273 ) { 3786 4274 if (self::useNewSodiumAPI() && !$dontFallback) { 3787 4275 return sodium_crypto_core_ristretto255_scalar_add($x, $y); … … 3797 4285 * @throws SodiumException 3798 4286 */ 3799 public static function ristretto255_scalar_sub($x, $y, $dontFallback = false) 3800 { 4287 public static function ristretto255_scalar_sub( 4288 #[\SensitiveParameter] 4289 $x, 4290 #[\SensitiveParameter] 4291 $y, 4292 $dontFallback = false 4293 ) { 3801 4294 if (self::useNewSodiumAPI() && !$dontFallback) { 3802 4295 return sodium_crypto_core_ristretto255_scalar_sub($x, $y); … … 3812 4305 * @throws SodiumException 3813 4306 */ 3814 public static function ristretto255_scalar_mul($x, $y, $dontFallback = false) 3815 { 4307 public static function ristretto255_scalar_mul( 4308 #[\SensitiveParameter] 4309 $x, 4310 #[\SensitiveParameter] 4311 $y, 4312 $dontFallback = false 4313 ) { 3816 4314 if (self::useNewSodiumAPI() && !$dontFallback) { 3817 4315 return sodium_crypto_core_ristretto255_scalar_mul($x, $y); … … 3827 4325 * @throws SodiumException 3828 4326 */ 3829 public static function scalarmult_ristretto255($n, $p, $dontFallback = false) 3830 { 4327 public static function scalarmult_ristretto255( 4328 #[\SensitiveParameter] 4329 $n, 4330 #[\SensitiveParameter] 4331 $p, 4332 $dontFallback = false 4333 ) { 3831 4334 if (self::useNewSodiumAPI() && !$dontFallback) { 3832 4335 return sodium_crypto_scalarmult_ristretto255($n, $p); … … 3842 4345 * @throws SodiumException 3843 4346 */ 3844 public static function scalarmult_ristretto255_base($n, $dontFallback = false) 3845 { 4347 public static function scalarmult_ristretto255_base( 4348 #[\SensitiveParameter] 4349 $n, 4350 $dontFallback = false 4351 ) { 3846 4352 if (self::useNewSodiumAPI() && !$dontFallback) { 3847 4353 return sodium_crypto_scalarmult_ristretto255_base($n); … … 3856 4362 * @throws SodiumException 3857 4363 */ 3858 public static function ristretto255_scalar_reduce($s, $dontFallback = false) 3859 { 4364 public static function ristretto255_scalar_reduce( 4365 #[\SensitiveParameter] 4366 $s, 4367 $dontFallback = false 4368 ) { 3860 4369 if (self::useNewSodiumAPI() && !$dontFallback) { 3861 4370 return sodium_crypto_core_ristretto255_scalar_reduce($s); … … 3911 4420 * @throws SodiumException 3912 4421 */ 3913 public static function sub(&$val, $addv) 3914 { 4422 public static function sub( 4423 #[\SensitiveParameter] 4424 &$val, 4425 #[\SensitiveParameter] 4426 $addv 4427 ) { 3915 4428 $val_len = ParagonIE_Sodium_Core_Util::strlen($val); 3916 4429 $addv_len = ParagonIE_Sodium_Core_Util::strlen($addv);
Note: See TracChangeset
for help on using the changeset viewer.