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)
31classParagonIE_Sodium_Compat32{33/**34 * This parameter prevents the use of the PECL extension.35 * It should only be used for unit testing.36 *37 * @var bool38 */39publicstatic$disableFallbackForUnitTests=false;4041/**42 * Use fast multiplication rather than our constant-time multiplication43 * implementation. Can be enabled at runtime. Only enable this if you44 * are absolutely certain that there is no timing leak on your platform.45 *46 * @var bool47 */48publicstatic$fastMult=false;4950constLIBRARY_MAJOR_VERSION=9;51constLIBRARY_MINOR_VERSION=1;52constLIBRARY_VERSION_MAJOR=9;53constLIBRARY_VERSION_MINOR=1;54constVERSION_STRING='polyfill-1.0.8';5556// From libsodium57constBASE64_VARIANT_ORIGINAL=1;58constBASE64_VARIANT_ORIGINAL_NO_PADDING=3;59constBASE64_VARIANT_URLSAFE=5;60constBASE64_VARIANT_URLSAFE_NO_PADDING=7;61constCRYPTO_AEAD_AES256GCM_KEYBYTES=32;62constCRYPTO_AEAD_AES256GCM_NSECBYTES=0;63constCRYPTO_AEAD_AES256GCM_NPUBBYTES=12;64constCRYPTO_AEAD_AES256GCM_ABYTES=16;65constCRYPTO_AEAD_AEGIS128L_KEYBYTES=16;66constCRYPTO_AEAD_AEGIS128L_NSECBYTES=0;67constCRYPTO_AEAD_AEGIS128L_NPUBBYTES=16;68constCRYPTO_AEAD_AEGIS128L_ABYTES=32;69constCRYPTO_AEAD_AEGIS256_KEYBYTES=32;70constCRYPTO_AEAD_AEGIS256_NSECBYTES=0;71constCRYPTO_AEAD_AEGIS256_NPUBBYTES=32;72constCRYPTO_AEAD_AEGIS256_ABYTES=32;73constCRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES=32;74constCRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES=0;75constCRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES=8;76constCRYPTO_AEAD_CHACHA20POLY1305_ABYTES=16;77constCRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES=32;78constCRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES=0;79constCRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES=12;80constCRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES=16;81constCRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES=32;82constCRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES=0;83constCRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES=24;84constCRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES=16;85constCRYPTO_AUTH_BYTES=32;86constCRYPTO_AUTH_KEYBYTES=32;87constCRYPTO_BOX_SEALBYTES=16;88constCRYPTO_BOX_SECRETKEYBYTES=32;89constCRYPTO_BOX_PUBLICKEYBYTES=32;90constCRYPTO_BOX_KEYPAIRBYTES=64;91constCRYPTO_BOX_MACBYTES=16;92constCRYPTO_BOX_NONCEBYTES=24;93constCRYPTO_BOX_SEEDBYTES=32;94constCRYPTO_CORE_RISTRETTO255_BYTES=32;95constCRYPTO_CORE_RISTRETTO255_SCALARBYTES=32;96constCRYPTO_CORE_RISTRETTO255_HASHBYTES=64;97constCRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES=64;98constCRYPTO_KDF_BYTES_MIN=16;99constCRYPTO_KDF_BYTES_MAX=64;100constCRYPTO_KDF_CONTEXTBYTES=8;101constCRYPTO_KDF_KEYBYTES=32;102constCRYPTO_KX_BYTES=32;103constCRYPTO_KX_PRIMITIVE='x25519blake2b';104constCRYPTO_KX_SEEDBYTES=32;105constCRYPTO_KX_KEYPAIRBYTES=64;106constCRYPTO_KX_PUBLICKEYBYTES=32;107constCRYPTO_KX_SECRETKEYBYTES=32;108constCRYPTO_KX_SESSIONKEYBYTES=32;109constCRYPTO_GENERICHASH_BYTES=32;110constCRYPTO_GENERICHASH_BYTES_MIN=16;
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 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.