<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[58752] trunk/src/wp-includes/sodium_compat: Upgrade/Install: Update sodium_compat to v1.21.1.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/58752">58752</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/58752","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-07-18 12:58:40 +0000 (Thu, 18 Jul 2024)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Upgrade/Install: Update sodium_compat to v1.21.1.
The latest version of sodium_compat includes support for AEGIS and preliminary support for PHP 8.4.
Additionally, the PHP 8.2+ `SensitiveParameter` attribute is now applied where appropriate to functions in the public API. This attribute is used to mark parameters that are sensitive and should be redacted from stack traces.
References:
* [https://github.com/paragonie/sodium_compat/releases/tag/v1.21.0 sodium_compat 1.21.0 release notes]
* [https://github.com/paragonie/sodium_compat/releases/tag/v1.21.1 sodium_compat 1.21.1 release notes]
* [https://github.com/paragonie/sodium_compat/compare/v1.20.0...v1.21.1 Full list of changes in sodium_compat 1.21.1]
Follow-up to <a href="https://core.trac.wordpress.org/changeset/49741">[49741]</a>, <a href="https://core.trac.wordpress.org/changeset/51002">[51002]</a>, <a href="https://core.trac.wordpress.org/changeset/51591">[51591]</a>, <a href="https://core.trac.wordpress.org/changeset/52988">[52988]</a>, <a href="https://core.trac.wordpress.org/changeset/54150">[54150]</a>, <a href="https://core.trac.wordpress.org/changeset/54310">[54310]</a>, <a href="https://core.trac.wordpress.org/changeset/55699">[55699]</a>.
Props jrf, dd32, paragoninitiativeenterprises.
Fixes <a href="https://core.trac.wordpress.org/ticket/61686">#61686</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludessodium_compatautoloadphp">trunk/src/wp-includes/sodium_compat/autoload.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatlibphp72compatphp">trunk/src/wp-includes/sodium_compat/lib/php72compat.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatlibristretto255php">trunk/src/wp-includes/sodium_compat/lib/ristretto255.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatlibsodium_compatphp">trunk/src/wp-includes/sodium_compat/lib/sodium_compat.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatlibstreamxchacha20php">trunk/src/wp-includes/sodium_compat/lib/stream-xchacha20.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcCompatphp">trunk/src/wp-includes/sodium_compat/src/Compat.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcCoreCurve25519GeCachedphp">trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/Cached.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcCoreCurve25519GeP1p1php">trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P1p1.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcCoreCurve25519GeP2php">trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P2.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcCoreCurve25519GeP3php">trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P3.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcCoreCurve25519GePrecompphp">trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/Precomp.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcCoreUtilphp">trunk/src/wp-includes/sodium_compat/src/Core/Util.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcFilephp">trunk/src/wp-includes/sodium_compat/src/File.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunksrcwpincludessodium_compatsrcCoreBase64Commonphp">trunk/src/wp-includes/sodium_compat/src/Core/Base64/Common.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludessodium_compatautoloadphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/autoload.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/autoload.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/autoload.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,6 +54,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // unless PHP >= 5.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> require_once dirname(__FILE__) . '/lib/namespaced.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once dirname(__FILE__) . '/lib/sodium_compat.php';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!defined('SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES')) {
+ require_once dirname(__FILE__) . '/lib/php84compat_const.php';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> require_once dirname(__FILE__) . '/src/PHP52/SplFixedArray.php';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,5 +74,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Older versions of {PHP, ext/sodium} will not define these
</span><span class="cx" style="display: block; padding: 0 10px"> require_once(dirname(__FILE__) . '/lib/php72compat.php');
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if (PHP_VERSION_ID < 80400 || !extension_loaded('sodium')) {
+ require_once dirname(__FILE__) . '/lib/php84compat.php';
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once(dirname(__FILE__) . '/lib/stream-xchacha20.php');
</span><span class="cx" style="display: block; padding: 0 10px"> require_once(dirname(__FILE__) . '/lib/ristretto255.php');
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatlibphp72compatphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/lib/php72compat.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/lib/php72compat.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/lib/php72compat.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,14 +14,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'BASE64_VARIANT_ORIGINAL_NO_PADDING',
</span><span class="cx" style="display: block; padding: 0 10px"> 'BASE64_VARIANT_URLSAFE',
</span><span class="cx" style="display: block; padding: 0 10px"> 'BASE64_VARIANT_URLSAFE_NO_PADDING',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'CRYPTO_AEAD_AES256GCM_KEYBYTES',
+ 'CRYPTO_AEAD_AES256GCM_NSECBYTES',
+ 'CRYPTO_AEAD_AES256GCM_NPUBBYTES',
+ 'CRYPTO_AEAD_AES256GCM_ABYTES',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES',
</span><span class="cx" style="display: block; padding: 0 10px"> 'CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES',
</span><span class="cx" style="display: block; padding: 0 10px"> 'CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES',
</span><span class="cx" style="display: block; padding: 0 10px"> 'CRYPTO_AEAD_CHACHA20POLY1305_ABYTES',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'CRYPTO_AEAD_AES256GCM_KEYBYTES',
- 'CRYPTO_AEAD_AES256GCM_NSECBYTES',
- 'CRYPTO_AEAD_AES256GCM_NPUBBYTES',
- 'CRYPTO_AEAD_AES256GCM_ABYTES',
</del><span class="cx" style="display: block; padding: 0 10px"> 'CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES',
</span><span class="cx" style="display: block; padding: 0 10px"> 'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES',
</span><span class="cx" style="display: block; padding: 0 10px"> 'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,8 +115,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_add(&$string1, $string2)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_add(
+ #[\SensitiveParameter]
+ &$string1,
+ #[\SensitiveParameter]
+ $string2
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Compat::add($string1, $string2);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,8 +134,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_base642bin($string, $variant, $ignore ='')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_base642bin(
+ #[\SensitiveParameter]
+ $string,
+ $variant,
+ $ignore =''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::base642bin($string, $variant, $ignore);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,8 +152,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_bin2base64($string, $variant)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_bin2base64(
+ #[\SensitiveParameter]
+ $string,
+ $variant
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::bin2base64($string, $variant);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,8 +168,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_bin2hex($string)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_bin2hex(
+ #[\SensitiveParameter]
+ $string
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::bin2hex($string);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,8 +184,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_compare($string1, $string2)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_compare(
+ #[\SensitiveParameter]
+ $string1,
+ #[\SensitiveParameter]
+ $string2
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::compare($string1, $string2);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,8 +202,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $additional_data, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_aes256gcm_decrypt(
+ $ciphertext,
+ $additional_data,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt(
</span><span class="cx" style="display: block; padding: 0 10px"> $ciphertext,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,8 +237,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_aead_aes256gcm_encrypt($message, $additional_data, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_aes256gcm_encrypt(
+ #[\SensitiveParameter]
+ $message,
+ $additional_data,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $additional_data, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,8 +267,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_aead_chacha20poly1305_decrypt($ciphertext, $additional_data, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_chacha20poly1305_decrypt(
+ $ciphertext,
+ $additional_data,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt(
</span><span class="cx" style="display: block; padding: 0 10px"> $ciphertext,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,8 +299,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_aead_chacha20poly1305_encrypt($message, $additional_data, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_chacha20poly1305_encrypt(
+ #[\SensitiveParameter]
+ $message,
+ $additional_data,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt(
</span><span class="cx" style="display: block; padding: 0 10px"> $message,
</span><span class="cx" style="display: block; padding: 0 10px"> $additional_data,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -296,8 +335,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_aead_chacha20poly1305_ietf_decrypt($message, $additional_data, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_chacha20poly1305_ietf_decrypt(
+ $message,
+ $additional_data,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt(
</span><span class="cx" style="display: block; padding: 0 10px"> $message,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,8 +367,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_aead_chacha20poly1305_ietf_encrypt($message, $additional_data, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_chacha20poly1305_ietf_encrypt(
+ #[\SensitiveParameter]
+ $message,
+ $additional_data,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt(
</span><span class="cx" style="display: block; padding: 0 10px"> $message,
</span><span class="cx" style="display: block; padding: 0 10px"> $additional_data,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -353,8 +403,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($ciphertext, $additional_data, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt(
+ $ciphertext,
+ $additional_data,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt(
</span><span class="cx" style="display: block; padding: 0 10px"> $ciphertext,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -382,9 +437,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $message,
</span><span class="cx" style="display: block; padding: 0 10px"> $additional_data,
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,8 +473,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_auth($message, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_auth(
+ $message,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_auth($message, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -442,8 +502,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_auth_verify($mac, $message, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_auth_verify(
+ $mac,
+ $message,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -457,8 +521,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box($message, $nonce, $key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -483,8 +552,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box_keypair_from_secretkey_and_publickey($secret_key, $public_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_keypair_from_secretkey_and_publickey(
+ #[\SensitiveParameter]
+ $secret_key,
+ $public_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($secret_key, $public_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -496,8 +568,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key_pair
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box_open($ciphertext, $nonce, $key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_open(
+ $ciphertext,
+ $nonce,
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_open($ciphertext, $nonce, $key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -515,8 +591,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box_publickey($key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_publickey(
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_publickey($key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -528,8 +606,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box_publickey_from_secretkey($secret_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_publickey_from_secretkey(
+ #[\SensitiveParameter]
+ $secret_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($secret_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -542,8 +622,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box_seal($message, $public_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_seal(
+ #[\SensitiveParameter]
+ $message,
+ $public_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_seal($message, $public_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -555,8 +638,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box_seal_open($message, $key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_seal_open(
+ $message,
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (SodiumException $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -575,8 +661,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box_secretkey($key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_secretkey(
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_secretkey($key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -588,8 +676,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_box_seed_keypair($seed)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_seed_keypair(
+ #[\SensitiveParameter]
+ $seed
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_seed_keypair($seed);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,8 +693,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_generichash($message, $key = null, $length = 32)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_generichash(
+ $message,
+ #[\SensitiveParameter]
+ $key = null,
+ $length = 32
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $length);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -631,8 +725,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_generichash_init($key = null, $length = 32)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_generichash_init(
+ #[\SensitiveParameter]
+ $key = null,
+ $length = 32
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $length);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -656,8 +753,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_generichash_update(&$state, $message = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_generichash_update(
+ #[\SensitiveParameter]
+ &$state,
+ $message = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Compat::crypto_generichash_update($state, $message);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -682,8 +782,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_kdf_derive_from_key($subkey_length, $subkey_id, $context, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kdf_derive_from_key(
+ $subkey_length,
+ $subkey_id,
+ $context,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key(
</span><span class="cx" style="display: block; padding: 0 10px"> $subkey_length,
</span><span class="cx" style="display: block; padding: 0 10px"> $subkey_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -703,8 +808,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_kx($my_secret, $their_public, $client_public, $server_public)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx(
+ #[\SensitiveParameter]
+ $my_secret,
+ $their_public,
+ $client_public,
+ $server_public
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kx(
</span><span class="cx" style="display: block; padding: 0 10px"> $my_secret,
</span><span class="cx" style="display: block; padding: 0 10px"> $their_public,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -719,8 +829,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_kx_seed_keypair($seed)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_seed_keypair(
+ #[\SensitiveParameter]
+ $seed
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kx_seed_keypair($seed);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -741,8 +853,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array{0: string, 1: string}
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_kx_client_session_keys($client_key_pair, $server_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_client_session_keys(
+ #[\SensitiveParameter]
+ $client_key_pair,
+ $server_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($client_key_pair, $server_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -753,8 +868,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array{0: string, 1: string}
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_kx_server_session_keys($server_key_pair, $client_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_server_session_keys(
+ #[\SensitiveParameter]
+ $server_key_pair,
+ $client_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($server_key_pair, $client_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -764,8 +882,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_kx_secretkey($key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_secretkey(
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kx_secretkey($key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -775,8 +895,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_kx_publickey($key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_publickey(
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kx_publickey($key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -793,8 +915,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo = null)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_pwhash(
+ $length,
+ #[\SensitiveParameter]
+ $passwd,
+ $salt,
+ $opslimit,
+ $memlimit,
+ $algo = null
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -808,8 +937,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_pwhash_str(
+ #[\SensitiveParameter]
+ $passwd,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -823,8 +956,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_pwhash_str_needs_rehash(
+ #[\SensitiveParameter]
+ $hash,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -837,8 +974,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_pwhash_str_verify($passwd, $hash)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_pwhash_str_verify(
+ #[\SensitiveParameter]
+ $passwd,
+ #[\SensitiveParameter]
+ $hash
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -854,8 +995,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_pwhash_scryptsalsa208sha256($length, $passwd, $salt, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_pwhash_scryptsalsa208sha256(
+ $length,
+ #[\SensitiveParameter]
+ $passwd,
+ $salt,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256(
</span><span class="cx" style="display: block; padding: 0 10px"> $length,
</span><span class="cx" style="display: block; padding: 0 10px"> $passwd,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -875,8 +1022,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_pwhash_scryptsalsa208sha256_str(
+ #[\SensitiveParameter]
+ $passwd,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -889,8 +1040,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify(
+ #[\SensitiveParameter]
+ $passwd,
+ #[\SensitiveParameter]
+ $hash
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -903,8 +1058,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_scalarmult($n, $p)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_scalarmult(
+ #[\SensitiveParameter]
+ $n,
+ $p
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -916,8 +1074,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_scalarmult_base($n)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_scalarmult_base(
+ #[\SensitiveParameter]
+ $n
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -931,8 +1091,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_secretbox($message, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretbox(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -955,8 +1120,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_secretbox_open($ciphertext, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretbox_open(
+ $ciphertext,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_secretbox_open($ciphertext, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -972,8 +1141,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array<int, string>
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_secretstream_xchacha20poly1305_init_push($key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretstream_xchacha20poly1305_init_push(
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_push($key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -987,7 +1158,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function sodium_crypto_secretstream_xchacha20poly1305_push(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> &$state,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $message,
</span><span class="cx" style="display: block; padding: 0 10px"> $additional_data = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $tag = 0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1007,8 +1180,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_secretstream_xchacha20poly1305_init_pull($header, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretstream_xchacha20poly1305_init_pull(
+ $header,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_pull($header, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1020,8 +1196,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool|array{0: string, 1: int}
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_secretstream_xchacha20poly1305_pull(&$state, $ciphertext, $additional_data = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretstream_xchacha20poly1305_pull(
+ #[\SensitiveParameter]
+ &$state,
+ $ciphertext,
+ $additional_data = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull(
</span><span class="cx" style="display: block; padding: 0 10px"> $state,
</span><span class="cx" style="display: block; padding: 0 10px"> $ciphertext,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1035,8 +1215,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_secretstream_xchacha20poly1305_rekey(&$state)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretstream_xchacha20poly1305_rekey(
+ #[\SensitiveParameter]
+ &$state
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_rekey($state);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1059,8 +1241,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_shorthash($message, $key = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_shorthash(
+ $message,
+ #[\SensitiveParameter]
+ $key = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1084,8 +1269,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_sign($message, $secret_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign(
+ $message,
+ #[\SensitiveParameter]
+ $secret_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign($message, $secret_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1098,8 +1286,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_sign_detached($message, $secret_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_detached(
+ $message,
+ #[\SensitiveParameter]
+ $secret_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $secret_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1112,8 +1303,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_sign_keypair_from_secretkey_and_publickey($secret_key, $public_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_keypair_from_secretkey_and_publickey(
+ #[\SensitiveParameter]
+ $secret_key,
+ $public_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($secret_key, $public_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1155,8 +1349,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_sign_publickey($key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_publickey(
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_publickey($key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1168,8 +1364,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_sign_publickey_from_secretkey($secret_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_publickey_from_secretkey(
+ #[\SensitiveParameter]
+ $secret_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($secret_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1181,8 +1379,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_sign_secretkey($key_pair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_secretkey(
+ #[\SensitiveParameter]
+ $key_pair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_secretkey($key_pair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1194,8 +1394,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_sign_seed_keypair($seed)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_seed_keypair(
+ #[\SensitiveParameter]
+ $seed
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1235,8 +1437,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_sign_ed25519_sk_to_curve25519($secret_key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_ed25519_sk_to_curve25519(
+ #[\SensitiveParameter]
+ $secret_key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($secret_key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1250,8 +1454,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_stream($length, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_stream(
+ $length,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_stream($length, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1276,8 +1484,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_stream_xor($message, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_stream_xor(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1291,8 +1504,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_hex2bin($string, $ignore = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_hex2bin(
+ #[\SensitiveParameter]
+ $string,
+ $ignore = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::hex2bin($string, $ignore);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1304,8 +1520,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_increment(&$string)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_increment(
+ #[\SensitiveParameter]
+ &$string
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Compat::increment($string);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1348,8 +1566,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_memcmp($string1, $string2)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_memcmp(
+ #[\SensitiveParameter]
+ $string1,
+ #[\SensitiveParameter]
+ $string2
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::memcmp($string1, $string2);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1363,8 +1585,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress ReferenceConstraintViolation
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_memzero(&$string)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_memzero(
+ #[\SensitiveParameter]
+ &$string
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Compat::memzero($string);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1377,8 +1601,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_pad($unpadded, $block_size)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_pad(
+ #[\SensitiveParameter]
+ $unpadded,
+ $block_size
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::pad($unpadded, $block_size, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1391,8 +1618,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_unpad($padded, $block_size)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_unpad(
+ #[\SensitiveParameter]
+ $padded,
+ $block_size
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::unpad($padded, $block_size, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatlibristretto255php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/lib/ristretto255.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/lib/ristretto255.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/lib/ristretto255.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,8 +47,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_add($p, $q)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_add(
+ #[\SensitiveParameter]
+ $p,
+ #[\SensitiveParameter]
+ $q
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_add($p, $q, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,8 +64,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_from_hash($s)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_from_hash(
+ #[\SensitiveParameter]
+ $s
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_from_hash($s, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,8 +79,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_is_valid_point($s)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_is_valid_point(
+ #[\SensitiveParameter]
+ $s
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_is_valid_point($s, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,8 +107,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_scalar_add($x, $y)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_add(
+ #[\SensitiveParameter]
+ $x,
+ #[\SensitiveParameter]
+ $y
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_scalar_add($x, $y, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,8 +124,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_scalar_complement($s)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_complement(
+ #[\SensitiveParameter]
+ $s
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_scalar_complement($s, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,8 +139,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_scalar_invert($p)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_invert(
+ #[\SensitiveParameter]
+ $p
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_scalar_invert($p, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,8 +155,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_scalar_mul($x, $y)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_mul(
+ #[\SensitiveParameter]
+ $x,
+ #[\SensitiveParameter]
+ $y
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_scalar_mul($x, $y, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,8 +172,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_scalar_negate($s)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_negate(
+ #[\SensitiveParameter]
+ $s
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_scalar_negate($s, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,8 +199,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_scalar_reduce($s)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_reduce(
+ #[\SensitiveParameter]
+ $s
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_scalar_reduce($s, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -191,8 +215,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_scalar_sub($x, $y)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_sub(
+ #[\SensitiveParameter]
+ $x,
+ #[\SensitiveParameter]
+ $y
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_scalar_sub($x, $y, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,8 +233,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_core_ristretto255_sub($p, $q)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_sub(
+ #[\SensitiveParameter]
+ $p,
+ #[\SensitiveParameter]
+ $q
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::ristretto255_sub($p, $q, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -219,8 +251,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_scalarmult_ristretto255($n, $p)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_scalarmult_ristretto255(
+ #[\SensitiveParameter]
+ $n,
+ #[\SensitiveParameter]
+ $p
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::scalarmult_ristretto255($n, $p, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,8 +268,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_scalarmult_ristretto255_base($n)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_scalarmult_ristretto255_base(
+ #[\SensitiveParameter]
+ $n
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::scalarmult_ristretto255_base($n, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatlibsodium_compatphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/lib/sodium_compat.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/lib/sodium_compat.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/lib/sodium_compat.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,8 +20,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function bin2hex($string)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bin2hex(
+ #[\SensitiveParameter]
+ $string
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::bin2hex($string);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,8 +36,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function compare($a, $b)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compare(
+ #[\SensitiveParameter]
+ $a,
+ #[\SensitiveParameter]
+ $b
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::compare($a, $b);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,8 +54,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_aead_aes256gcm_decrypt(
+ $message,
+ $assocData,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (\TypeError $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,8 +81,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_aead_aes256gcm_encrypt(
+ #[\SensitiveParameter]
+ $message,
+ $assocData,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,8 +111,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_aead_chacha20poly1305_decrypt(
+ $message,
+ $assocData,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (\TypeError $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,8 +138,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_aead_chacha20poly1305_encrypt(
+ #[\SensitiveParameter]
+ $message,
+ $assocData,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,8 +158,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_aead_chacha20poly1305_ietf_decrypt(
+ $message,
+ $assocData,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (\TypeError $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,8 +185,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_aead_chacha20poly1305_ietf_encrypt(
+ #[\SensitiveParameter]
+ $message,
+ $assocData,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,8 +205,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_auth($message, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_auth(
+ $message,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_auth($message, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,8 +223,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_auth_verify($mac, $message, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_auth_verify(
+ $mac,
+ $message,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,8 +242,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_box($message, $nonce, $kp)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_box(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $kp
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $kp);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,8 +273,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_box_keypair_from_secretkey_and_publickey($sk, $pk)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_box_keypair_from_secretkey_and_publickey(
+ #[\SensitiveParameter]
+ $sk,
+ $pk
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($sk, $pk);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -235,8 +289,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $kp
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_box_open($message, $nonce, $kp)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_box_open(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $kp
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (\TypeError $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -254,8 +313,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_box_publickey($keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_box_publickey(
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_publickey($keypair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,8 +328,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_box_publickey_from_secretkey($sk)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_box_publickey_from_secretkey(
+ #[\SensitiveParameter]
+ $sk
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($sk);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,8 +344,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_box_seal($message, $publicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_box_seal(
+ #[\SensitiveParameter]
+ $message,
+ $publicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_seal($message, $publicKey);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -293,8 +359,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $kp
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_box_seal_open($message, $kp)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_box_seal_open(
+ $message,
+ #[\SensitiveParameter]
+ $kp
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (\TypeError $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,8 +381,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_box_secretkey($keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_box_secretkey(
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -327,8 +398,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_generichash($message, $key = null, $outLen = 32)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_generichash(
+ $message,
+ #[\SensitiveParameter]
+ $key = null,
+ $outLen = 32
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -341,8 +416,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_generichash_final(&$ctx, $outputLength = 32)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_generichash_final(
+ #[\SensitiveParameter]
+ &$ctx,
+ $outputLength = 32
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -355,8 +433,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_generichash_init($key = null, $outLen = 32)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_generichash_init(
+ #[\SensitiveParameter]
+ $key = null,
+ $outLen = 32
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,8 +450,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_generichash_update(&$ctx, $message = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_generichash_update(
+ #[\SensitiveParameter]
+ &$ctx,
+ $message = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -385,8 +469,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_kx($my_secret, $their_public, $client_public, $server_public)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_kx(
+ #[\SensitiveParameter]
+ $my_secret,
+ $their_public,
+ $client_public,
+ $server_public
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kx(
</span><span class="cx" style="display: block; padding: 0 10px"> $my_secret,
</span><span class="cx" style="display: block; padding: 0 10px"> $their_public,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,8 +497,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_pwhash(
+ $outlen,
+ #[\SensitiveParameter]
+ $passwd,
+ $salt,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,8 +518,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_pwhash_str($passwd, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_pwhash_str(
+ #[\SensitiveParameter]
+ $passwd,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -437,8 +536,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_pwhash_str_verify($passwd, $hash)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_pwhash_str_verify(
+ #[\SensitiveParameter]
+ $passwd,
+ #[\SensitiveParameter]
+ $hash
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,8 +557,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_pwhash_scryptsalsa208sha256(
+ $outlen,
+ #[\SensitiveParameter]
+ $passwd,
+ #[\SensitiveParameter]
+ $salt,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -469,8 +579,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_pwhash_scryptsalsa208sha256_str(
+ #[\SensitiveParameter]
+ $passwd,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -483,8 +597,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_pwhash_scryptsalsa208sha256_str_verify(
+ #[\SensitiveParameter]
+ $passwd,
+ #[\SensitiveParameter]
+ $hash
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -497,8 +615,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_scalarmult($n, $p)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_scalarmult(
+ #[\SensitiveParameter]
+ $n,
+ $p
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -510,8 +631,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_scalarmult_base($n)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_scalarmult_base(
+ #[\SensitiveParameter]
+ $n
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -525,8 +648,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_secretbox($message, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_secretbox(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -538,8 +666,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_secretbox_open($message, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_secretbox_open(
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (\TypeError $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -558,8 +690,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_shorthash($message, $key = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_shorthash(
+ $message,
+ #[\SensitiveParameter]
+ $key = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -572,8 +707,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_sign($message, $sk)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_sign(
+ $message,
+ #[\SensitiveParameter]
+ $sk
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign($message, $sk);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -586,8 +724,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_sign_detached($message, $sk)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_sign_detached(
+ $message,
+ #[\SensitiveParameter]
+ $sk
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -629,8 +770,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_sign_publickey($keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_sign_publickey(
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -642,8 +785,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_sign_publickey_from_secretkey($sk)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_sign_publickey_from_secretkey(
+ #[\SensitiveParameter]
+ $sk
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -655,8 +800,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_sign_secretkey($keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_sign_secretkey(
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -668,8 +815,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_sign_seed_keypair($seed)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_sign_seed_keypair(
+ #[\SensitiveParameter]
+ $seed
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -709,8 +858,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_sign_ed25519_sk_to_curve25519($sk)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_sign_ed25519_sk_to_curve25519(
+ #[\SensitiveParameter]
+ $sk
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -724,8 +875,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_stream($len, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_stream(
+ $len,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -739,8 +894,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function crypto_stream_xor($message, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function crypto_stream_xor(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -752,8 +912,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function hex2bin($string)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function hex2bin(
+ #[\SensitiveParameter]
+ $string
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::hex2bin($string);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -766,8 +928,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws \TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function memcmp($a, $b)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function memcmp(
+ #[\SensitiveParameter]
+ $a,
+ #[\SensitiveParameter]
+ $b
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::memcmp($a, $b);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -783,8 +949,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MissingReturnType
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress ReferenceConstraintViolation
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function memzero(&$str)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function memzero(
+ #[\SensitiveParameter]
+ &$str
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Compat::memzero($str);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatlibstreamxchacha20php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/lib/stream-xchacha20.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/lib/stream-xchacha20.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/lib/stream-xchacha20.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,8 +10,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_stream_xchacha20($len, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_stream_xchacha20(
+ $len,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_stream_xchacha20($len, $nonce, $key, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,8 +40,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_stream_xchacha20_xor($message, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_stream_xchacha20_xor(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor($message, $nonce, $key, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,8 +61,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function sodium_crypto_stream_xchacha20_xor_ic($message, $nonce, $counter, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_stream_xchacha20_xor_ic(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ $counter,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor_ic($message, $nonce, $counter, $key, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcCompatphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/src/Compat.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/Compat.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/Compat.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,6 +59,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> const CRYPTO_AEAD_AES256GCM_NSECBYTES = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> const CRYPTO_AEAD_AES256GCM_NPUBBYTES = 12;
</span><span class="cx" style="display: block; padding: 0 10px"> const CRYPTO_AEAD_AES256GCM_ABYTES = 16;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const CRYPTO_AEAD_AEGIS128L_KEYBYTES = 16;
+ const CRYPTO_AEAD_AEGIS128L_NSECBYTES = 0;
+ const CRYPTO_AEAD_AEGIS128L_NPUBBYTES = 16;
+ const CRYPTO_AEAD_AEGIS128L_ABYTES = 32;
+ const CRYPTO_AEAD_AEGIS256_KEYBYTES = 32;
+ const CRYPTO_AEAD_AEGIS256_NSECBYTES = 0;
+ const CRYPTO_AEAD_AEGIS256_NPUBBYTES = 32;
+ const CRYPTO_AEAD_AEGIS256_ABYTES = 32;
</ins><span class="cx" style="display: block; padding: 0 10px"> const CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = 32;
</span><span class="cx" style="display: block; padding: 0 10px"> const CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> const CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES = 8;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -155,8 +163,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function add(&$val, $addv)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function add(
+ #[\SensitiveParameter]
+ &$val,
+ #[\SensitiveParameter]
+ $addv
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $val_len = ParagonIE_Sodium_Core_Util::strlen($val);
</span><span class="cx" style="display: block; padding: 0 10px"> $addv_len = ParagonIE_Sodium_Core_Util::strlen($addv);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($val_len !== $addv_len) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,8 +193,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function base642bin($encoded, $variant, $ignore = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function base642bin(
+ #[\SensitiveParameter]
+ $encoded,
+ $variant,
+ $ignore = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($encoded, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,8 +240,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function bin2base64($decoded, $variant)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function bin2base64(
+ #[\SensitiveParameter]
+ $decoded,
+ $variant
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($decoded, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var string $decoded */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,8 +276,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function bin2hex($string)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function bin2hex(
+ #[\SensitiveParameter]
+ $string
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,8 +305,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function compare($left, $right)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function compare(
+ #[\SensitiveParameter]
+ $left,
+ #[\SensitiveParameter]
+ $right
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,6 +325,224 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Authenticated Encryption with Associated Data: Decryption
+ *
+ * Algorithm:
+ * AEGIS-128L
+ *
+ * @param string $ciphertext Encrypted message (with MAC appended)
+ * @param string $assocData Authenticated Associated Data (unencrypted)
+ * @param string $nonce Number to be used only Once; must be 32 bytes
+ * @param string $key Encryption key
+ *
+ * @return string The original plaintext message
+ * @throws SodiumException
+ * @throws TypeError
+ * @psalm-suppress MixedArgument
+ * @psalm-suppress MixedInferredReturnType
+ * @psalm-suppress MixedReturnStatement
+ */
+ public static function crypto_aead_aegis128l_decrypt(
+ $ciphertext = '',
+ $assocData = '',
+ $nonce = '',
+ #[\SensitiveParameter]
+ $key = ''
+ ) {
+ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);
+ ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);
+ ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);
+ ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);
+
+ /* Input validation: */
+ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AEGIS128L_NPUBBYTES) {
+ throw new SodiumException('Nonce must be CRYPTO_AEAD_AEGIS_128L_NPUBBYTES long');
+ }
+ if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AEGIS128L_KEYBYTES) {
+ throw new SodiumException('Key must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long');
+ }
+ $ct_length = ParagonIE_Sodium_Core_Util::strlen($ciphertext);
+ if ($ct_length < self::CRYPTO_AEAD_AEGIS128L_ABYTES) {
+ throw new SodiumException('Message must be at least CRYPTO_AEAD_AEGIS128L_ABYTES long');
+ }
+
+ $ct = ParagonIE_Sodium_Core_Util::substr(
+ $ciphertext,
+ 0,
+ $ct_length - self::CRYPTO_AEAD_AEGIS128L_ABYTES
+ );
+ $tag = ParagonIE_Sodium_Core_Util::substr(
+ $ciphertext,
+ $ct_length - self::CRYPTO_AEAD_AEGIS128L_ABYTES,
+ self::CRYPTO_AEAD_AEGIS128L_ABYTES
+ );
+ return ParagonIE_Sodium_Core_AEGIS128L::decrypt($ct, $tag, $assocData, $key, $nonce);
+ }
+
+ /**
+ * Authenticated Encryption with Associated Data: Encryption
+ *
+ * Algorithm:
+ * AEGIS-128L
+ *
+ * @param string $plaintext Message to be encrypted
+ * @param string $assocData Authenticated Associated Data (unencrypted)
+ * @param string $nonce Number to be used only Once; must be 32 bytes
+ * @param string $key Encryption key
+ *
+ * @return string Ciphertext with 32-byte authentication tag appended
+ * @throws SodiumException
+ * @throws TypeError
+ * @psalm-suppress MixedArgument
+ */
+ public static function crypto_aead_aegis128l_encrypt(
+ #[\SensitiveParameter]
+ $plaintext = '',
+ $assocData = '',
+ $nonce = '',
+ #[\SensitiveParameter]
+ $key = ''
+ ) {
+ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);
+ ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);
+ ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);
+ ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);
+
+ /* Input validation: */
+ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AEGIS128L_NPUBBYTES) {
+ throw new SodiumException('Nonce must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long');
+ }
+ if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AEGIS128L_KEYBYTES) {
+ throw new SodiumException('Key must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long');
+ }
+
+ list($ct, $tag) = ParagonIE_Sodium_Core_AEGIS128L::encrypt($plaintext, $assocData, $key, $nonce);
+ return $ct . $tag;
+ }
+
+ /**
+ * Return a secure random key for use with the AEGIS-128L
+ * symmetric AEAD interface.
+ *
+ * @return string
+ * @throws Exception
+ * @throws Error
+ */
+ public static function crypto_aead_aegis128l_keygen()
+ {
+ return random_bytes(self::CRYPTO_AEAD_AEGIS128L_KEYBYTES);
+ }
+
+ /**
+ * Authenticated Encryption with Associated Data: Decryption
+ *
+ * Algorithm:
+ * AEGIS-256
+ *
+ * @param string $ciphertext Encrypted message (with MAC appended)
+ * @param string $assocData Authenticated Associated Data (unencrypted)
+ * @param string $nonce Number to be used only Once; must be 32 bytes
+ * @param string $key Encryption key
+ *
+ * @return string The original plaintext message
+ * @throws SodiumException
+ * @throws TypeError
+ * @psalm-suppress MixedArgument
+ * @psalm-suppress MixedInferredReturnType
+ * @psalm-suppress MixedReturnStatement
+ */
+ public static function crypto_aead_aegis256_decrypt(
+ $ciphertext = '',
+ $assocData = '',
+ $nonce = '',
+ #[\SensitiveParameter]
+ $key = ''
+ ) {
+ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);
+ ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);
+ ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);
+ ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);
+
+ /* Input validation: */
+ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AEGIS256_NPUBBYTES) {
+ throw new SodiumException('Nonce must be CRYPTO_AEAD_AEGIS256_NPUBBYTES long');
+ }
+ if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AEGIS256_KEYBYTES) {
+ throw new SodiumException('Key must be CRYPTO_AEAD_AEGIS256_KEYBYTES long');
+ }
+ $ct_length = ParagonIE_Sodium_Core_Util::strlen($ciphertext);
+ if ($ct_length < self::CRYPTO_AEAD_AEGIS256_ABYTES) {
+ throw new SodiumException('Message must be at least CRYPTO_AEAD_AEGIS256_ABYTES long');
+ }
+
+ $ct = ParagonIE_Sodium_Core_Util::substr(
+ $ciphertext,
+ 0,
+ $ct_length - self::CRYPTO_AEAD_AEGIS256_ABYTES
+ );
+ $tag = ParagonIE_Sodium_Core_Util::substr(
+ $ciphertext,
+ $ct_length - self::CRYPTO_AEAD_AEGIS256_ABYTES,
+ self::CRYPTO_AEAD_AEGIS256_ABYTES
+ );
+ return ParagonIE_Sodium_Core_AEGIS256::decrypt($ct, $tag, $assocData, $key, $nonce);
+ }
+
+ /**
+ * Authenticated Encryption with Associated Data: Encryption
+ *
+ * Algorithm:
+ * AEGIS-256
+ *
+ * @param string $plaintext Message to be encrypted
+ * @param string $assocData Authenticated Associated Data (unencrypted)
+ * @param string $nonce Number to be used only Once; must be 32 bytes
+ * @param string $key Encryption key
+ *
+ * @return string Ciphertext with 32-byte authentication tag appended
+ * @throws SodiumException
+ * @throws TypeError
+ * @psalm-suppress MixedArgument
+ */
+ public static function crypto_aead_aegis256_encrypt(
+ #[\SensitiveParameter]
+ $plaintext = '',
+ $assocData = '',
+ $nonce = '',
+ #[\SensitiveParameter]
+ $key = ''
+ ) {
+ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);
+ ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2);
+ ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3);
+ ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4);
+
+ /* Input validation: */
+ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AEGIS256_NPUBBYTES) {
+ throw new SodiumException('Nonce must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long');
+ }
+ if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AEGIS256_KEYBYTES) {
+ throw new SodiumException('Key must be CRYPTO_AEAD_AEGIS128L_KEYBYTES long');
+ }
+
+ list($ct, $tag) = ParagonIE_Sodium_Core_AEGIS256::encrypt($plaintext, $assocData, $key, $nonce);
+ return $ct . $tag;
+ }
+
+ /**
+ * Return a secure random key for use with the AEGIS-256
+ * symmetric AEAD interface.
+ *
+ * @return string
+ * @throws Exception
+ * @throws Error
+ */
+ public static function crypto_aead_aegis256_keygen()
+ {
+ return random_bytes(self::CRYPTO_AEAD_AEGIS256_KEYBYTES);
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Is AES-256-GCM even available to use?
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,6 +594,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ciphertext = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $assocData = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = ''
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!self::crypto_aead_aes256gcm_is_available()) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,9 +652,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function crypto_aead_aes256gcm_encrypt(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $plaintext = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $assocData = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = ''
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!self::crypto_aead_aes256gcm_is_available()) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -484,6 +730,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ciphertext = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $assocData = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = ''
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -561,9 +808,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function crypto_aead_chacha20poly1305_encrypt(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $plaintext = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $assocData = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = ''
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -638,6 +887,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ciphertext = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $assocData = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = ''
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -728,9 +978,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function crypto_aead_chacha20poly1305_ietf_encrypt(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $plaintext = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $assocData = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = ''
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -819,6 +1071,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ciphertext = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $assocData = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $dontFallback = false
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -891,9 +1144,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function crypto_aead_xchacha20poly1305_ietf_encrypt(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $plaintext = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $assocData = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $dontFallback = false
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -971,8 +1226,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_auth($message, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_auth(
+ $message,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1016,8 +1274,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_auth_verify($mac, $message, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_auth_verify(
+ $mac,
+ $message,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($mac, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1060,8 +1322,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box($plaintext, $nonce, $keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box(
+ $plaintext,
+ $nonce,
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1104,8 +1370,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box_seal($plaintext, $publicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box_seal(
+ #[\SensitiveParameter]
+ $plaintext,
+ $publicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1142,8 +1411,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedInferredReturnType
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedReturnStatement
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box_seal_open($ciphertext, $keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box_seal_open(
+ $ciphertext,
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1205,8 +1477,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box_keypair_from_secretkey_and_publickey($secretKey, $publicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box_keypair_from_secretkey_and_publickey(
+ #[\SensitiveParameter]
+ $secretKey,
+ $publicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1244,8 +1519,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedInferredReturnType
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedReturnStatement
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box_open($ciphertext, $nonce, $keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box_open(
+ $ciphertext,
+ $nonce,
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1287,8 +1566,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box_publickey($keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box_publickey(
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1318,8 +1599,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box_publickey_from_secretkey($secretKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box_publickey_from_secretkey(
+ #[\SensitiveParameter]
+ $secretKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1349,8 +1632,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box_secretkey($keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box_secretkey(
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1381,8 +1666,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress UndefinedFunction
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_box_seed_keypair($seed)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_box_seed_keypair(
+ #[\SensitiveParameter]
+ $seed
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1411,8 +1698,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_generichash($message, $key = '', $length = self::CRYPTO_GENERICHASH_BYTES)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_generichash(
+ $message,
+ #[\SensitiveParameter]
+ $key = '',
+ $length = self::CRYPTO_GENERICHASH_BYTES
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> if (is_null($key)) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1455,8 +1746,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress ReferenceConstraintViolation
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress ConflictingReferenceConstraint
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_generichash_final(&$ctx, $length = self::CRYPTO_GENERICHASH_BYTES)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_generichash_final(
+ #[\SensitiveParameter]
+ &$ctx,
+ $length = self::CRYPTO_GENERICHASH_BYTES
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1500,8 +1794,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_generichash_init($key = '', $length = self::CRYPTO_GENERICHASH_BYTES)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_generichash_init(
+ #[\SensitiveParameter]
+ $key = '',
+ $length = self::CRYPTO_GENERICHASH_BYTES
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (is_null($key)) {
</span><span class="cx" style="display: block; padding: 0 10px"> $key = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1545,6 +1842,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function crypto_generichash_init_salt_personal(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key = '',
</span><span class="cx" style="display: block; padding: 0 10px"> $length = self::CRYPTO_GENERICHASH_BYTES,
</span><span class="cx" style="display: block; padding: 0 10px"> $salt = '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1591,8 +1889,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress ReferenceConstraintViolation
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_generichash_update(&$ctx, $message)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_generichash_update(
+ #[\SensitiveParameter]
+ &$ctx,
+ $message
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1635,6 +1936,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $subkey_len,
</span><span class="cx" style="display: block; padding: 0 10px"> $subkey_id,
</span><span class="cx" style="display: block; padding: 0 10px"> $context,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ #[\SensitiveParameter]
</ins><span class="cx" style="display: block; padding: 0 10px"> $key
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($subkey_len, 'int', 1);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1712,8 +2014,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_kx($my_secret, $their_public, $client_public, $server_public, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_kx(
+ #[\SensitiveParameter]
+ $my_secret,
+ $their_public,
+ $client_public,
+ $server_public,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($my_secret, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($their_public, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1774,8 +2082,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_kx_seed_keypair($seed)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_kx_seed_keypair(
+ #[\SensitiveParameter]
+ $seed
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $seed = (string) $seed;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1806,8 +2116,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array{0: string, 1: string}
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_kx_client_session_keys($keypair, $serverPublicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_kx_client_session_keys(
+ #[\SensitiveParameter]
+ $keypair,
+ $serverPublicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($serverPublicKey, 'string', 2);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1848,8 +2161,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array{0: string, 1: string}
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_kx_server_session_keys($keypair, $clientPublicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_kx_server_session_keys(
+ #[\SensitiveParameter]
+ $keypair,
+ $clientPublicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($clientPublicKey, 'string', 2);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1889,8 +2205,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_kx_secretkey($kp)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_kx_secretkey(
+ #[\SensitiveParameter]
+ $kp
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Core_Util::substr(
</span><span class="cx" style="display: block; padding: 0 10px"> $kp,
</span><span class="cx" style="display: block; padding: 0 10px"> 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1924,8 +2242,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg = null)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_pwhash(
+ $outlen,
+ #[\SensitiveParameter]
+ $passwd,
+ $salt,
+ $opslimit,
+ $memlimit,
+ $alg = null
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1976,8 +2301,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_pwhash_str($passwd, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_pwhash_str(
+ #[\SensitiveParameter]
+ $passwd,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2003,8 +2332,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_pwhash_str_needs_rehash(
+ #[\SensitiveParameter]
+ $hash,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2032,8 +2365,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_pwhash_str_verify($passwd, $hash)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_pwhash_str_verify(
+ #[\SensitiveParameter]
+ $passwd,
+ #[\SensitiveParameter]
+ $hash
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2059,8 +2396,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_pwhash_scryptsalsa208sha256(
+ $outlen,
+ #[\SensitiveParameter]
+ $passwd,
+ $salt,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2119,8 +2462,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_pwhash_scryptsalsa208sha256_str(
+ #[\SensitiveParameter]
+ $passwd,
+ $opslimit,
+ $memlimit
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2153,8 +2500,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_pwhash_scryptsalsa208sha256_str_verify(
+ #[\SensitiveParameter]
+ $passwd,
+ #[\SensitiveParameter]
+ $hash
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2190,8 +2541,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_scalarmult($secretKey, $publicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_scalarmult(
+ #[\SensitiveParameter]
+ $secretKey,
+ $publicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2234,8 +2588,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress TooFewArguments
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_scalarmult_base($secretKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_scalarmult_base(
+ #[\SensitiveParameter]
+ $secretKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2272,8 +2628,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_secretbox($plaintext, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_secretbox(
+ #[\SensitiveParameter]
+ $plaintext,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2312,8 +2673,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedInferredReturnType
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedReturnStatement
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_secretbox_open($ciphertext, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_secretbox_open(
+ $ciphertext,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2398,8 +2763,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_secretbox_xchacha20poly1305_open(
+ $ciphertext,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2425,8 +2794,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_secretstream_xchacha20poly1305_init_push($key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_secretstream_xchacha20poly1305_init_push(
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (PHP_INT_SIZE === 4) {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_push($key);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2439,8 +2810,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Returns a state.
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_secretstream_xchacha20poly1305_init_pull($header, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_secretstream_xchacha20poly1305_init_pull(
+ $header,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (ParagonIE_Sodium_Core_Util::strlen($header) < self::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new SodiumException(
</span><span class="cx" style="display: block; padding: 0 10px"> 'header size should be SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES bytes'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2460,8 +2834,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_secretstream_xchacha20poly1305_push(
+ #[\SensitiveParameter]
+ &$state,
+ #[\SensitiveParameter]
+ $msg,
+ $aad = '',
+ $tag = 0
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (PHP_INT_SIZE === 4) {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_push(
</span><span class="cx" style="display: block; padding: 0 10px"> $state,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2485,8 +2865,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool|array{0: string, 1: int}
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_secretstream_xchacha20poly1305_pull(&$state, $msg, $aad = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_secretstream_xchacha20poly1305_pull(
+ #[\SensitiveParameter]
+ &$state,
+ $msg,
+ $aad = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (PHP_INT_SIZE === 4) {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_pull(
</span><span class="cx" style="display: block; padding: 0 10px"> $state,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2515,8 +2899,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_secretstream_xchacha20poly1305_rekey(&$state)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_secretstream_xchacha20poly1305_rekey(
+ #[\SensitiveParameter]
+ &$state
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (PHP_INT_SIZE === 4) {
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_rekey($state);
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2536,8 +2922,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedInferredReturnType
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedReturnStatement
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_shorthash($message, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_shorthash(
+ $message,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2586,8 +2975,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedInferredReturnType
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedReturnStatement
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign($message, $secretKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign(
+ $message,
+ #[\SensitiveParameter]
+ $secretKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2622,8 +3014,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedInferredReturnType
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedReturnStatement
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign_open($signedMessage, $publicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign_open(
+ $signedMessage,
+ $publicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($signedMessage, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2679,8 +3073,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign_keypair_from_secretkey_and_publickey(
+ #[\SensitiveParameter]
+ $sk,
+ $pk
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($pk, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> $sk = (string) $sk;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2708,8 +3105,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign_seed_keypair($seed)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign_seed_keypair(
+ #[\SensitiveParameter]
+ $seed
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI()) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2737,8 +3136,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign_publickey($keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign_publickey(
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2768,8 +3169,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign_publickey_from_secretkey($secretKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign_publickey_from_secretkey(
+ #[\SensitiveParameter]
+ $secretKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2799,8 +3202,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign_secretkey($keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign_secretkey(
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2833,8 +3238,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign_detached($message, $secretKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign_detached(
+ $message,
+ #[\SensitiveParameter]
+ $secretKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2941,8 +3349,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_sign_ed25519_sk_to_curve25519($sk)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_sign_ed25519_sk_to_curve25519(
+ #[\SensitiveParameter]
+ $sk
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2983,8 +3393,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_stream($len, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_stream(
+ $len,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3030,8 +3444,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_stream_xor($message, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_stream_xor(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3085,8 +3504,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_stream_xchacha20($len, $nonce, $key, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_stream_xchacha20(
+ $len,
+ $nonce,
+ #[\SensitiveParameter]
+ $key,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3130,8 +3554,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_stream_xchacha20_xor($message, $nonce, $key, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_stream_xchacha20_xor(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ #[\SensitiveParameter]
+ $key,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3176,8 +3606,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function crypto_stream_xchacha20_xor_ic($message, $nonce, $counter, $key, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function crypto_stream_xchacha20_xor_ic(
+ #[\SensitiveParameter]
+ $message,
+ $nonce,
+ $counter,
+ #[\SensitiveParameter]
+ $key,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3226,8 +3663,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress TooFewArguments
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function hex2bin($string, $ignore = '')
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function hex2bin(
+ #[\SensitiveParameter]
+ $string,
+ $ignore = ''
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($ignore, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3253,8 +3693,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function increment(&$var)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function increment(
+ #[\SensitiveParameter]
+ &$var
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3287,8 +3729,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function is_zero($str)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function is_zero(
+ #[\SensitiveParameter]
+ $str
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $d = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> for ($i = 0; $i < 32; ++$i) {
</span><span class="cx" style="display: block; padding: 0 10px"> $d |= ParagonIE_Sodium_Core_Util::chrToInt($str[$i]);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3342,8 +3786,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress MixedArgument
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function memcmp($left, $right)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function memcmp(
+ #[\SensitiveParameter]
+ $left,
+ #[\SensitiveParameter]
+ $right
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3371,8 +3819,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress TooFewArguments
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function memzero(&$var)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function memzero(
+ #[\SensitiveParameter]
+ &$var
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3402,8 +3852,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function pad($unpadded, $blockSize, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function pad(
+ #[\SensitiveParameter]
+ $unpadded,
+ $blockSize,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($unpadded, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($blockSize, 'int', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3488,8 +3942,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function unpad($padded, $blockSize, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function unpad(
+ #[\SensitiveParameter]
+ $padded,
+ $blockSize,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($padded, 'string', 1);
</span><span class="cx" style="display: block; padding: 0 10px"> ParagonIE_Sodium_Core_Util::declareScalarType($blockSize, 'int', 2);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3643,8 +4101,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_is_valid_point($p, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_is_valid_point(
+ #[\SensitiveParameter]
+ $p,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_is_valid_point($p);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3667,8 +4128,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_add($p, $q, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_add(
+ #[\SensitiveParameter]
+ $p,
+ #[\SensitiveParameter]
+ $q,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_add($p, $q);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3682,8 +4148,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_sub($p, $q, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_sub(
+ #[\SensitiveParameter]
+ $p,
+ #[\SensitiveParameter]
+ $q,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_sub($p, $q);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3697,8 +4168,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_from_hash($r, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_from_hash(
+ #[\SensitiveParameter]
+ $r,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_from_hash($r);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3739,8 +4213,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_scalar_invert($s, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_scalar_invert(
+ #[\SensitiveParameter]
+ $s,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_scalar_invert($s);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3752,8 +4229,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_scalar_negate($s, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_scalar_negate(
+ #[\SensitiveParameter]
+ $s,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_scalar_negate($s);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3766,8 +4246,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_scalar_complement($s, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_scalar_complement(
+ #[\SensitiveParameter]
+ $s,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_scalar_complement($s);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3781,8 +4264,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_scalar_add($x, $y, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_scalar_add(
+ #[\SensitiveParameter]
+ $x,
+ #[\SensitiveParameter]
+ $y,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_scalar_add($x, $y);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3796,8 +4284,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_scalar_sub($x, $y, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_scalar_sub(
+ #[\SensitiveParameter]
+ $x,
+ #[\SensitiveParameter]
+ $y,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_scalar_sub($x, $y);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3811,8 +4304,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_scalar_mul($x, $y, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_scalar_mul(
+ #[\SensitiveParameter]
+ $x,
+ #[\SensitiveParameter]
+ $y,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_scalar_mul($x, $y);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3826,8 +4324,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function scalarmult_ristretto255($n, $p, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function scalarmult_ristretto255(
+ #[\SensitiveParameter]
+ $n,
+ #[\SensitiveParameter]
+ $p,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_scalarmult_ristretto255($n, $p);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3841,8 +4344,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function scalarmult_ristretto255_base($n, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function scalarmult_ristretto255_base(
+ #[\SensitiveParameter]
+ $n,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_scalarmult_ristretto255_base($n);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3855,8 +4361,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function ristretto255_scalar_reduce($s, $dontFallback = false)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function ristretto255_scalar_reduce(
+ #[\SensitiveParameter]
+ $s,
+ $dontFallback = false
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self::useNewSodiumAPI() && !$dontFallback) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sodium_crypto_core_ristretto255_scalar_reduce($s);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3910,8 +4419,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function sub(&$val, $addv)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function sub(
+ #[\SensitiveParameter]
+ &$val,
+ #[\SensitiveParameter]
+ $addv
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $val_len = ParagonIE_Sodium_Core_Util::strlen($val);
</span><span class="cx" style="display: block; padding: 0 10px"> $addv_len = ParagonIE_Sodium_Core_Util::strlen($addv);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($val_len !== $addv_len) {
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcCoreBase64Commonphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/src/wp-includes/sodium_compat/src/Core/Base64/Common.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/Core/Base64/Common.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/Core/Base64/Common.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,213 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * Class ParagonIE_Sodium_Core_Base64
- *
- * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises.
- * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
- *
- * We have to copy/paste the contents into the variant files because PHP 5.2
- * doesn't support late static binding, and we have no better workaround
- * available that won't break PHP 7+. Therefore, we're forced to duplicate code.
- */
-abstract class ParagonIE_Sodium_Core_Base64_Common
-{
- /**
- * Encode into Base64
- *
- * Base64 character set "[A-Z][a-z][0-9]+/"
- *
- * @param string $src
- * @return string
- * @throws TypeError
- */
- public static function encode($src)
- {
- return self::doEncode($src, true);
- }
-
- /**
- * Encode into Base64, no = padding
- *
- * Base64 character set "[A-Z][a-z][0-9]+/"
- *
- * @param string $src
- * @return string
- * @throws TypeError
- */
- public static function encodeUnpadded($src)
- {
- return self::doEncode($src, false);
- }
-
- /**
- * @param string $src
- * @param bool $pad Include = padding?
- * @return string
- * @throws TypeError
- */
- protected static function doEncode($src, $pad = true)
- {
- $dest = '';
- $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);
- // Main loop (no padding):
- for ($i = 0; $i + 3 <= $srcLen; $i += 3) {
- /** @var array<int, int> $chunk */
- $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3));
- $b0 = $chunk[1];
- $b1 = $chunk[2];
- $b2 = $chunk[3];
-
- $dest .=
- self::encode6Bits( $b0 >> 2 ) .
- self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .
- self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) .
- self::encode6Bits( $b2 & 63);
- }
- // The last chunk, which may have padding:
- if ($i < $srcLen) {
- /** @var array<int, int> $chunk */
- $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i));
- $b0 = $chunk[1];
- if ($i + 1 < $srcLen) {
- $b1 = $chunk[2];
- $dest .=
- self::encode6Bits($b0 >> 2) .
- self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) .
- self::encode6Bits(($b1 << 2) & 63);
- if ($pad) {
- $dest .= '=';
- }
- } else {
- $dest .=
- self::encode6Bits( $b0 >> 2) .
- self::encode6Bits(($b0 << 4) & 63);
- if ($pad) {
- $dest .= '==';
- }
- }
- }
- return $dest;
- }
-
- /**
- * decode from base64 into binary
- *
- * Base64 character set "./[A-Z][a-z][0-9]"
- *
- * @param string $src
- * @param bool $strictPadding
- * @return string
- * @throws RangeException
- * @throws TypeError
- * @psalm-suppress RedundantCondition
- */
- public static function decode($src, $strictPadding = false)
- {
- // Remove padding
- $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);
- if ($srcLen === 0) {
- return '';
- }
-
- if ($strictPadding) {
- if (($srcLen & 3) === 0) {
- if ($src[$srcLen - 1] === '=') {
- $srcLen--;
- if ($src[$srcLen - 1] === '=') {
- $srcLen--;
- }
- }
- }
- if (($srcLen & 3) === 1) {
- throw new RangeException(
- 'Incorrect padding'
- );
- }
- if ($src[$srcLen - 1] === '=') {
- throw new RangeException(
- 'Incorrect padding'
- );
- }
- } else {
- $src = rtrim($src, '=');
- $srcLen = ParagonIE_Sodium_Core_Util::strlen($src);
- }
-
- $err = 0;
- $dest = '';
- // Main loop (no padding):
- for ($i = 0; $i + 4 <= $srcLen; $i += 4) {
- /** @var array<int, int> $chunk */
- $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4));
- $c0 = self::decode6Bits($chunk[1]);
- $c1 = self::decode6Bits($chunk[2]);
- $c2 = self::decode6Bits($chunk[3]);
- $c3 = self::decode6Bits($chunk[4]);
-
- $dest .= pack(
- 'CCC',
- ((($c0 << 2) | ($c1 >> 4)) & 0xff),
- ((($c1 << 4) | ($c2 >> 2)) & 0xff),
- ((($c2 << 6) | $c3 ) & 0xff)
- );
- $err |= ($c0 | $c1 | $c2 | $c3) >> 8;
- }
- // The last chunk, which may have padding:
- if ($i < $srcLen) {
- /** @var array<int, int> $chunk */
- $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i));
- $c0 = self::decode6Bits($chunk[1]);
-
- if ($i + 2 < $srcLen) {
- $c1 = self::decode6Bits($chunk[2]);
- $c2 = self::decode6Bits($chunk[3]);
- $dest .= pack(
- 'CC',
- ((($c0 << 2) | ($c1 >> 4)) & 0xff),
- ((($c1 << 4) | ($c2 >> 2)) & 0xff)
- );
- $err |= ($c0 | $c1 | $c2) >> 8;
- } elseif ($i + 1 < $srcLen) {
- $c1 = self::decode6Bits($chunk[2]);
- $dest .= pack(
- 'C',
- ((($c0 << 2) | ($c1 >> 4)) & 0xff)
- );
- $err |= ($c0 | $c1) >> 8;
- } elseif ($i < $srcLen && $strictPadding) {
- $err |= 1;
- }
- }
- /** @var bool $check */
- $check = ($err === 0);
- if (!$check) {
- throw new RangeException(
- 'Base64::decode() only expects characters in the correct base64 alphabet'
- );
- }
- return $dest;
- }
-
- /**
- * Uses bitwise operators instead of table-lookups to turn 6-bit integers
- * into 8-bit integers.
- *
- * Base64 character set:
- * [A-Z] [a-z] [0-9] + /
- * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f
- *
- * @param int $src
- * @return int
- */
- abstract protected static function decode6Bits($src);
-
- /**
- * Uses bitwise operators instead of table-lookups to turn 8-bit integers
- * into 6-bit integers.
- *
- * @param int $src
- * @return string
- */
- abstract protected static function encode6Bits($src);
-}
</del></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcCoreCurve25519GeCachedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/Cached.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/Cached.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/Cached.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,26 +40,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $T2d
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ParagonIE_Sodium_Core_Curve25519_Fe $YplusX = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $YminusX = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $Z = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $T2d = null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $YplusX = null,
+ $YminusX = null,
+ $Z = null,
+ $T2d = null
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($YplusX === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $YplusX = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($YplusX instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 1 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->YplusX = $YplusX;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($YminusX === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $YminusX = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($YminusX instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 2 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->YminusX = $YminusX;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($Z === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $Z = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($Z instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 3 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->Z = $Z;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($T2d === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $T2d = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($T2d instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 4 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->T2d = $T2d;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcCoreCurve25519GeP1p1php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P1p1.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P1p1.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P1p1.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,26 +39,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $t
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ParagonIE_Sodium_Core_Curve25519_Fe $x = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $y = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $z = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $t = null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $x = null,
+ $y = null,
+ $z = null,
+ $t = null
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($x === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $x = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($x instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 1 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->X = $x;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($y === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $y = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($y instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 2 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->Y = $y;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($z === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $z = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($z instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 3 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->Z = $z;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($t === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $t = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($t instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 4 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->T = $t;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcCoreCurve25519GeP2php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P2.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P2.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P2.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,21 +34,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $z
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ParagonIE_Sodium_Core_Curve25519_Fe $x = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $y = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $z = null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $x = null,
+ $y = null,
+ $z = null
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($x === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $x = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($x instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 1 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->X = $x;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($y === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $y = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($y instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 2 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->Y = $y;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($z === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $z = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($z instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 3 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->Z = $z;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcCoreCurve25519GeP3php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P3.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P3.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/P3.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,26 +40,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param ParagonIE_Sodium_Core_Curve25519_Fe|null $t
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ParagonIE_Sodium_Core_Curve25519_Fe $x = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $y = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $z = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $t = null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $x = null,
+ $y = null,
+ $z = null,
+ $t = null
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($x === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $x = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($x instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 1 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->X = $x;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($y === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $y = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($y instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 2 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->Y = $y;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($z === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $z = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($z instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 3 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->Z = $z;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($t === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $t = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($t instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 4 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->T = $t;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcCoreCurve25519GePrecompphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/Precomp.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/Precomp.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Ge/Precomp.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,21 +34,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param ParagonIE_Sodium_Core_Curve25519_Fe $xy2d
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ParagonIE_Sodium_Core_Curve25519_Fe $yplusx = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $yminusx = null,
- ParagonIE_Sodium_Core_Curve25519_Fe $xy2d = null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $yplusx = null,
+ $yminusx = null,
+ $xy2d = null
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($yplusx === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $yplusx = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($yplusx instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 1 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->yplusx = $yplusx;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($yminusx === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $yminusx = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($yminusx instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 2 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->yminusx = $yminusx;
</span><span class="cx" style="display: block; padding: 0 10px"> if ($xy2d === null) {
</span><span class="cx" style="display: block; padding: 0 10px"> $xy2d = new ParagonIE_Sodium_Core_Curve25519_Fe();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!($xy2d instanceof ParagonIE_Sodium_Core_Curve25519_Fe)) {
+ throw new TypeError('Argument 3 must be an instance of ParagonIE_Sodium_Core_Curve25519_Fe');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->xy2d = $xy2d;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcCoreUtilphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/src/Core/Util.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/Core/Util.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/Core/Util.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,6 +9,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> abstract class ParagonIE_Sodium_Core_Util
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const U32_MAX = 0xFFFFFFFF;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $integer
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $size (16, 32, 64)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,6 +36,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $a
+ * @param string $b
+ * @return string
+ * @throws SodiumException
+ */
+ public static function andStrings($a, $b)
+ {
+ /* Type checks: */
+ if (!is_string($a)) {
+ throw new TypeError('Argument 1 must be a string');
+ }
+ if (!is_string($b)) {
+ throw new TypeError('Argument 2 must be a string');
+ }
+ $len = self::strlen($a);
+ if (self::strlen($b) !== $len) {
+ throw new SodiumException('Both strings must be of equal length to combine with bitwise AND');
+ }
+ return $a & $b;
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Convert a binary string into a hexadecimal string without cache-timing
</span><span class="cx" style="display: block; padding: 0 10px"> * leaks
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunksrcwpincludessodium_compatsrcFilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/sodium_compat/src/File.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/src/File.php 2024-07-18 11:58:22 UTC (rev 58751)
+++ trunk/src/wp-includes/sodium_compat/src/File.php 2024-07-18 12:58:40 UTC (rev 58752)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,8 +25,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function box($inputFile, $outputFile, $nonce, $keyPair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function box(
+ $inputFile,
+ $outputFile,
+ $nonce,
+ #[\SensitiveParameter]
+ $keyPair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($inputFile)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,8 +96,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function box_open($inputFile, $outputFile, $nonce, $keypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function box_open(
+ $inputFile,
+ $outputFile,
+ $nonce,
+ #[\SensitiveParameter]
+ $keypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($inputFile)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,8 +171,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function box_seal($inputFile, $outputFile, $publicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function box_seal(
+ $inputFile,
+ $outputFile,
+ #[\SensitiveParameter]
+ $publicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($inputFile)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,8 +279,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function box_seal_open($inputFile, $outputFile, $ecdhKeypair)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function box_seal_open(
+ $inputFile,
+ $outputFile,
+ #[\SensitiveParameter]
+ $ecdhKeypair
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($inputFile)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -350,8 +368,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @psalm-suppress FailedTypeResolution
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function generichash($filePath, $key = '', $outputLength = 32)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function generichash(
+ $filePath,
+ #[\SensitiveParameter]
+ $key = '',
+ $outputLength = 32
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($filePath)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($filePath) . ' given.');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -428,8 +450,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function secretbox($inputFile, $outputFile, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function secretbox(
+ $inputFile,
+ $outputFile,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($inputFile)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given..');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -493,8 +520,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function secretbox_open($inputFile, $outputFile, $nonce, $key)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function secretbox_open(
+ $inputFile,
+ $outputFile,
+ $nonce,
+ #[\SensitiveParameter]
+ $key
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($inputFile)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -560,8 +592,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws SodiumException
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function sign($filePath, $secretKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function sign(
+ $filePath,
+ #[\SensitiveParameter]
+ $secretKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($filePath)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($filePath) . ' given.');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -656,8 +691,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws TypeError
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws Exception
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function verify($sig, $filePath, $publicKey)
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function verify(
+ $sig,
+ $filePath,
+ $publicKey
+ ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($sig)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($sig) . ' given.');
</span></span></pre>
</div>
</div>
</body>
</html>