: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
return ParagonIE_Sodium_Compat::crypto_box_open($ciphertext, $nonce, $key_pair);
} catch (Exception $ex) {
if (!is_callable('sodium_crypto_box_publickey')) {
* @see ParagonIE_Sodium_Compat::crypto_box_publickey()
* @param string $key_pair
* @throws SodiumException
function sodium_crypto_box_publickey($key_pair)
return ParagonIE_Sodium_Compat::crypto_box_publickey($key_pair);
if (!is_callable('sodium_crypto_box_publickey_from_secretkey')) {
* @see ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey()
* @param string $secret_key
* @throws SodiumException
function sodium_crypto_box_publickey_from_secretkey($secret_key)
return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($secret_key);
if (!is_callable('sodium_crypto_box_seal')) {
* @see ParagonIE_Sodium_Compat::crypto_box_seal()
* @param string $public_key
* @throws SodiumException
function sodium_crypto_box_seal($message, $public_key)
return ParagonIE_Sodium_Compat::crypto_box_seal($message, $public_key);
if (!is_callable('sodium_crypto_box_seal_open')) {
* @see ParagonIE_Sodium_Compat::crypto_box_seal_open()
* @param string $key_pair
* @throws SodiumException
function sodium_crypto_box_seal_open($message, $key_pair)
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $key_pair);
} catch (SodiumException $ex) {
if ($ex->getMessage() === 'Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.') {
if (!is_callable('sodium_crypto_box_secretkey')) {
* @see ParagonIE_Sodium_Compat::crypto_box_secretkey()
* @param string $key_pair
* @throws SodiumException
function sodium_crypto_box_secretkey($key_pair)
return ParagonIE_Sodium_Compat::crypto_box_secretkey($key_pair);
if (!is_callable('sodium_crypto_box_seed_keypair')) {
* @see ParagonIE_Sodium_Compat::crypto_box_seed_keypair()
* @throws SodiumException
function sodium_crypto_box_seed_keypair($seed)
return ParagonIE_Sodium_Compat::crypto_box_seed_keypair($seed);
if (!is_callable('sodium_crypto_generichash')) {
* @see ParagonIE_Sodium_Compat::crypto_generichash()
* @param string|null $key
* @throws SodiumException
function sodium_crypto_generichash($message, $key = null, $length = 32)
return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $length);
if (!is_callable('sodium_crypto_generichash_final')) {
* @see ParagonIE_Sodium_Compat::crypto_generichash_final()
* @param string|null $state
* @param int $outputLength
* @throws SodiumException
function sodium_crypto_generichash_final(&$state, $outputLength = 32)
return ParagonIE_Sodium_Compat::crypto_generichash_final($state, $outputLength);
if (!is_callable('sodium_crypto_generichash_init')) {
* @see ParagonIE_Sodium_Compat::crypto_generichash_init()
* @param string|null $key
* @throws SodiumException
function sodium_crypto_generichash_init($key = null, $length = 32)
return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $length);
if (!is_callable('sodium_crypto_generichash_keygen')) {
* @see ParagonIE_Sodium_Compat::crypto_generichash_keygen()
function sodium_crypto_generichash_keygen()
return ParagonIE_Sodium_Compat::crypto_generichash_keygen();
if (!is_callable('sodium_crypto_generichash_update')) {
* @see ParagonIE_Sodium_Compat::crypto_generichash_update()
* @param string|null $state
* @throws SodiumException
function sodium_crypto_generichash_update(&$state, $message = '')
ParagonIE_Sodium_Compat::crypto_generichash_update($state, $message);
if (!is_callable('sodium_crypto_kdf_keygen')) {
* @see ParagonIE_Sodium_Compat::crypto_kdf_keygen()
function sodium_crypto_kdf_keygen()
return ParagonIE_Sodium_Compat::crypto_kdf_keygen();
if (!is_callable('sodium_crypto_kdf_derive_from_key')) {
* @see ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key()
* @param int $subkey_length
function sodium_crypto_kdf_derive_from_key($subkey_length, $subkey_id, $context, $key)
return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key(
if (!is_callable('sodium_crypto_kx')) {
* @see ParagonIE_Sodium_Compat::crypto_kx()
* @param string $my_secret
* @param string $their_public
* @param string $client_public
* @param string $server_public
* @throws SodiumException
function sodium_crypto_kx($my_secret, $their_public, $client_public, $server_public)
return ParagonIE_Sodium_Compat::crypto_kx(
if (!is_callable('sodium_crypto_kx_seed_keypair')) {
function sodium_crypto_kx_seed_keypair($seed)
return ParagonIE_Sodium_Compat::crypto_kx_seed_keypair($seed);
if (!is_callable('sodium_crypto_kx_keypair')) {
function sodium_crypto_kx_keypair()
return ParagonIE_Sodium_Compat::crypto_kx_keypair();
if (!is_callable('sodium_crypto_kx_client_session_keys')) {
* @param string $client_key_pair
* @param string $server_key
* @return array{0: string, 1: string}
* @throws SodiumException
function sodium_crypto_kx_client_session_keys($client_key_pair, $server_key)
return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($client_key_pair, $server_key);
if (!is_callable('sodium_crypto_kx_server_session_keys')) {
* @param string $server_key_pair
* @param string $client_key
* @return array{0: string, 1: string}
* @throws SodiumException
function sodium_crypto_kx_server_session_keys($server_key_pair, $client_key)
return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($server_key_pair, $client_key);
if (!is_callable('sodium_crypto_kx_secretkey')) {
* @param string $key_pair
function sodium_crypto_kx_secretkey($key_pair)
return ParagonIE_Sodium_Compat::crypto_kx_secretkey($key_pair);
if (!is_callable('sodium_crypto_kx_publickey')) {
* @param string $key_pair
function sodium_crypto_kx_publickey($key_pair)
return ParagonIE_Sodium_Compat::crypto_kx_publickey($key_pair);
if (!is_callable('sodium_crypto_pwhash')) {
* @see ParagonIE_Sodium_Compat::crypto_pwhash()
* @throws SodiumException
function sodium_crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo = null)
return ParagonIE_Sodium_Compat::crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo);
if (!is_callable('sodium_crypto_pwhash_str')) {
* @see ParagonIE_Sodium_Compat::crypto_pwhash_str()
* @throws SodiumException
function sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit)
return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit);
if (!is_callable('sodium_crypto_pwhash_str_needs_rehash')) {
* @see ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash()
* @throws SodiumException
function sodium_crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit)
return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit);
if (!is_callable('sodium_crypto_pwhash_str_verify')) {
* @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify()
* @throws SodiumException
function sodium_crypto_pwhash_str_verify($passwd, $hash)
return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash);
if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256')) {
* @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256()
* @throws SodiumException
function sodium_crypto_pwhash_scryptsalsa208sha256($length, $passwd, $salt, $opslimit, $memlimit)
return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256(
if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str')) {
* @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str()
* @throws SodiumException
function sodium_crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)
return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit);
if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str_verify')) {
* @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify()
* @throws SodiumException
function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)
return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash);
if (!is_callable('sodium_crypto_scalarmult')) {
* @see ParagonIE_Sodium_Compat::crypto_scalarmult()
* @throws SodiumException
function sodium_crypto_scalarmult($n, $p)
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 sodium_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 sodium_crypto_secretbox($message, $nonce, $key)
return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key);
if (!is_callable('sodium_crypto_secretbox_keygen')) {
* @see ParagonIE_Sodium_Compat::crypto_secretbox_keygen()
function sodium_crypto_secretbox_keygen()
return ParagonIE_Sodium_Compat::crypto_secretbox_keygen();
if (!is_callable('sodium_crypto_secretbox_open')) {
* @see ParagonIE_Sodium_Compat::crypto_secretbox_open()
* @param string $ciphertext
function sodium_crypto_secretbox_open($ciphertext, $nonce, $key)
return ParagonIE_Sodium_Compat::crypto_secretbox_open($ciphertext, $nonce, $key);
} catch (Exception $ex) {
if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_push')) {
* @return array<int, string>
* @throws SodiumException
function sodium_crypto_secretstream_xchacha20poly1305_init_push($key)
return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_push($key);
if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_push')) {
* @param string $additional_data
* @throws SodiumException
function sodium_crypto_secretstream_xchacha20poly1305_push(
return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_push(