equal
deleted
inserted
replaced
52 if (PHP_VERSION_ID >= 50300) { |
52 if (PHP_VERSION_ID >= 50300) { |
53 // Namespaces didn't exist before 5.3.0, so don't even try to use this |
53 // Namespaces didn't exist before 5.3.0, so don't even try to use this |
54 // unless PHP >= 5.3.0 |
54 // unless PHP >= 5.3.0 |
55 require_once dirname(__FILE__) . '/lib/namespaced.php'; |
55 require_once dirname(__FILE__) . '/lib/namespaced.php'; |
56 require_once dirname(__FILE__) . '/lib/sodium_compat.php'; |
56 require_once dirname(__FILE__) . '/lib/sodium_compat.php'; |
|
57 if (!defined('SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES')) { |
|
58 require_once dirname(__FILE__) . '/lib/php84compat_const.php'; |
|
59 } |
57 } else { |
60 } else { |
58 require_once dirname(__FILE__) . '/src/PHP52/SplFixedArray.php'; |
61 require_once dirname(__FILE__) . '/src/PHP52/SplFixedArray.php'; |
59 } |
62 } |
60 if (PHP_VERSION_ID < 70200 || !extension_loaded('sodium')) { |
63 if (PHP_VERSION_ID < 70200 || !extension_loaded('sodium')) { |
61 if (PHP_VERSION_ID >= 50300 && !defined('SODIUM_CRYPTO_SCALARMULT_BYTES')) { |
64 if (PHP_VERSION_ID >= 50300 && !defined('SODIUM_CRYPTO_SCALARMULT_BYTES')) { |
69 require_once(dirname(__FILE__) . '/lib/php72compat.php'); |
72 require_once(dirname(__FILE__) . '/lib/php72compat.php'); |
70 } elseif (!function_exists('sodium_crypto_stream_xchacha20_xor')) { |
73 } elseif (!function_exists('sodium_crypto_stream_xchacha20_xor')) { |
71 // Older versions of {PHP, ext/sodium} will not define these |
74 // Older versions of {PHP, ext/sodium} will not define these |
72 require_once(dirname(__FILE__) . '/lib/php72compat.php'); |
75 require_once(dirname(__FILE__) . '/lib/php72compat.php'); |
73 } |
76 } |
|
77 if (PHP_VERSION_ID < 80400 || !extension_loaded('sodium')) { |
|
78 require_once dirname(__FILE__) . '/lib/php84compat.php'; |
|
79 } |
74 require_once(dirname(__FILE__) . '/lib/stream-xchacha20.php'); |
80 require_once(dirname(__FILE__) . '/lib/stream-xchacha20.php'); |
75 require_once(dirname(__FILE__) . '/lib/ristretto255.php'); |
81 require_once(dirname(__FILE__) . '/lib/ristretto255.php'); |