: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p);
if (!is_callable('\\Sodium\\crypto_scalarmult_base')) {
* @see ParagonIE_Sodium_Compat::crypto_scalarmult_base()
* @throws \SodiumException
function crypto_scalarmult_base($n)
return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n);
if (!is_callable('\\Sodium\\crypto_secretbox')) {
* @see ParagonIE_Sodium_Compat::crypto_secretbox()
* @throws \SodiumException
function crypto_secretbox($message, $nonce, $key)
return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key);
if (!is_callable('\\Sodium\\crypto_secretbox_open')) {
* @see ParagonIE_Sodium_Compat::crypto_secretbox_open()
function crypto_secretbox_open($message, $nonce, $key)
return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key);
} catch (\TypeError $ex) {
} catch (\SodiumException $ex) {
if (!is_callable('\\Sodium\\crypto_shorthash')) {
* @see ParagonIE_Sodium_Compat::crypto_shorthash()
* @throws \SodiumException
function crypto_shorthash($message, $key = '')
return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key);
if (!is_callable('\\Sodium\\crypto_sign')) {
* @see ParagonIE_Sodium_Compat::crypto_sign()
* @throws \SodiumException
function crypto_sign($message, $sk)
return ParagonIE_Sodium_Compat::crypto_sign($message, $sk);
if (!is_callable('\\Sodium\\crypto_sign_detached')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_detached()
* @throws \SodiumException
function crypto_sign_detached($message, $sk)
return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk);
if (!is_callable('\\Sodium\\crypto_sign_keypair')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_keypair()
* @throws \SodiumException
function crypto_sign_keypair()
return ParagonIE_Sodium_Compat::crypto_sign_keypair();
if (!is_callable('\\Sodium\\crypto_sign_open')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_open()
* @param string $signedMessage
function crypto_sign_open($signedMessage, $pk)
return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk);
} catch (\TypeError $ex) {
} catch (\SodiumException $ex) {
if (!is_callable('\\Sodium\\crypto_sign_publickey')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_publickey()
* @throws \SodiumException
function crypto_sign_publickey($keypair)
return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair);
if (!is_callable('\\Sodium\\crypto_sign_publickey_from_secretkey')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey()
* @throws \SodiumException
function crypto_sign_publickey_from_secretkey($sk)
return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk);
if (!is_callable('\\Sodium\\crypto_sign_secretkey')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_secretkey()
* @throws \SodiumException
function crypto_sign_secretkey($keypair)
return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair);
if (!is_callable('\\Sodium\\crypto_sign_seed_keypair')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_seed_keypair()
* @throws \SodiumException
function crypto_sign_seed_keypair($seed)
return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed);
if (!is_callable('\\Sodium\\crypto_sign_verify_detached')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_verify_detached()
* @param string $signature
* @throws \SodiumException
function crypto_sign_verify_detached($signature, $message, $pk)
return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $pk);
if (!is_callable('\\Sodium\\crypto_sign_ed25519_pk_to_curve25519')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519()
* @throws \SodiumException
function crypto_sign_ed25519_pk_to_curve25519($pk)
return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($pk);
if (!is_callable('\\Sodium\\crypto_sign_ed25519_sk_to_curve25519')) {
* @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519()
* @throws \SodiumException
function crypto_sign_ed25519_sk_to_curve25519($sk)
return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk);
if (!is_callable('\\Sodium\\crypto_stream')) {
* @see ParagonIE_Sodium_Compat::crypto_stream()
* @throws \SodiumException
function crypto_stream($len, $nonce, $key)
return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key);
if (!is_callable('\\Sodium\\crypto_stream_xor')) {
* @see ParagonIE_Sodium_Compat::crypto_stream_xor()
* @throws \SodiumException
function crypto_stream_xor($message, $nonce, $key)
return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key);
if (!is_callable('\\Sodium\\hex2bin')) {
* @see ParagonIE_Sodium_Compat::hex2bin()
* @throws \SodiumException
function hex2bin($string)
return ParagonIE_Sodium_Compat::hex2bin($string);
if (!is_callable('\\Sodium\\memcmp')) {
* @see ParagonIE_Sodium_Compat::memcmp()
* @throws \SodiumException
return ParagonIE_Sodium_Compat::memcmp($a, $b);
if (!is_callable('\\Sodium\\memzero')) {
* @see ParagonIE_Sodium_Compat::memzero()
* @throws \SodiumException
* @psalm-suppress MissingParamType
* @psalm-suppress MissingReturnType
* @psalm-suppress ReferenceConstraintViolation
ParagonIE_Sodium_Compat::memzero($str);
if (!is_callable('\\Sodium\\randombytes_buf')) {
* @see ParagonIE_Sodium_Compat::randombytes_buf()
function randombytes_buf($amount)
return ParagonIE_Sodium_Compat::randombytes_buf($amount);
if (!is_callable('\\Sodium\\randombytes_uniform')) {
* @see ParagonIE_Sodium_Compat::randombytes_uniform()
* @throws \SodiumException
function randombytes_uniform($upperLimit)
return ParagonIE_Sodium_Compat::randombytes_uniform($upperLimit);
if (!is_callable('\\Sodium\\randombytes_random16')) {
* @see ParagonIE_Sodium_Compat::randombytes_random16()
function randombytes_random16()
return ParagonIE_Sodium_Compat::randombytes_random16();
if (!defined('\\Sodium\\CRYPTO_AUTH_BYTES')) {
require_once dirname(__FILE__) . '/constants.php';