wp/wp-includes/sodium_compat/lib/php72compat.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
--- a/wp/wp-includes/sodium_compat/lib/php72compat.php	Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-includes/sodium_compat/lib/php72compat.php	Fri Sep 05 18:52:52 2025 +0200
@@ -14,14 +14,14 @@
     'BASE64_VARIANT_ORIGINAL_NO_PADDING',
     'BASE64_VARIANT_URLSAFE',
     'BASE64_VARIANT_URLSAFE_NO_PADDING',
+    'CRYPTO_AEAD_AES256GCM_KEYBYTES',
+    'CRYPTO_AEAD_AES256GCM_NSECBYTES',
+    'CRYPTO_AEAD_AES256GCM_NPUBBYTES',
+    'CRYPTO_AEAD_AES256GCM_ABYTES',
     'CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES',
     'CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES',
     'CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES',
     'CRYPTO_AEAD_CHACHA20POLY1305_ABYTES',
-    'CRYPTO_AEAD_AES256GCM_KEYBYTES',
-    'CRYPTO_AEAD_AES256GCM_NSECBYTES',
-    'CRYPTO_AEAD_AES256GCM_NPUBBYTES',
-    'CRYPTO_AEAD_AES256GCM_ABYTES',
     'CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES',
     'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES',
     'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES',
@@ -115,8 +115,12 @@
      * @return void
      * @throws SodiumException
      */
-    function sodium_add(&$string1, $string2)
-    {
+    function sodium_add(
+        #[\SensitiveParameter]
+        &$string1,
+        #[\SensitiveParameter]
+        $string2
+    ) {
         ParagonIE_Sodium_Compat::add($string1, $string2);
     }
 }
@@ -130,8 +134,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_base642bin($string, $variant, $ignore ='')
-    {
+    function sodium_base642bin(
+        #[\SensitiveParameter]
+        $string,
+        $variant,
+        $ignore =''
+    ) {
         return ParagonIE_Sodium_Compat::base642bin($string, $variant, $ignore);
     }
 }
@@ -144,8 +152,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_bin2base64($string, $variant)
-    {
+    function sodium_bin2base64(
+        #[\SensitiveParameter]
+        $string,
+        $variant
+    ) {
         return ParagonIE_Sodium_Compat::bin2base64($string, $variant);
     }
 }
@@ -157,8 +168,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_bin2hex($string)
-    {
+    function sodium_bin2hex(
+        #[\SensitiveParameter]
+        $string
+    ) {
         return ParagonIE_Sodium_Compat::bin2hex($string);
     }
 }
@@ -171,8 +184,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_compare($string1, $string2)
-    {
+    function sodium_compare(
+        #[\SensitiveParameter]
+        $string1,
+        #[\SensitiveParameter]
+        $string2
+    ) {
         return ParagonIE_Sodium_Compat::compare($string1, $string2);
     }
 }
@@ -185,8 +202,13 @@
      * @param string $key
      * @return string|bool
      */
-    function sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $additional_data, $nonce, $key)
-    {
+    function sodium_crypto_aead_aes256gcm_decrypt(
+        $ciphertext,
+        $additional_data,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         try {
             return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt(
                 $ciphertext,
@@ -215,8 +237,14 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_aead_aes256gcm_encrypt($message, $additional_data, $nonce, $key)
-    {
+    function sodium_crypto_aead_aes256gcm_encrypt(
+        #[\SensitiveParameter]
+        $message,
+        $additional_data,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $additional_data, $nonce, $key);
     }
 }
@@ -239,8 +267,13 @@
      * @param string $key
      * @return string|bool
      */
-    function sodium_crypto_aead_chacha20poly1305_decrypt($ciphertext, $additional_data, $nonce, $key)
-    {
+    function sodium_crypto_aead_chacha20poly1305_decrypt(
+        $ciphertext,
+        $additional_data,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         try {
             return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt(
                 $ciphertext,
@@ -266,8 +299,14 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_aead_chacha20poly1305_encrypt($message, $additional_data, $nonce, $key)
-    {
+    function sodium_crypto_aead_chacha20poly1305_encrypt(
+        #[\SensitiveParameter]
+        $message,
+        $additional_data,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt(
             $message,
             $additional_data,
@@ -296,8 +335,13 @@
      * @param string $key
      * @return string|bool
      */
-    function sodium_crypto_aead_chacha20poly1305_ietf_decrypt($message, $additional_data, $nonce, $key)
-    {
+    function sodium_crypto_aead_chacha20poly1305_ietf_decrypt(
+        $message,
+        $additional_data,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         try {
             return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt(
                 $message,
@@ -323,8 +367,14 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_aead_chacha20poly1305_ietf_encrypt($message, $additional_data, $nonce, $key)
-    {
+    function sodium_crypto_aead_chacha20poly1305_ietf_encrypt(
+        #[\SensitiveParameter]
+        $message,
+        $additional_data,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt(
             $message,
             $additional_data,
@@ -353,8 +403,13 @@
      * @param string $key
      * @return string|bool
      */
-    function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($ciphertext, $additional_data, $nonce, $key)
-    {
+    function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt(
+        $ciphertext,
+        $additional_data,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         try {
             return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt(
                 $ciphertext,
@@ -382,9 +437,11 @@
      * @throws TypeError
      */
     function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(
+        #[\SensitiveParameter]
         $message,
         $additional_data,
         $nonce,
+        #[\SensitiveParameter]
         $key
     ) {
         return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt(
@@ -416,8 +473,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_auth($message, $key)
-    {
+    function sodium_crypto_auth(
+        $message,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_auth($message, $key);
     }
 }
@@ -442,8 +502,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_auth_verify($mac, $message, $key)
-    {
+    function sodium_crypto_auth_verify(
+        $mac,
+        $message,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key);
     }
 }
@@ -457,8 +521,13 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_box($message, $nonce, $key_pair)
-    {
+    function sodium_crypto_box(
+        #[\SensitiveParameter]
+        $message,
+        $nonce,
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $key_pair);
     }
 }
@@ -483,8 +552,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_box_keypair_from_secretkey_and_publickey($secret_key, $public_key)
-    {
+    function sodium_crypto_box_keypair_from_secretkey_and_publickey(
+        #[\SensitiveParameter]
+        $secret_key,
+        $public_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($secret_key, $public_key);
     }
 }
@@ -496,8 +568,12 @@
      * @param string $key_pair
      * @return string|bool
      */
-    function sodium_crypto_box_open($ciphertext, $nonce, $key_pair)
-    {
+    function sodium_crypto_box_open(
+        $ciphertext,
+        $nonce,
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         try {
             return ParagonIE_Sodium_Compat::crypto_box_open($ciphertext, $nonce, $key_pair);
         } catch (Error $ex) {
@@ -515,8 +591,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_box_publickey($key_pair)
-    {
+    function sodium_crypto_box_publickey(
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         return ParagonIE_Sodium_Compat::crypto_box_publickey($key_pair);
     }
 }
@@ -528,8 +606,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_box_publickey_from_secretkey($secret_key)
-    {
+    function sodium_crypto_box_publickey_from_secretkey(
+        #[\SensitiveParameter]
+        $secret_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($secret_key);
     }
 }
@@ -542,8 +622,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_box_seal($message, $public_key)
-    {
+    function sodium_crypto_box_seal(
+        #[\SensitiveParameter]
+        $message,
+        $public_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_box_seal($message, $public_key);
     }
 }
@@ -555,8 +638,11 @@
      * @return string|bool
      * @throws SodiumException
      */
-    function sodium_crypto_box_seal_open($message, $key_pair)
-    {
+    function sodium_crypto_box_seal_open(
+        $message,
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         try {
             return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $key_pair);
         } catch (SodiumException $ex) {
@@ -575,8 +661,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_box_secretkey($key_pair)
-    {
+    function sodium_crypto_box_secretkey(
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         return ParagonIE_Sodium_Compat::crypto_box_secretkey($key_pair);
     }
 }
@@ -588,8 +676,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_box_seed_keypair($seed)
-    {
+    function sodium_crypto_box_seed_keypair(
+        #[\SensitiveParameter]
+        $seed
+    ) {
         return ParagonIE_Sodium_Compat::crypto_box_seed_keypair($seed);
     }
 }
@@ -603,8 +693,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_generichash($message, $key = null, $length = 32)
-    {
+    function sodium_crypto_generichash(
+        $message,
+        #[\SensitiveParameter]
+        $key = null,
+        $length = 32
+    ) {
         return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $length);
     }
 }
@@ -631,8 +725,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_generichash_init($key = null, $length = 32)
-    {
+    function sodium_crypto_generichash_init(
+        #[\SensitiveParameter]
+        $key = null,
+        $length = 32
+    ) {
         return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $length);
     }
 }
@@ -656,8 +753,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_generichash_update(&$state, $message = '')
-    {
+    function sodium_crypto_generichash_update(
+        #[\SensitiveParameter]
+        &$state,
+        $message = ''
+    ) {
         ParagonIE_Sodium_Compat::crypto_generichash_update($state, $message);
     }
 }
@@ -682,8 +782,13 @@
      * @return string
      * @throws Exception
      */
-    function sodium_crypto_kdf_derive_from_key($subkey_length, $subkey_id, $context, $key)
-    {
+    function sodium_crypto_kdf_derive_from_key(
+        $subkey_length,
+        $subkey_id,
+        $context,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key(
             $subkey_length,
             $subkey_id,
@@ -703,8 +808,13 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_kx($my_secret, $their_public, $client_public, $server_public)
-    {
+    function sodium_crypto_kx(
+        #[\SensitiveParameter]
+        $my_secret,
+        $their_public,
+        $client_public,
+        $server_public
+    ) {
         return ParagonIE_Sodium_Compat::crypto_kx(
             $my_secret,
             $their_public,
@@ -719,8 +829,10 @@
      * @return string
      * @throws Exception
      */
-    function sodium_crypto_kx_seed_keypair($seed)
-    {
+    function sodium_crypto_kx_seed_keypair(
+        #[\SensitiveParameter]
+        $seed
+    ) {
         return ParagonIE_Sodium_Compat::crypto_kx_seed_keypair($seed);
     }
 }
@@ -741,8 +853,11 @@
      * @return array{0: string, 1: string}
      * @throws SodiumException
      */
-    function sodium_crypto_kx_client_session_keys($client_key_pair, $server_key)
-    {
+    function sodium_crypto_kx_client_session_keys(
+        #[\SensitiveParameter]
+        $client_key_pair,
+        $server_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($client_key_pair, $server_key);
     }
 }
@@ -753,8 +868,11 @@
      * @return array{0: string, 1: string}
      * @throws SodiumException
      */
-    function sodium_crypto_kx_server_session_keys($server_key_pair, $client_key)
-    {
+    function sodium_crypto_kx_server_session_keys(
+        #[\SensitiveParameter]
+        $server_key_pair,
+        $client_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($server_key_pair, $client_key);
     }
 }
@@ -764,8 +882,10 @@
      * @return string
      * @throws Exception
      */
-    function sodium_crypto_kx_secretkey($key_pair)
-    {
+    function sodium_crypto_kx_secretkey(
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         return ParagonIE_Sodium_Compat::crypto_kx_secretkey($key_pair);
     }
 }
@@ -775,8 +895,10 @@
      * @return string
      * @throws Exception
      */
-    function sodium_crypto_kx_publickey($key_pair)
-    {
+    function sodium_crypto_kx_publickey(
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         return ParagonIE_Sodium_Compat::crypto_kx_publickey($key_pair);
     }
 }
@@ -793,8 +915,15 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo = null)
-    {
+    function sodium_crypto_pwhash(
+        $length,
+        #[\SensitiveParameter]
+        $passwd,
+        $salt,
+        $opslimit,
+        $memlimit,
+        $algo = null
+    ) {
         return ParagonIE_Sodium_Compat::crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo);
     }
 }
@@ -808,8 +937,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit)
-    {
+    function sodium_crypto_pwhash_str(
+        #[\SensitiveParameter]
+        $passwd,
+        $opslimit,
+        $memlimit
+    ) {
         return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit);
     }
 }
@@ -823,8 +956,12 @@
      *
      * @throws SodiumException
      */
-    function sodium_crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit)
-    {
+    function sodium_crypto_pwhash_str_needs_rehash(
+        #[\SensitiveParameter]
+        $hash,
+        $opslimit,
+        $memlimit
+    ) {
         return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit);
     }
 }
@@ -837,8 +974,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_pwhash_str_verify($passwd, $hash)
-    {
+    function sodium_crypto_pwhash_str_verify(
+        #[\SensitiveParameter]
+        $passwd,
+        #[\SensitiveParameter]
+        $hash
+    ) {
         return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash);
     }
 }
@@ -854,8 +995,14 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_pwhash_scryptsalsa208sha256($length, $passwd, $salt, $opslimit, $memlimit)
-    {
+    function sodium_crypto_pwhash_scryptsalsa208sha256(
+        $length,
+        #[\SensitiveParameter]
+        $passwd,
+        $salt,
+        $opslimit,
+        $memlimit
+    ) {
         return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256(
             $length,
             $passwd,
@@ -875,8 +1022,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)
-    {
+    function sodium_crypto_pwhash_scryptsalsa208sha256_str(
+        #[\SensitiveParameter]
+        $passwd,
+        $opslimit,
+        $memlimit
+    ) {
         return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit);
     }
 }
@@ -889,8 +1040,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)
-    {
+    function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify(
+        #[\SensitiveParameter]
+        $passwd,
+        #[\SensitiveParameter]
+        $hash
+    ) {
         return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash);
     }
 }
@@ -903,8 +1058,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_scalarmult($n, $p)
-    {
+    function sodium_crypto_scalarmult(
+        #[\SensitiveParameter]
+        $n,
+        $p
+    ) {
         return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p);
     }
 }
@@ -916,8 +1074,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_scalarmult_base($n)
-    {
+    function sodium_crypto_scalarmult_base(
+        #[\SensitiveParameter]
+        $n
+    ) {
         return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n);
     }
 }
@@ -931,8 +1091,13 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_secretbox($message, $nonce, $key)
-    {
+    function sodium_crypto_secretbox(
+        #[\SensitiveParameter]
+        $message,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key);
     }
 }
@@ -955,8 +1120,12 @@
      * @param string $key
      * @return string|bool
      */
-    function sodium_crypto_secretbox_open($ciphertext, $nonce, $key)
-    {
+    function sodium_crypto_secretbox_open(
+        $ciphertext,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         try {
             return ParagonIE_Sodium_Compat::crypto_secretbox_open($ciphertext, $nonce, $key);
         } catch (Error $ex) {
@@ -972,8 +1141,10 @@
      * @return array<int, string>
      * @throws SodiumException
      */
-    function sodium_crypto_secretstream_xchacha20poly1305_init_push($key)
-    {
+    function sodium_crypto_secretstream_xchacha20poly1305_init_push(
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_push($key);
     }
 }
@@ -987,7 +1158,9 @@
      * @throws SodiumException
      */
     function sodium_crypto_secretstream_xchacha20poly1305_push(
+        #[\SensitiveParameter]
         &$state,
+        #[\SensitiveParameter]
         $message,
         $additional_data = '',
         $tag = 0
@@ -1007,8 +1180,11 @@
      * @return string
      * @throws Exception
      */
-    function sodium_crypto_secretstream_xchacha20poly1305_init_pull($header, $key)
-    {
+    function sodium_crypto_secretstream_xchacha20poly1305_init_pull(
+        $header,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_pull($header, $key);
     }
 }
@@ -1020,8 +1196,12 @@
      * @return bool|array{0: string, 1: int}
      * @throws SodiumException
      */
-    function sodium_crypto_secretstream_xchacha20poly1305_pull(&$state, $ciphertext, $additional_data = '')
-    {
+    function sodium_crypto_secretstream_xchacha20poly1305_pull(
+        #[\SensitiveParameter]
+        &$state,
+        $ciphertext,
+        $additional_data = ''
+    ) {
         return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull(
             $state,
             $ciphertext,
@@ -1035,8 +1215,10 @@
      * @return void
      * @throws SodiumException
      */
-    function sodium_crypto_secretstream_xchacha20poly1305_rekey(&$state)
-    {
+    function sodium_crypto_secretstream_xchacha20poly1305_rekey(
+        #[\SensitiveParameter]
+        &$state
+    ) {
         ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_rekey($state);
     }
 }
@@ -1059,8 +1241,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_shorthash($message, $key = '')
-    {
+    function sodium_crypto_shorthash(
+        $message,
+        #[\SensitiveParameter]
+        $key = ''
+    ) {
         return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key);
     }
 }
@@ -1084,8 +1269,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_sign($message, $secret_key)
-    {
+    function sodium_crypto_sign(
+        $message,
+        #[\SensitiveParameter]
+        $secret_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_sign($message, $secret_key);
     }
 }
@@ -1098,8 +1286,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_sign_detached($message, $secret_key)
-    {
+    function sodium_crypto_sign_detached(
+        $message,
+        #[\SensitiveParameter]
+        $secret_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $secret_key);
     }
 }
@@ -1112,8 +1303,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_sign_keypair_from_secretkey_and_publickey($secret_key, $public_key)
-    {
+    function sodium_crypto_sign_keypair_from_secretkey_and_publickey(
+        #[\SensitiveParameter]
+        $secret_key,
+        $public_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($secret_key, $public_key);
     }
 }
@@ -1155,8 +1349,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_sign_publickey($key_pair)
-    {
+    function sodium_crypto_sign_publickey(
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         return ParagonIE_Sodium_Compat::crypto_sign_publickey($key_pair);
     }
 }
@@ -1168,8 +1364,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_sign_publickey_from_secretkey($secret_key)
-    {
+    function sodium_crypto_sign_publickey_from_secretkey(
+        #[\SensitiveParameter]
+        $secret_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($secret_key);
     }
 }
@@ -1181,8 +1379,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_sign_secretkey($key_pair)
-    {
+    function sodium_crypto_sign_secretkey(
+        #[\SensitiveParameter]
+        $key_pair
+    ) {
         return ParagonIE_Sodium_Compat::crypto_sign_secretkey($key_pair);
     }
 }
@@ -1194,8 +1394,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_sign_seed_keypair($seed)
-    {
+    function sodium_crypto_sign_seed_keypair(
+        #[\SensitiveParameter]
+        $seed
+    ) {
         return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed);
     }
 }
@@ -1235,8 +1437,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_sign_ed25519_sk_to_curve25519($secret_key)
-    {
+    function sodium_crypto_sign_ed25519_sk_to_curve25519(
+        #[\SensitiveParameter]
+        $secret_key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($secret_key);
     }
 }
@@ -1250,8 +1454,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_stream($length, $nonce, $key)
-    {
+    function sodium_crypto_stream(
+        $length,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_stream($length, $nonce, $key);
     }
 }
@@ -1276,8 +1484,13 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_crypto_stream_xor($message, $nonce, $key)
-    {
+    function sodium_crypto_stream_xor(
+        #[\SensitiveParameter]
+        $message,
+        $nonce,
+        #[\SensitiveParameter]
+        $key
+    ) {
         return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key);
     }
 }
@@ -1291,8 +1504,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_hex2bin($string, $ignore = '')
-    {
+    function sodium_hex2bin(
+        #[\SensitiveParameter]
+        $string,
+        $ignore = ''
+    ) {
         return ParagonIE_Sodium_Compat::hex2bin($string, $ignore);
     }
 }
@@ -1304,8 +1520,10 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_increment(&$string)
-    {
+    function sodium_increment(
+        #[\SensitiveParameter]
+        &$string
+    ) {
         ParagonIE_Sodium_Compat::increment($string);
     }
 }
@@ -1348,8 +1566,12 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_memcmp($string1, $string2)
-    {
+    function sodium_memcmp(
+        #[\SensitiveParameter]
+        $string1,
+        #[\SensitiveParameter]
+        $string2
+    ) {
         return ParagonIE_Sodium_Compat::memcmp($string1, $string2);
     }
 }
@@ -1363,8 +1585,10 @@
      *
      * @psalm-suppress ReferenceConstraintViolation
      */
-    function sodium_memzero(&$string)
-    {
+    function sodium_memzero(
+        #[\SensitiveParameter]
+        &$string
+    ) {
         ParagonIE_Sodium_Compat::memzero($string);
     }
 }
@@ -1377,8 +1601,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_pad($unpadded, $block_size)
-    {
+    function sodium_pad(
+        #[\SensitiveParameter]
+        $unpadded,
+        $block_size
+    ) {
         return ParagonIE_Sodium_Compat::pad($unpadded, $block_size, true);
     }
 }
@@ -1391,8 +1618,11 @@
      * @throws SodiumException
      * @throws TypeError
      */
-    function sodium_unpad($padded, $block_size)
-    {
+    function sodium_unpad(
+        #[\SensitiveParameter]
+        $padded,
+        $block_size
+    ) {
         return ParagonIE_Sodium_Compat::unpad($padded, $block_size, true);
     }
 }