ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available

Advertisement

Summery Summery

Is AES-256-GCM even available to use?

Syntax Syntax

ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available()

Return Return

(bool)

Source Source

File: wp-includes/sodium_compat/src/Compat.php

    public static function crypto_aead_aes256gcm_is_available()
    {
        if (self::useNewSodiumAPI()) {
            return sodium_crypto_aead_aes256gcm_is_available();
        }
        if (self::use_fallback('crypto_aead_aes256gcm_is_available')) {
            return call_user_func('\\Sodium\\crypto_aead_aes256gcm_is_available');
        }
        if (PHP_VERSION_ID < 70100) {
            // OpenSSL doesn't support AEAD before 7.1.0
            return false;
        }
        if (!is_callable('openssl_encrypt') || !is_callable('openssl_decrypt')) {
            // OpenSSL isn't installed
            return false;
        }
        return (bool) in_array('aes-256-gcm', openssl_get_cipher_methods());
    }

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.