Should we use the libsodium core function instead? This is always a good idea, if it’s available. (Unless we’re in the middle of running our unit test suite.)
ParagonIE_Sodium_Compat::useNewSodiumAPI
Libsodium as implemented in PHP 7.2 and/or ext/sodium (via PECL)
ParagonIE_Sodium_Compat::version_string
This emulates libsodium’s version_string() function, except ours is prefixed with ‘polyfill-‘.
ParagonIE_Sodium_Compat::runtime_speed_test
Runtime testing method for 32-bit platforms.
Advertisement
ParagonIE_Sodium_Compat::randombytes_uniform
Generate an integer between 0 and $range (non-inclusive).
ParagonIE_Sodium_Compat::randombytes_random16
Generate a random 16-bit integer.
ParagonIE_Sodium_Compat::randombytes_buf
Generate a string of bytes from the kernel’s CSPRNG.
ParagonIE_Sodium_Compat::unpad
Advertisement
ParagonIE_Sodium_Compat::polyfill_is_fast
Will sodium_compat run fast on the current hardware and PHP configuration?
ParagonIE_Sodium_Compat::pad
ParagonIE_Sodium_Compat::memzero
It’s actually not possible to zero memory buffers in PHP. You need the native library for that.
ParagonIE_Sodium_Compat::memcmp
Compare two strings.
Advertisement
ParagonIE_Sodium_Compat::library_version_minor
The equivalent to the libsodium minor version we aim to be compatible with (sans pwhash and memzero).
ParagonIE_Sodium_Compat::library_version_major
The equivalent to the libsodium minor version we aim to be compatible with (sans pwhash and memzero).
ParagonIE_Sodium_Compat::increment
Increase a string (little endian)