You are here

protected static function ParagonIE_Sodium_Compat::useNewSodiumAPI in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/Compat.php \ParagonIE_Sodium_Compat::useNewSodiumAPI()

Libsodium as implemented in PHP 7.2 and/or ext/sodium (via PECL)

@ref https://wiki.php.net/rfc/libsodium

Return value

bool

62 calls to ParagonIE_Sodium_Compat::useNewSodiumAPI()
ParagonIE_Sodium_Compat::bin2hex in vendor/paragonie/sodium_compat/src/Compat.php
Cache-timing-safe implementation of bin2hex().
ParagonIE_Sodium_Compat::compare in vendor/paragonie/sodium_compat/src/Compat.php
Compare two strings, in constant-time. Compared to memcmp(), compare() is more useful for sorting.
ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available in vendor/paragonie/sodium_compat/src/Compat.php
Is AES-256-GCM even available to use?
ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt in vendor/paragonie/sodium_compat/src/Compat.php
Authenticated Encryption with Associated Data: Decryption
ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt in vendor/paragonie/sodium_compat/src/Compat.php
Authenticated Encryption with Associated Data

... See full list

File

vendor/paragonie/sodium_compat/src/Compat.php, line 3548

Class

ParagonIE_Sodium_Compat

Code

protected static function useNewSodiumAPI() {
  static $res = null;
  if ($res === null) {
    $res = PHP_VERSION_ID >= 70000 && extension_loaded('sodium');
  }
  if (self::$disableFallbackForUnitTests) {

    // Don't fallback. Use the PHP implementation.
    return false;
  }
  return (bool) $res;
}