This parameter prevents the use of the PECL extension.
$fastMultboolpublic static
Use fast multiplication rather than our constant-time multiplication implementation. Can be enabled at runtime. Only enable this if you are absolutely certain that there is no timing leak on your platform.
Methods · 128
add()Add two numbers (little-endian unsigned), storing the value in the first parameter.
sub()Add two numbers (little-endian unsigned), storing the value in the first parameter.
version_string()This emulates libsodium's version_string() function, except ours is prefixed with 'polyfill-'.
use_fallback()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.)
useNewSodiumAPI()Libsodium as implemented in PHP 7.2 and/or ext/sodium (via PECL)
28classParagonIE_Sodium_Compat29{30/**31 * This parameter prevents the use of the PECL extension.32 * It should only be used for unit testing.33 *34 * @var bool35 */36publicstatic$disableFallbackForUnitTests=false;3738/**39 * Use fast multiplication rather than our constant-time multiplication40 * implementation. Can be enabled at runtime. Only enable this if you41 * are absolutely certain that there is no timing leak on your platform.42 *43 * @var bool44 */45publicstatic$fastMult=false;4647constLIBRARY_MAJOR_VERSION=9;48constLIBRARY_MINOR_VERSION=1;49constLIBRARY_VERSION_MAJOR=9;50constLIBRARY_VERSION_MINOR=1;51constVERSION_STRING='polyfill-1.0.8';5253// From libsodium54constBASE64_VARIANT_ORIGINAL=1;55constBASE64_VARIANT_ORIGINAL_NO_PADDING=3;56constBASE64_VARIANT_URLSAFE=5;57constBASE64_VARIANT_URLSAFE_NO_PADDING=7;58constCRYPTO_AEAD_AES256GCM_KEYBYTES=32;59constCRYPTO_AEAD_AES256GCM_NSECBYTES=0;60constCRYPTO_AEAD_AES256GCM_NPUBBYTES=12;61constCRYPTO_AEAD_AES256GCM_ABYTES=16;62constCRYPTO_AEAD_AEGIS128L_KEYBYTES=16;63constCRYPTO_AEAD_AEGIS128L_NSECBYTES=0;64constCRYPTO_AEAD_AEGIS128L_NPUBBYTES=16;65constCRYPTO_AEAD_AEGIS128L_ABYTES=32;66constCRYPTO_AEAD_AEGIS256_KEYBYTES=32;67constCRYPTO_AEAD_AEGIS256_NSECBYTES=0;68constCRYPTO_AEAD_AEGIS256_NPUBBYTES=32;69constCRYPTO_AEAD_AEGIS256_ABYTES=32;70constCRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES=32;71constCRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES=0;72constCRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES=8;73constCRYPTO_AEAD_CHACHA20POLY1305_ABYTES=16;74constCRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES=32;75constCRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES=0;76constCRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES=12;77constCRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES=16;78constCRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES=32;79constCRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES=0;80constCRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES=24;81constCRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES=16;82constCRYPTO_AUTH_BYTES=32;83constCRYPTO_AUTH_KEYBYTES=32;84constCRYPTO_BOX_SEALBYTES=16;85constCRYPTO_BOX_SECRETKEYBYTES=32;86constCRYPTO_BOX_PUBLICKEYBYTES=32;87constCRYPTO_BOX_KEYPAIRBYTES=64;88constCRYPTO_BOX_MACBYTES=16;89constCRYPTO_BOX_NONCEBYTES=24;90constCRYPTO_BOX_SEEDBYTES=32;91constCRYPTO_CORE_RISTRETTO255_BYTES=32;92constCRYPTO_CORE_RISTRETTO255_SCALARBYTES=32;93constCRYPTO_CORE_RISTRETTO255_HASHBYTES=64;94constCRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES=64;95constCRYPTO_KDF_BYTES_MIN=16;96constCRYPTO_KDF_BYTES_MAX=64;97constCRYPTO_KDF_CONTEXTBYTES=8;98constCRYPTO_KDF_KEYBYTES=32;99constCRYPTO_KX_BYTES=32;100constCRYPTO_KX_PRIMITIVE='x25519blake2b';101constCRYPTO_KX_SEEDBYTES=32;102constCRYPTO_KX_KEYPAIRBYTES=64;103constCRYPTO_KX_PUBLICKEYBYTES=32;104constCRYPTO_KX_SECRETKEYBYTES=32;105constCRYPTO_KX_SESSIONKEYBYTES=32;106constCRYPTO_GENERICHASH_BYTES=32;107constCRYPTO_GENERICHASH_BYTES_MIN=16;
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-includes/sodium_compat/src/Compat.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.