WordPress Version: 6.1
/**
* @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt()
* @param string $ciphertext
* @param string $additional_data
* @param string $nonce
* @param string $key
* @return string|bool
*/
function sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $additional_data, $nonce, $key)
{
try {
return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($ciphertext, $additional_data, $nonce, $key);
} catch (Error $ex) {
return false;
} catch (Exception $ex) {
if ($ex instanceof SodiumException && $ex->getMessage() === 'AES-256-GCM is not available') {
throw $ex;
}
return false;
}
}