mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-16 07:35:39 +01:00
30d411f482
The latest version of sodium_compat includes polyfills for new features slated to land in PHP 8.1: https://paragonie.com/blog/2021/05/ristretto255-for-php-community It also fixes a race condition with the autoloader that caused an "undefined constant" error on some systems: https://github.com/paragonie/sodium_compat/issues/122 A full list of changes in this update can be found on GitHub: https://github.com/paragonie/sodium_compat/compare/v1.14.0...v1.16.1 Follow-up to [49741]. Props paragoninitiativeenterprises, oxyrealm. Fixes #53274. Built from https://develop.svn.wordpress.org/trunk@51002 git-svn-id: http://core.svn.wordpress.org/trunk@50611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
<?php
|
|
|
|
if (!is_callable('sodium_crypto_stream_xchacha20')) {
|
|
/**
|
|
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20()
|
|
* @param int $len
|
|
* @param string $nonce
|
|
* @param string $key
|
|
* @return string
|
|
* @throws SodiumException
|
|
* @throws TypeError
|
|
*/
|
|
function sodium_crypto_stream_xchacha20($len, $nonce, $key)
|
|
{
|
|
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20($len, $nonce, $key, true);
|
|
}
|
|
}
|
|
if (!is_callable('sodium_crypto_stream_xchacha20_keygen')) {
|
|
/**
|
|
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20_keygen()
|
|
* @return string
|
|
* @throws Exception
|
|
*/
|
|
function sodium_crypto_stream_xchacha20_keygen()
|
|
{
|
|
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_keygen();
|
|
}
|
|
}
|
|
if (!is_callable('sodium_crypto_stream_xchacha20_xor')) {
|
|
/**
|
|
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor()
|
|
* @param string $message
|
|
* @param string $nonce
|
|
* @param string $key
|
|
* @return string
|
|
* @throws SodiumException
|
|
* @throws TypeError
|
|
*/
|
|
function sodium_crypto_stream_xchacha20_xor($message, $nonce, $key)
|
|
{
|
|
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor($message, $nonce, $key, true);
|
|
}
|
|
}
|