<!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>[54310] trunk/src/wp-includes/sodium_compat: Upgrade/Install: Update sodium_compat to v1.19.0.</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/54310">54310</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/54310","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>2022-09-26 13:58:53 +0000 (Mon, 26 Sep 2022)</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.19.0.
The latest version of sodium_compat includes improved compatibility with the PHP 8.0 named parameters functionality.
Release notes:
https://github.com/paragonie/sodium_compat/releases/tag/v1.19.0
A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.18.0...v1.19.0
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>.
Props jrf, paragoninitiativeenterprises.
Fixes <a href="https://core.trac.wordpress.org/ticket/56653">#56653</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludessodium_compatLICENSE">trunk/src/wp-includes/sodium_compat/LICENSE</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_compatsrcCompatphp">trunk/src/wp-includes/sodium_compat/src/Compat.php</a></li>
<li><a href="#trunksrcwpincludessodium_compatsrcCoreUtilphp">trunk/src/wp-includes/sodium_compat/src/Core/Util.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludessodium_compatLICENSE"></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/LICENSE</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/sodium_compat/LICENSE 2022-09-26 13:05:30 UTC (rev 54309)
+++ trunk/src/wp-includes/sodium_compat/LICENSE 2022-09-26 13:58:53 UTC (rev 54310)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ISC License
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-Copyright (c) 2016-2021, Paragon Initiative Enterprises <security at paragonie dot com>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+Copyright (c) 2016-2022, Paragon Initiative Enterprises <security at paragonie dot com>
</ins><span class="cx" style="display: block; padding: 0 10px"> Copyright (c) 2013-2019, Frank Denis <j at pureftpd dot org>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> Permission to use, copy, modify, and/or distribute this software for any
</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 2022-09-26 13:05:30 UTC (rev 54309)
+++ trunk/src/wp-includes/sodium_compat/lib/php72compat.php 2022-09-26 13:58:53 UTC (rev 54310)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,14 +110,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_add')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::add()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $val
- * @param string $addv
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $string1
+ * @param string $string2
</ins><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(&$val, $addv)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_add(&$string1, $string2)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ParagonIE_Sodium_Compat::add($val, $addv);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ParagonIE_Sodium_Compat::add($string1, $string2);
</ins><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"> if (!is_callable('sodium_base642bin')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,33 +165,41 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_compare')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::compare()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $a
- * @param string $b
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $string1
+ * @param string $string2
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int
</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($a, $b)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_compare($string1, $string2)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::compare($a, $b);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::compare($string1, $string2);
</ins><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"> if (!is_callable('sodium_crypto_aead_aes256gcm_decrypt')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $message
- * @param string $assocData
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ciphertext
+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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($message, $assocData, $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, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt(
+ $ciphertext,
+ $additional_data,
+ $nonce,
+ $key
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Exception $ex) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (($ex instanceof SodiumException) && ($ex->getMessage() === 'AES-256-GCM is not available')) {
+ throw $ex;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">@@ -200,7 +208,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $assocData
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,9 +215,9 @@
</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, $assocData, $nonce, $key)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_aes256gcm_encrypt($message, $additional_data, $nonce, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $additional_data, $nonce, $key);
</ins><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"> if (!is_callable('sodium_crypto_aead_aes256gcm_is_available')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,16 +233,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_aead_chacha20poly1305_decrypt')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $message
- * @param string $assocData
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ciphertext
+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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($message, $assocData, $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, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt(
+ $ciphertext,
+ $additional_data,
+ $nonce,
+ $key
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Exception $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -246,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $assocData
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,9 +266,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, $assocData, $nonce, $key)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_chacha20poly1305_encrypt($message, $additional_data, $nonce, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt(
+ $message,
+ $additional_data,
+ $nonce,
+ $key
+ );
</ins><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"> if (!is_callable('sodium_crypto_aead_chacha20poly1305_keygen')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,15 +291,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $assocData
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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, $assocData, $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, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt(
+ $message,
+ $additional_data,
+ $nonce,
+ $key
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Exception $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -293,7 +316,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $assocData
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,9 +323,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, $assocData, $nonce, $key)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_chacha20poly1305_ietf_encrypt($message, $additional_data, $nonce, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt(
+ $message,
+ $additional_data,
+ $nonce,
+ $key
+ );
</ins><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"> if (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_keygen')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,16 +347,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $message
- * @param string $assocData
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ciphertext
+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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($message, $assocData, $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, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt(
+ $ciphertext,
+ $additional_data,
+ $nonce,
+ $key,
+ true
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Exception $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,7 +374,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $assocData
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -347,9 +381,19 @@
</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_xchacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key)
- {
- return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(
+ $message,
+ $additional_data,
+ $nonce,
+ $key
+ ) {
+ return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt(
+ $message,
+ $additional_data,
+ $nonce,
+ $key,
+ true
+ );
</ins><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"> if (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_keygen')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,14 +452,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_box()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $kp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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"> * @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, $kp)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box($message, $nonce, $key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $kp);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $key_pair);
</ins><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"> if (!is_callable('sodium_crypto_box_keypair')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -433,29 +477,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_box_keypair_from_secretkey_and_publickey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sk
- * @param string $pk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $secret_key
+ * @param string $public_key
</ins><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"> * @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($sk, $pk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_keypair_from_secretkey_and_publickey($secret_key, $public_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($sk, $pk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($secret_key, $public_key);
</ins><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"> if (!is_callable('sodium_crypto_box_open')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_box_open()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $message
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ciphertext
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $kp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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($message, $nonce, $kp)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_open($ciphertext, $nonce, $key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_box_open($ciphertext, $nonce, $key_pair);
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Exception $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -466,27 +510,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_box_publickey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_box_publickey()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $keypair
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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"> * @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($keypair)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_publickey($key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_box_publickey($keypair);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_box_publickey($key_pair);
</ins><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"> if (!is_callable('sodium_crypto_box_publickey_from_secretkey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $secret_key
</ins><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"> * @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($sk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_publickey_from_secretkey($secret_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($sk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($secret_key);
</ins><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"> if (!is_callable('sodium_crypto_box_seal')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -493,14 +537,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_box_seal()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $publicKey
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $public_key
</ins><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"> * @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, $publicKey)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_seal($message, $public_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_box_seal($message, $publicKey);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_box_seal($message, $public_key);
</ins><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"> if (!is_callable('sodium_crypto_box_seal_open')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -507,14 +551,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_box_seal_open()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $kp
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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, $kp)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_seal_open($message, $key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $key_pair);
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (SodiumException $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($ex->getMessage() === 'Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.') {
</span><span class="cx" style="display: block; padding: 0 10px"> throw $ex;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -526,14 +570,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_box_secretkey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_box_secretkey()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $keypair
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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"> * @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($keypair)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_box_secretkey($key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_box_secretkey($key_pair);
</ins><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"> if (!is_callable('sodium_crypto_box_seed_keypair')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -554,28 +598,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_generichash()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $key
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $outLen
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $length
</ins><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"> * @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, $outLen = 32)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_generichash($message, $key = null, $length = 32)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $length);
</ins><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"> if (!is_callable('sodium_crypto_generichash_final')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_generichash_final()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|null $ctx
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $state
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $outputLength
</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"> * @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_final(&$ctx, $outputLength = 32)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_generichash_final(&$state, $outputLength = 32)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_generichash_final($state, $outputLength);
</ins><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"> if (!is_callable('sodium_crypto_generichash_init')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -582,14 +626,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_generichash_init()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $key
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $outLen
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $length
</ins><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"> * @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, $outLen = 32)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_generichash_init($key = null, $length = 32)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $length);
</ins><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"> if (!is_callable('sodium_crypto_generichash_keygen')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -606,15 +650,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_generichash_update')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_generichash_update()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|null $ctx
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|null $state
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</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"> * @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(&$ctx, $message = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_generichash_update(&$state, $message = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ParagonIE_Sodium_Compat::crypto_generichash_update($state, $message);
</ins><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"> if (!is_callable('sodium_crypto_kdf_keygen')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -631,7 +675,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_kdf_derive_from_key')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $subkey_len
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $subkey_length
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $subkey_id
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $context
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $key
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -638,10 +682,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_kdf_derive_from_key($subkey_len, $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, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $subkey_len,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $subkey_length,
</ins><span class="cx" style="display: block; padding: 0 10px"> $subkey_id,
</span><span class="cx" style="display: block; padding: 0 10px"> $context,
</span><span class="cx" style="display: block; padding: 0 10px"> $key
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -692,54 +736,54 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_kx_client_session_keys')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $keypair
- * @param string $serverPublicKey
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $client_key_pair
+ * @param string $server_key
</ins><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($keypair, $serverPublicKey)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_client_session_keys($client_key_pair, $server_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($keypair, $serverPublicKey);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($client_key_pair, $server_key);
</ins><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"> if (!is_callable('sodium_crypto_kx_server_session_keys')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $keypair
- * @param string $clientPublicKey
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $server_key_pair
+ * @param string $client_key
</ins><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($keypair, $clientPublicKey)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_server_session_keys($server_key_pair, $client_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($keypair, $clientPublicKey);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($server_key_pair, $client_key);
</ins><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"> if (!is_callable('sodium_crypto_kx_secretkey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $keypair
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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($keypair)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_secretkey($key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_kx_secretkey($keypair);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_kx_secretkey($key_pair);
</ins><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"> if (!is_callable('sodium_crypto_kx_publickey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $keypair
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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($keypair)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_kx_publickey($key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_kx_publickey($keypair);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_kx_publickey($key_pair);
</ins><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"> if (!is_callable('sodium_crypto_pwhash')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_pwhash()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $outlen
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $length
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $passwd
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $salt
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $opslimit
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -749,9 +793,9 @@
</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($outlen, $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, $passwd, $salt, $opslimit, $memlimit, $algo = null)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo);
</ins><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"> if (!is_callable('sodium_crypto_pwhash_str')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -801,7 +845,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $outlen
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $length
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $passwd
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $salt
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $opslimit
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -810,9 +854,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_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_pwhash_scryptsalsa208sha256($length, $passwd, $salt, $opslimit, $memlimit)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256(
+ $length,
+ $passwd,
+ $salt,
+ $opslimit,
+ $memlimit
+ );
</ins><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"> if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -900,15 +950,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_secretbox_open')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_secretbox_open()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $message
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ciphertext
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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($message, $nonce, $key)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretbox_open($ciphertext, $nonce, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_secretbox_open($ciphertext, $nonce, $key);
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Exception $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -930,15 +980,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_push')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $state
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $msg
- * @param string $aad
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $message
+ * @param string $additional_data
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $tag
</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_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0)
- {
- return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_push($state, $msg, $aad, $tag);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretstream_xchacha20poly1305_push(
+ &$state,
+ $message,
+ $additional_data = '',
+ $tag = 0
+ ) {
+ return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_push(
+ $state,
+ $message,
+ $additional_data,
+ $tag
+ );
</ins><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"> if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_pull')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -956,14 +1015,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_pull')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $state
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $cipher
- * @param string $aad
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ciphertext
+ * @param string $additional_data
</ins><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, $cipher, $aad = '')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_secretstream_xchacha20poly1305_pull(&$state, $ciphertext, $additional_data = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull($state, $cipher, $aad);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull(
+ $state,
+ $ciphertext,
+ $additional_data
+ );
</ins><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"> if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_rekey')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1016,14 +1079,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $secret_key
</ins><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"> * @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, $sk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign($message, $secret_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign($message, $sk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign($message, $secret_key);
</ins><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"> if (!is_callable('sodium_crypto_sign_detached')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1030,28 +1093,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_detached()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $secret_key
</ins><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"> * @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, $sk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_detached($message, $secret_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $secret_key);
</ins><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"> if (!is_callable('sodium_crypto_sign_keypair_from_secretkey_and_publickey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sk
- * @param string $pk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $secret_key
+ * @param string $public_key
</ins><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"> * @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($sk, $pk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_keypair_from_secretkey_and_publickey($secret_key, $public_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($secret_key, $public_key);
</ins><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"> if (!is_callable('sodium_crypto_sign_keypair')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1070,13 +1133,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_open()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $signedMessage
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $pk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $public_key
</ins><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_sign_open($signedMessage, $pk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_open($signedMessage, $public_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $public_key);
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (Error $ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } catch (Exception $ex) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1087,40 +1150,40 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_crypto_sign_publickey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_publickey()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $keypair
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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"> * @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($keypair)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_publickey($key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_publickey($key_pair);
</ins><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"> if (!is_callable('sodium_crypto_sign_publickey_from_secretkey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $secret_key
</ins><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"> * @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($sk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_publickey_from_secretkey($secret_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($secret_key);
</ins><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"> if (!is_callable('sodium_crypto_sign_secretkey')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_secretkey()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $keypair
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $key_pair
</ins><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"> * @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($keypair)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_secretkey($key_pair)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_secretkey($key_pair);
</ins><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"> if (!is_callable('sodium_crypto_sign_seed_keypair')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1141,46 +1204,46 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_verify_detached()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $signature
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $message
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $pk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $public_key
</ins><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"> * @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_verify_detached($signature, $message, $pk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_verify_detached($signature, $message, $public_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $pk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $public_key);
</ins><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"> if (!is_callable('sodium_crypto_sign_ed25519_pk_to_curve25519')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $pk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $public_key
</ins><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"> * @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_pk_to_curve25519($pk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_ed25519_pk_to_curve25519($public_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($pk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($public_key);
</ins><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"> if (!is_callable('sodium_crypto_sign_ed25519_sk_to_curve25519')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $secret_key
</ins><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"> * @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($sk)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_sign_ed25519_sk_to_curve25519($secret_key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($secret_key);
</ins><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"> if (!is_callable('sodium_crypto_stream')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::crypto_stream()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $len
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $length
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $nonce
</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
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1187,9 +1250,9 @@
</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($len, $nonce, $key)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_stream($length, $nonce, $key)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::crypto_stream($length, $nonce, $key);
</ins><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"> if (!is_callable('sodium_crypto_stream_keygen')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1223,13 +1286,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::hex2bin()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $string
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ignore
</ins><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"> * @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)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_hex2bin($string, $ignore = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::hex2bin($string);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::hex2bin($string, $ignore);
</ins><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"> if (!is_callable('sodium_increment')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1278,28 +1342,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_callable('sodium_memcmp')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::memcmp()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $a
- * @param string $b
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $string1
+ * @param string $string2
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int
</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($a, $b)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_memcmp($string1, $string2)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::memcmp($a, $b);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::memcmp($string1, $string2);
</ins><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"> if (!is_callable('sodium_memzero')) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::memzero()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $str
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $string
</ins><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"> * @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_memzero(&$str)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_memzero(&$string)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ParagonIE_Sodium_Compat::memzero($str);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ParagonIE_Sodium_Compat::memzero($string);
</ins><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"> if (!is_callable('sodium_pad')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1306,14 +1370,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::pad()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $unpadded
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $blockSize
- * @return int
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $block_size
+ * @return string
</ins><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, $blockSize)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_pad($unpadded, $block_size)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::pad($unpadded, $blockSize, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::pad($unpadded, $block_size, true);
</ins><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"> if (!is_callable('sodium_unpad')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1320,14 +1384,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::pad()
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $padded
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $blockSize
- * @return int
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $block_size
+ * @return string
</ins><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, $blockSize)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_unpad($padded, $block_size)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::unpad($padded, $blockSize, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::unpad($padded, $block_size, true);
</ins><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"> if (!is_callable('sodium_randombytes_buf')) {
</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 2022-09-26 13:05:30 UTC (rev 54309)
+++ trunk/src/wp-includes/sodium_compat/lib/ristretto255.php 2022-09-26 13:58:53 UTC (rev 54310)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,13 +56,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::ristretto255_from_hash()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $r
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $s
</ins><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($r)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_from_hash($s)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::ristretto255_from_hash($r, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::ristretto255_from_hash($s, true);
</ins><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"> if (!is_callable('sodium_crypto_core_ristretto255_is_valid_point')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,13 +69,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::ristretto255_is_valid_point()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $p
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $s
</ins><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($p)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_is_valid_point($s)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::ristretto255_is_valid_point($p, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::ristretto255_is_valid_point($s, true);
</ins><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"> if (!is_callable('sodium_crypto_core_ristretto255_random')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,14 +94,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::ristretto255_scalar_add()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $p
- * @param string $q
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $x
+ * @param string $y
</ins><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($p, $q)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_add($x, $y)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::ristretto255_scalar_add($p, $q, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::ristretto255_scalar_add($x, $y, true);
</ins><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"> if (!is_callable('sodium_crypto_core_ristretto255_scalar_complement')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,13 +108,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::ristretto255_scalar_complement()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $p
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $s
</ins><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($p)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_complement($s)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::ristretto255_scalar_complement($p, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::ristretto255_scalar_complement($s, true);
</ins><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"> if (!is_callable('sodium_crypto_core_ristretto255_scalar_invert')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,14 +134,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::ristretto255_scalar_mul()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $p
- * @param string $q
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $x
+ * @param string $y
</ins><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($p, $q)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_mul($x, $y)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::ristretto255_scalar_mul($p, $q, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::ristretto255_scalar_mul($x, $y, true);
</ins><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"> if (!is_callable('sodium_crypto_core_ristretto255_scalar_negate')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,13 +148,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::ristretto255_scalar_negate()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $p
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $s
</ins><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($p)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_negate($s)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::ristretto255_scalar_negate($p, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::ristretto255_scalar_negate($s, true);
</ins><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"> if (!is_callable('sodium_crypto_core_ristretto255_scalar_random')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,13 +173,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::ristretto255_scalar_reduce()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $p
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $s
</ins><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($p)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_reduce($s)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::ristretto255_scalar_reduce($p, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::ristretto255_scalar_reduce($s, true);
</ins><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"> if (!is_callable('sodium_crypto_core_ristretto255_scalar_sub')) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,14 +186,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @see ParagonIE_Sodium_Compat::ristretto255_scalar_sub()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $p
- * @param string $q
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $x
+ * @param string $y
</ins><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($p, $q)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sodium_crypto_core_ristretto255_scalar_sub($x, $y)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Compat::ristretto255_scalar_sub($p, $q, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Compat::ristretto255_scalar_sub($x, $y, true);
</ins><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"> if (!is_callable('sodium_crypto_core_ristretto255_sub')) {
</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 2022-09-26 13:05:30 UTC (rev 54309)
+++ trunk/src/wp-includes/sodium_compat/lib/sodium_compat.php 2022-09-26 13:58:53 UTC (rev 54310)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -778,6 +778,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"> * @throws \TypeError
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @psalm-suppress MissingParamType
+ * @psalm-suppress MissingReturnType
+ * @psalm-suppress ReferenceConstraintViolation
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function memzero(&$str)
</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 2022-09-26 13:05:30 UTC (rev 54309)
+++ trunk/src/wp-includes/sodium_compat/src/Compat.php 2022-09-26 13:58:53 UTC (rev 54310)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3219,6 +3219,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Cache-timing-safe implementation of hex2bin().
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $string Hexadecimal string
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ignore List of characters to ignore; useful for whitespace
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string Raw binary string
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -3225,20 +3226,21 @@
</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)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function hex2bin($string, $ignore = '')
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ParagonIE_Sodium_Core_Util::declareScalarType($ignore, 'string', 2);
</ins><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="cx" style="display: block; padding: 0 10px"> if (is_callable('sodium_hex2bin')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return (string) sodium_hex2bin($string);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (string) sodium_hex2bin($string, $ignore);
</ins><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"> if (self::use_fallback('hex2bin')) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return (string) call_user_func('\\Sodium\\hex2bin', $string);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (string) call_user_func('\\Sodium\\hex2bin', $string, $ignore);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ParagonIE_Sodium_Core_Util::hex2bin($string);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ParagonIE_Sodium_Core_Util::hex2bin($string, $ignore);
</ins><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></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 2022-09-26 13:05:30 UTC (rev 54309)
+++ trunk/src/wp-includes/sodium_compat/src/Core/Util.php 2022-09-26 13:58:53 UTC (rev 54310)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,27 +309,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @internal You should not use this directly from another application
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $hexString
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $ignore
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $strictPadding
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string (raw binary)
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws RangeException
</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 hex2bin($hexString, $strictPadding = false)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function hex2bin($hexString, $ignore = '', $strictPadding = false)
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> /* Type checks: */
</span><span class="cx" style="display: block; padding: 0 10px"> if (!is_string($hexString)) {
</span><span class="cx" style="display: block; padding: 0 10px"> throw new TypeError('Argument 1 must be a string, ' . gettype($hexString) . ' given.');
</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 (!is_string($ignore)) {
+ throw new TypeError('Argument 2 must be a string, ' . gettype($hexString) . ' given.');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $hex_pos */
</del><span class="cx" style="display: block; padding: 0 10px"> $hex_pos = 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var string $bin */
</del><span class="cx" style="display: block; padding: 0 10px"> $bin = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $c_acc */
</del><span class="cx" style="display: block; padding: 0 10px"> $c_acc = 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $hex_len */
</del><span class="cx" style="display: block; padding: 0 10px"> $hex_len = self::strlen($hexString);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $state */
</del><span class="cx" style="display: block; padding: 0 10px"> $state = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> if (($hex_len & 1) !== 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($strictPadding) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -347,20 +346,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ++$hex_pos;
</span><span class="cx" style="display: block; padding: 0 10px"> /** @var int $c */
</span><span class="cx" style="display: block; padding: 0 10px"> $c = $chunk[$hex_pos];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $c_num */
</del><span class="cx" style="display: block; padding: 0 10px"> $c_num = $c ^ 48;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $c_num0 */
</del><span class="cx" style="display: block; padding: 0 10px"> $c_num0 = ($c_num - 10) >> 8;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $c_alpha */
</del><span class="cx" style="display: block; padding: 0 10px"> $c_alpha = ($c & ~32) - 55;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $c_alpha0 */
</del><span class="cx" style="display: block; padding: 0 10px"> $c_alpha0 = (($c_alpha - 10) ^ ($c_alpha - 16)) >> 8;
</span><span class="cx" style="display: block; padding: 0 10px"> if (($c_num0 | $c_alpha0) === 0) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($ignore && $state === 0 && strpos($ignore, self::intToChr($c)) !== false) {
+ continue;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> throw new RangeException(
</span><span class="cx" style="display: block; padding: 0 10px"> 'hex2bin() only expects hexadecimal characters'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var int $c_val */
</del><span class="cx" style="display: block; padding: 0 10px"> $c_val = ($c_num0 & $c_num) | ($c_alpha & $c_alpha0);
</span><span class="cx" style="display: block; padding: 0 10px"> if ($state === 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> $c_acc = $c_val * 16;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -382,7 +379,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function intArrayToString(array $ints)
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /** @var array<int, int> $args */
</del><span class="cx" style="display: block; padding: 0 10px"> $args = $ints;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ($args as $i => $v) {
</span><span class="cx" style="display: block; padding: 0 10px"> $args[$i] = (int) ($v & 0xff);
</span></span></pre>
</div>
</div>
</body>
</html>