Joomla CMS
3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
|
Fonctions membres publiques statiques | |
static | add (&$val, $addv) |
static | bin2hex ($string) |
static | compare ($left, $right) |
static | crypto_aead_aes256gcm_is_available () |
static | crypto_aead_aes256gcm_encrypt ( $plaintext='', $assocData='', $nonce='', $key='') |
static | crypto_aead_aes256gcm_keygen () |
static | crypto_aead_chacha20poly1305_decrypt ( $ciphertext='', $assocData='', $nonce='', $key='') |
static | crypto_aead_chacha20poly1305_encrypt ( $plaintext='', $assocData='', $nonce='', $key='') |
static | crypto_aead_chacha20poly1305_ietf_decrypt ( $ciphertext='', $assocData='', $nonce='', $key='') |
static | crypto_aead_chacha20poly1305_keygen () |
static | crypto_aead_chacha20poly1305_ietf_encrypt ( $plaintext='', $assocData='', $nonce='', $key='') |
static | crypto_aead_chacha20poly1305_ietf_keygen () |
static | crypto_aead_xchacha20poly1305_ietf_decrypt ( $ciphertext='', $assocData='', $nonce='', $key='', $dontFallback=false) |
static | crypto_aead_xchacha20poly1305_ietf_encrypt ( $plaintext='', $assocData='', $nonce='', $key='', $dontFallback=false) |
static | crypto_aead_xchacha20poly1305_ietf_keygen () |
static | crypto_auth ($message, $key) |
static | crypto_auth_keygen () |
static | crypto_auth_verify ($mac, $message, $key) |
static | crypto_box ($plaintext, $nonce, $keypair) |
static | crypto_box_seal ($plaintext, $publicKey) |
static | crypto_box_seal_open ($ciphertext, $keypair) |
static | crypto_box_keypair () |
static | crypto_box_keypair_from_secretkey_and_publickey ($secretKey, $publicKey) |
static | crypto_box_open ($ciphertext, $nonce, $keypair) |
static | crypto_box_publickey ($keypair) |
static | crypto_box_publickey_from_secretkey ($secretKey) |
static | crypto_box_secretkey ($keypair) |
static | crypto_box_seed_keypair ($seed) |
static | crypto_generichash ($message, $key='', $length=self::CRYPTO_GENERICHASH_BYTES) |
static | crypto_generichash_final (&$ctx, $length=self::CRYPTO_GENERICHASH_BYTES) |
static | crypto_generichash_init ($key='', $length=self::CRYPTO_GENERICHASH_BYTES) |
static | crypto_generichash_init_salt_personal ( $key='', $length=self::CRYPTO_GENERICHASH_BYTES, $salt='', $personal='') |
static | crypto_generichash_update (&$ctx, $message) |
static | crypto_generichash_keygen () |
static | crypto_kdf_derive_from_key ( $subkey_len, $subkey_id, $context, $key) |
static | crypto_kdf_keygen () |
static | crypto_kx ($my_secret, $their_public, $client_public, $server_public, $dontFallback=false) |
static | crypto_kx_seed_keypair ($seed) |
static | crypto_kx_keypair () |
static | crypto_kx_client_session_keys ($keypair, $serverPublicKey) |
static | crypto_kx_server_session_keys ($keypair, $clientPublicKey) |
static | crypto_kx_secretkey ($kp) |
static | crypto_kx_publickey ($kp) |
static | crypto_pwhash ($outlen, $passwd, $salt, $opslimit, $memlimit, $alg=null) |
static | crypto_pwhash_is_available () |
static | crypto_pwhash_str ($passwd, $opslimit, $memlimit) |
static | crypto_pwhash_str_verify ($passwd, $hash) |
static | crypto_pwhash_scryptsalsa208sha256 ($outlen, $passwd, $salt, $opslimit, $memlimit) |
static | crypto_pwhash_scryptsalsa208sha256_is_available () |
static | crypto_pwhash_scryptsalsa208sha256_str ($passwd, $opslimit, $memlimit) |
static | crypto_pwhash_scryptsalsa208sha256_str_verify ($passwd, $hash) |
static | crypto_scalarmult ($secretKey, $publicKey) |
static | crypto_scalarmult_base ($secretKey) |
static | crypto_secretbox ($plaintext, $nonce, $key) |
static | crypto_secretbox_open ($ciphertext, $nonce, $key) |
static | crypto_secretbox_keygen () |
static | crypto_secretbox_xchacha20poly1305 ($plaintext, $nonce, $key) |
static | crypto_secretbox_xchacha20poly1305_open ($ciphertext, $nonce, $key) |
static | crypto_secretstream_xchacha20poly1305_init_push ($key) |
static | crypto_secretstream_xchacha20poly1305_init_pull ($header, $key) |
static | crypto_secretstream_xchacha20poly1305_push (&$state, $msg, $aad='', $tag=0) |
static | crypto_secretstream_xchacha20poly1305_pull (&$state, $msg, $aad='') |
static | crypto_secretstream_xchacha20poly1305_keygen () |
static | crypto_secretstream_xchacha20poly1305_rekey (&$state) |
static | crypto_shorthash ($message, $key) |
static | crypto_shorthash_keygen () |
static | crypto_sign ($message, $secretKey) |
static | crypto_sign_open ($signedMessage, $publicKey) |
static | crypto_sign_keypair () |
static | crypto_sign_keypair_from_secretkey_and_publickey ($sk, $pk) |
static | crypto_sign_seed_keypair ($seed) |
static | crypto_sign_publickey ($keypair) |
static | crypto_sign_publickey_from_secretkey ($secretKey) |
static | crypto_sign_secretkey ($keypair) |
static | crypto_sign_detached ($message, $secretKey) |
static | crypto_sign_verify_detached ($signature, $message, $publicKey) |
static | crypto_sign_ed25519_pk_to_curve25519 ($pk) |
static | crypto_sign_ed25519_sk_to_curve25519 ($sk) |
static | crypto_stream ($len, $nonce, $key) |
static | crypto_stream_xor ($message, $nonce, $key) |
static | crypto_stream_keygen () |
static | crypto_stream_xchacha20 ($len, $nonce, $key, $dontFallback=false) |
static | crypto_stream_xchacha20_xor ($message, $nonce, $key, $dontFallback=false) |
static | crypto_stream_xchacha20_keygen () |
static | hex2bin ($string) |
static | increment (&$var) |
static | is_zero ($str) |
static | library_version_major () |
static | library_version_minor () |
static | memzero (&$var) |
static | unpad ($padded, $blockSize, $dontFallback=false) |
static | polyfill_is_fast () |
static | randombytes_uniform ($range) |
static | randombytes_random16 () |
static | ristretto255_is_valid_point ($p, $dontFallback=false) |
static | ristretto255_add ($p, $q, $dontFallback=false) |
static | ristretto255_sub ($p, $q, $dontFallback=false) |
static | ristretto255_from_hash ($r, $dontFallback=false) |
static | ristretto255_random ($dontFallback=false) |
static | ristretto255_scalar_random ($dontFallback=false) |
static | ristretto255_scalar_invert ($s, $dontFallback=false) |
static | ristretto255_scalar_negate ($s, $dontFallback=false) |
static | ristretto255_scalar_complement ($s, $dontFallback=false) |
static | ristretto255_scalar_add ($x, $y, $dontFallback=false) |
static | ristretto255_scalar_sub ($x, $y, $dontFallback=false) |
static | ristretto255_scalar_mul ($x, $y, $dontFallback=false) |
static | scalarmult_ristretto255 ($n, $p, $dontFallback=false) |
static | scalarmult_ristretto255_base ($n, $dontFallback=false) |
static | ristretto255_scalar_reduce ($s, $dontFallback=false) |
static | sub (&$val, $addv) |
static | version_string () |
Attributs publics statiques | |
static | $disableFallbackForUnitTests = false |
static | $fastMult = false |
Fonctions membres protégées statiques | |
static | use_fallback ($sodium_func_name='') |
static | useNewSodiumAPI () |
Libsodium compatibility layer
This is the only class you should be interfacing with, as a user of sodium_compat.
If the PHP extension for libsodium is installed, it will always use that instead of our implementations. You get better performance and stronger guarantees against side-channels that way.
However, if your users don't have the PHP extension installed, we offer a compatible interface here. It will give you the correct results as if the PHP extension was installed. It won't be as fast, of course.
CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION * CAUTION *
|
static |
Add two numbers (little-endian unsigned), storing the value in the first parameter.
This mutates $val.
string | $val | |
string | $addv |
SodiumException |
Références $i, et ParagonIE_Sodium_Core_Util\strlen().
Référencé par ParagonIE_Sodium_Core_Ed25519\scalar_add().
|
static |
Cache-timing-safe implementation of bin2hex().
string | $string | A string (probably raw binary) |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
Compare two strings, in constant-time. Compared to memcmp(), compare() is more useful for sorting.
string | $left | The left operand; must be a string |
string | $right | The right operand; must be a string |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Core_Util\compare(), et ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
Authenticated Encryption with Associated Data: Encryption
Algorithm: AES-256-GCM
string | $plaintext | Message to be encrypted |
string | $assocData | Authenticated Associated Data (unencrypted) |
string | $nonce | Number to be used only Once; must be 8 bytes |
string | $key | Encryption key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_AEAD_AES256GCM_KEYBYTES, Sodium\CRYPTO_AEAD_AES256GCM_NPUBBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Is AES-256-GCM even available to use?
|
static |
Return a secure random key for use with the AES-256-GCM symmetric AEAD interface.
Exception | |
Error |
Références Sodium\CRYPTO_AEAD_AES256GCM_KEYBYTES.
|
static |
Authenticated Encryption with Associated Data: Decryption
Algorithm: ChaCha20-Poly1305
This mode uses a 64-bit random nonce with a 64-bit counter. IETF mode uses a 96-bit random nonce with a 32-bit counter.
string | $ciphertext | Encrypted message (with Poly1305 MAC appended) |
string | $assocData | Authenticated Associated Data (unencrypted) |
string | $nonce | Number to be used only Once; must be 8 bytes |
string | $key | Encryption key |
SodiumException | |
TypeError | -suppress MixedArgument -suppress MixedInferredReturnType -suppress MixedReturnStatement |
-suppress InvalidReturnStatement -suppress FalsableReturnStatement
Références $key, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_ABYTES, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Authenticated Encryption with Associated Data
Algorithm: ChaCha20-Poly1305
This mode uses a 64-bit random nonce with a 64-bit counter. IETF mode uses a 96-bit random nonce with a 32-bit counter.
string | $plaintext | Message to be encrypted |
string | $assocData | Authenticated Associated Data (unencrypted) |
string | $nonce | Number to be used only Once; must be 8 bytes |
string | $key | Encryption key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Authenticated Encryption with Associated Data: Decryption
Algorithm: ChaCha20-Poly1305
IETF mode uses a 96-bit random nonce with a 32-bit counter. Regular mode uses a 64-bit random nonce with a 64-bit counter.
string | $ciphertext | Encrypted message (with Poly1305 MAC appended) |
string | $assocData | Authenticated Associated Data (unencrypted) |
string | $nonce | Number to be used only Once; must be 12 bytes |
string | $key | Encryption key |
SodiumException | |
TypeError | -suppress MixedArgument -suppress MixedInferredReturnType -suppress MixedReturnStatement |
-suppress InvalidReturnStatement -suppress FalsableReturnStatement
Références $key, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_ABYTES, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Authenticated Encryption with Associated Data
Algorithm: ChaCha20-Poly1305
IETF mode uses a 96-bit random nonce with a 32-bit counter. Regular mode uses a 64-bit random nonce with a 64-bit counter.
string | $plaintext | Message to be encrypted |
string | $assocData | Authenticated Associated Data (unencrypted) |
string | $nonce | Number to be used only Once; must be 8 bytes |
string | $key | Encryption key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES, Sodium\CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Return a secure random key for use with the ChaCha20-Poly1305 symmetric AEAD interface. (IETF version)
Exception | |
Error |
Références Sodium\CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES.
|
static |
Return a secure random key for use with the ChaCha20-Poly1305 symmetric AEAD interface.
Exception | |
Error |
Références Sodium\CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES.
|
static |
Authenticated Encryption with Associated Data: Decryption
Algorithm: XChaCha20-Poly1305
This mode uses a 64-bit random nonce with a 64-bit counter. IETF mode uses a 96-bit random nonce with a 32-bit counter.
string | $ciphertext | Encrypted message (with Poly1305 MAC appended) |
string | $assocData | Authenticated Associated Data (unencrypted) |
string | $nonce | Number to be used only Once; must be 8 bytes |
string | $key | Encryption key |
bool | $dontFallback | Don't fallback to ext/sodium |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, ParagonIE_Sodium_Crypto\aead_xchacha20poly1305_ietf_decrypt(), ParagonIE_Sodium_Crypto32\aead_xchacha20poly1305_ietf_decrypt(), ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Authenticated Encryption with Associated Data
Algorithm: XChaCha20-Poly1305
This mode uses a 64-bit random nonce with a 64-bit counter. IETF mode uses a 96-bit random nonce with a 32-bit counter.
string | $plaintext | Message to be encrypted |
string | $assocData | Authenticated Associated Data (unencrypted) |
string | $nonce | Number to be used only Once; must be 8 bytes |
string | $key | Encryption key |
bool | $dontFallback | Don't fallback to ext/sodium |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, ParagonIE_Sodium_Crypto\aead_xchacha20poly1305_ietf_encrypt(), ParagonIE_Sodium_Crypto32\aead_xchacha20poly1305_ietf_encrypt(), ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Return a secure random key for use with the XChaCha20-Poly1305 symmetric AEAD interface.
Exception | |
Error |
|
static |
Authenticate a message. Uses symmetric-key cryptography.
Algorithm: HMAC-SHA512-256. Which is HMAC-SHA-512 truncated to 256 bits. Not to be confused with HMAC-SHA-512/256 which would use the SHA-512/256 hash function (uses different initial parameters but still truncates to 256 bits to sidestep length-extension attacks).
string | $message | Message to be authenticated |
string | $key | Symmetric authentication key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, $message, ParagonIE_Sodium_Crypto32\auth(), ParagonIE_Sodium_Crypto\auth(), Sodium\CRYPTO_AUTH_KEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
|
static |
Verify the MAC of a message previously authenticated with crypto_auth.
string | $mac | Message authentication code |
string | $message | Message whose authenticity you are attempting to verify (with a given MAC and key) |
string | $key | Symmetric authentication key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, $message, ParagonIE_Sodium_Crypto\auth_verify(), ParagonIE_Sodium_Crypto32\auth_verify(), Sodium\CRYPTO_AUTH_BYTES, Sodium\CRYPTO_AUTH_KEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Authenticated asymmetric-key encryption. Both the sender and recipient may decrypt messages.
Algorithm: X25519-XSalsa20-Poly1305. X25519: Elliptic-Curve Diffie Hellman over Curve25519. XSalsa20: Extended-nonce variant of salsa20. Poyl1305: Polynomial MAC for one-time message authentication.
string | $plaintext | The message to be encrypted |
string | $nonce | A Number to only be used Once; must be 24 bytes |
string | $keypair | Your secret key and your recipient's public key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Crypto32\box(), ParagonIE_Sodium_Crypto\box(), Sodium\CRYPTO_BOX_KEYPAIRBYTES, Sodium\CRYPTO_BOX_NONCEBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
Référencé par SodiumCipher\encrypt().
|
static |
Generate a new random X25519 keypair.
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Crypto32\box_keypair(), et ParagonIE_Sodium_Crypto\box_keypair().
Référencé par SodiumCipher\generateKey().
|
static |
Combine two keys into a keypair for use in library methods that expect a keypair. This doesn't necessarily have to be the same person's keys.
string | $secretKey | Secret key |
string | $publicKey | Public key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Crypto32\box_keypair_from_secretkey_and_publickey(), ParagonIE_Sodium_Crypto\box_keypair_from_secretkey_and_publickey(), Sodium\CRYPTO_BOX_PUBLICKEYBYTES, Sodium\CRYPTO_BOX_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
Référencé par SodiumCipher\decrypt(), et SodiumCipher\encrypt().
|
static |
Decrypt a message previously encrypted with crypto_box().
string | $ciphertext | Encrypted message |
string | $nonce | Number to only be used Once; must be 24 bytes |
string | $keypair | Your secret key and the sender's public key |
SodiumException | |
TypeError | -suppress MixedArgument -suppress MixedInferredReturnType -suppress MixedReturnStatement |
-suppress InvalidReturnStatement -suppress FalsableReturnStatement
Références ParagonIE_Sodium_Crypto32\box_open(), ParagonIE_Sodium_Crypto\box_open(), Sodium\CRYPTO_BOX_KEYPAIRBYTES, Sodium\CRYPTO_BOX_MACBYTES, Sodium\CRYPTO_BOX_NONCEBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
Référencé par SodiumCipher\decrypt().
|
static |
Extract the public key from a crypto_box keypair.
string | $keypair | Keypair containing secret and public key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Crypto32\box_publickey(), ParagonIE_Sodium_Crypto\box_publickey(), Sodium\CRYPTO_BOX_KEYPAIRBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
Référencé par SodiumCipher\generateKey().
|
static |
Calculate the X25519 public key from a given X25519 secret key.
string | $secretKey | Any X25519 secret key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Crypto32\box_publickey_from_secretkey(), ParagonIE_Sodium_Crypto\box_publickey_from_secretkey(), Sodium\CRYPTO_BOX_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Anonymous public-key encryption. Only the recipient may decrypt messages.
Algorithm: X25519-XSalsa20-Poly1305, as with crypto_box. The sender's X25519 keypair is ephemeral. Nonce is generated from the BLAKE2b hash of both public keys.
This provides ciphertext integrity.
string | $plaintext | Message to be sealed |
string | $publicKey | Your recipient's public key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références Sodium\CRYPTO_BOX_PUBLICKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Opens a message encrypted with crypto_box_seal(). Requires the recipient's keypair (sk || pk) to decrypt successfully.
This validates ciphertext integrity.
string | $ciphertext | Sealed message to be opened |
string | $keypair | Your crypto_box keypair |
SodiumException | |
TypeError | -suppress MixedArgument -suppress MixedInferredReturnType -suppress MixedReturnStatement |
-suppress InvalidReturnStatement -suppress FalsableReturnStatement
Références Sodium\CRYPTO_BOX_KEYPAIRBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Extract the secret key from a crypto_box keypair.
string | $keypair |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Crypto32\box_secretkey(), ParagonIE_Sodium_Crypto\box_secretkey(), Sodium\CRYPTO_BOX_KEYPAIRBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
Référencé par SodiumCipher\generateKey().
|
static |
Generate an X25519 keypair from a seed.
string | $seed |
SodiumException | |
TypeError | -suppress MixedArgument -suppress UndefinedFunction |
Références ParagonIE_Sodium_Crypto32\box_seed_keypair(), ParagonIE_Sodium_Crypto\box_seed_keypair(), et ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
Calculates a BLAKE2b hash, with an optional key.
string | $message | The message to be hashed |
string | null | $key | If specified, must be a string between 16 and 64 bytes long |
int | $length | Output length in bytes; must be between 16 and 64 (default = 32) |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, $message, Sodium\CRYPTO_GENERICHASH_KEYBYTES_MAX, Sodium\CRYPTO_GENERICHASH_KEYBYTES_MIN, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
Référencé par ParagonIE_Sodium_Crypto\keyExchange().
|
static |
Get the final BLAKE2b hash output for a given context.
string | $ctx | BLAKE2 hashing context. Generated by crypto_generichash_init(). |
int | $length | Hash output size. |
SodiumException | |
TypeError | -suppress MixedArgument -suppress ReferenceConstraintViolation -suppress ConflictingReferenceConstraint |
Références ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
Initialize a BLAKE2b hashing context, for use in a streaming interface.
string | null | $key | If specified must be a string between 16 and 64 bytes |
int | $length | The size of the desired hash output |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_GENERICHASH_KEYBYTES_MAX, Sodium\CRYPTO_GENERICHASH_KEYBYTES_MIN, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Initialize a BLAKE2b hashing context, for use in a streaming interface.
string | null | $key | If specified must be a string between 16 and 64 bytes |
int | $length | The size of the desired hash output |
string | $salt | Salt (up to 16 bytes) |
string | $personal | Personalization string (up to 16 bytes) |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_GENERICHASH_KEYBYTES_MAX, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
|
static |
Update a BLAKE2b hashing context with additional data.
string | $ctx | BLAKE2 hashing context. Generated by crypto_generichash_init(). $ctx is passed by reference and gets updated in-place. |
-out | string $ctx | |
string | $message | The message to append to the existing hash state. |
SodiumException | |
TypeError | -suppress MixedArgument -suppress ReferenceConstraintViolation |
Références $message, et ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
int | $subkey_len | |
int | $subkey_id | |
string | $context | |
string | $key |
SodiumException |
Références $context, $key, $state, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Exception | |
Error |
|
static |
Perform a key exchange, between a designated client and a server.
Typically, you would designate one machine to be the client and the other to be the server. The first two keys are what you'd expect for scalarmult() below, but the latter two public keys don't swap places.
| ALICE | BOB |
Client | Server |
---|---|
shared = crypto_kx( | shared = crypto_kx( |
| alice_sk, | bob_sk, | <- contextual | bob_pk, | alice_pk, | <- contextual | alice_pk, | alice_pk, | <--— static | bob_pk | bob_pk | <--— static | ) | ) |
They are used along with the scalarmult product to generate a 256-bit BLAKE2b hash unique to the client and server keys.
string | $my_secret | |
string | $their_public | |
string | $client_public | |
string | $server_public | |
bool | $dontFallback |
SodiumException | |
TypeError | -suppress MixedArgument |
Références Sodium\CRYPTO_BOX_PUBLICKEYBYTES, Sodium\CRYPTO_BOX_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Crypto32\keyExchange(), ParagonIE_Sodium_Crypto\keyExchange(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
string | $keypair | |
string | $serverPublicKey |
SodiumException |
Références Sodium\CRYPTO_KX_PUBLICKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), null, ParagonIE_Sodium_Core_Util\strlen(), et ParagonIE_Sodium_Core_Util\substr().
|
static |
|
static |
string | $kp |
SodiumException |
Références Sodium\CRYPTO_KX_PUBLICKEYBYTES, Sodium\CRYPTO_KX_SECRETKEYBYTES, et ParagonIE_Sodium_Core_Util\substr().
|
static |
string | $kp |
SodiumException |
Références Sodium\CRYPTO_KX_SECRETKEYBYTES, et ParagonIE_Sodium_Core_Util\substr().
|
static |
string | $seed |
SodiumException |
Références Sodium\CRYPTO_KX_SECRETKEYBYTES, Sodium\CRYPTO_KX_SEEDBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
string | $keypair | |
string | $clientPublicKey |
SodiumException |
Références Sodium\CRYPTO_KX_PUBLICKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), null, ParagonIE_Sodium_Core_Util\strlen(), et ParagonIE_Sodium_Core_Util\substr().
|
static |
int | $outlen | |
string | $passwd | |
string | $salt | |
int | $opslimit | |
int | $memlimit | |
int | null | $alg |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
!Exclusive to sodium_compat!
This returns TRUE if the native crypto_pwhash API is available by libsodium. This returns FALSE if only sodium_compat is available.
|
static |
int | $outlen | |
string | $passwd | |
string | $salt | |
int | $opslimit | |
int | $memlimit |
SodiumException | |
TypeError |
Références ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
!Exclusive to sodium_compat!
This returns TRUE if the native crypto_pwhash API is available by libsodium. This returns FALSE if only sodium_compat is available.
|
static |
string | $passwd | |
int | $opslimit | |
int | $memlimit |
SodiumException | |
TypeError |
Références ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
string | $passwd | |
string | $hash |
SodiumException | |
TypeError |
Références $hash, et ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
string | $passwd | |
int | $opslimit | |
int | $memlimit |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
string | $passwd | |
string | $hash |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $hash, et ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
Calculate the shared secret between your secret key and your recipient's public key.
Algorithm: X25519 (ECDH over Curve25519)
string | $secretKey | |
string | $publicKey |
SodiumException | |
TypeError | -suppress MixedArgument |
Références Sodium\CRYPTO_BOX_PUBLICKEYBYTES, Sodium\CRYPTO_BOX_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Crypto32\scalarmult(), ParagonIE_Sodium_Crypto\scalarmult(), et ParagonIE_Sodium_Core_Util\strlen().
Référencé par ParagonIE_Sodium_Crypto\keyExchange().
|
static |
Calculate an X25519 public key from an X25519 secret key.
string | $secretKey |
SodiumException | |
TypeError | -suppress TooFewArguments -suppress MixedArgument |
Références Sodium\CRYPTO_BOX_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Crypto32\scalarmult_base(), ParagonIE_Sodium_Crypto\scalarmult_base(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Authenticated symmetric-key encryption.
Algorithm: XSalsa20-Poly1305
string | $plaintext | The message you're encrypting |
string | $nonce | A Number to be used Once; must be 24 bytes |
string | $key | Symmetric encryption key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_SECRETBOX_KEYBYTES, Sodium\CRYPTO_SECRETBOX_NONCEBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Return a secure random key for use with crypto_secretbox
Exception | |
Error |
Références Sodium\CRYPTO_SECRETBOX_KEYBYTES.
|
static |
Decrypts a message previously encrypted with crypto_secretbox().
string | $ciphertext | Ciphertext with Poly1305 MAC |
string | $nonce | A Number to be used Once; must be 24 bytes |
string | $key | Symmetric encryption key |
SodiumException | |
TypeError | -suppress MixedArgument -suppress MixedInferredReturnType -suppress MixedReturnStatement |
-suppress InvalidReturnStatement -suppress FalsableReturnStatement
Références $key, Sodium\CRYPTO_SECRETBOX_KEYBYTES, Sodium\CRYPTO_SECRETBOX_NONCEBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Authenticated symmetric-key encryption.
Algorithm: XChaCha20-Poly1305
string | $plaintext | The message you're encrypting |
string | $nonce | A Number to be used Once; must be 24 bytes |
string | $key | Symmetric encryption key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_SECRETBOX_KEYBYTES, Sodium\CRYPTO_SECRETBOX_NONCEBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Decrypts a message previously encrypted with crypto_secretbox_xchacha20poly1305().
string | $ciphertext | Ciphertext with Poly1305 MAC |
string | $nonce | A Number to be used Once; must be 24 bytes |
string | $key | Symmetric encryption key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_SECRETBOX_KEYBYTES, Sodium\CRYPTO_SECRETBOX_NONCEBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
string | $header | |
string | $key |
Exception |
Références $key, ParagonIE_Sodium_Crypto32\secretstream_xchacha20poly1305_init_pull(), ParagonIE_Sodium_Crypto\secretstream_xchacha20poly1305_init_pull(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
string | $key |
Exception | |
SodiumException |
Références $key, ParagonIE_Sodium_Crypto32\secretstream_xchacha20poly1305_init_push(), et ParagonIE_Sodium_Crypto\secretstream_xchacha20poly1305_init_push().
|
static |
Exception |
|
static |
string | $state | |
string | $msg | |
string | $aad |
SodiumException |
Références $state.
|
static |
string | $state | |
string | $msg | |
string | $aad | |
int | $tag |
SodiumException |
Références $state.
|
static |
string | $state |
SodiumException |
Références $state, ParagonIE_Sodium_Crypto32\secretstream_xchacha20poly1305_rekey(), et ParagonIE_Sodium_Crypto\secretstream_xchacha20poly1305_rekey().
|
static |
Calculates a SipHash-2-4 hash of a message for a given key.
string | $message | Input message |
string | $key | SipHash-2-4 key |
SodiumException | |
TypeError | -suppress MixedArgument -suppress MixedInferredReturnType -suppress MixedReturnStatement |
Références $key, $message, Sodium\CRYPTO_SHORTHASH_KEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core32_SipHash\sipHash24(), ParagonIE_Sodium_Core_SipHash\sipHash24(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Return a secure random key for use with crypto_shorthash
Exception | |
Error |
Références Sodium\CRYPTO_SHORTHASH_KEYBYTES.
|
static |
Returns a signed message. You probably want crypto_sign_detached() instead, which only returns the signature.
Algorithm: Ed25519 (EdDSA over Curve25519)
string | $message | Message to be signed. |
string | $secretKey | Secret signing key. |
SodiumException | |
TypeError | -suppress MixedArgument -suppress MixedInferredReturnType -suppress MixedReturnStatement |
Références $message, Sodium\CRYPTO_SIGN_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Crypto32\sign(), ParagonIE_Sodium_Crypto\sign(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Calculate the Ed25519 signature of a message and return ONLY the signature.
Algorithm: Ed25519 (EdDSA over Curve25519)
string | $message | Message to be signed |
string | $secretKey | Secret signing key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $message, Sodium\CRYPTO_SIGN_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Crypto32\sign_detached(), ParagonIE_Sodium_Crypto\sign_detached(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Convert an Ed25519 public key to a Curve25519 public key
string | $pk |
SodiumException | |
TypeError | -suppress MixedArgument |
Références Sodium\CRYPTO_SIGN_PUBLICKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core32_Ed25519\pk_to_curve25519(), ParagonIE_Sodium_Core_Ed25519\pk_to_curve25519(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Convert an Ed25519 secret key to a Curve25519 secret key
string | $sk |
SodiumException | |
TypeError | -suppress MixedArgument |
Références Sodium\CRYPTO_SIGN_SEEDBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core_Util\intToChr(), ParagonIE_Sodium_Core_Util\strlen(), et ParagonIE_Sodium_Core_Util\substr().
|
static |
Generate a new random Ed25519 keypair.
SodiumException | |
TypeError |
Références ParagonIE_Sodium_Core32_Ed25519\keypair(), et ParagonIE_Sodium_Core_Ed25519\keypair().
|
static |
string | $sk | |
string | $pk |
SodiumException |
Références Sodium\CRYPTO_SIGN_PUBLICKEYBYTES, Sodium\CRYPTO_SIGN_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Validates a signed message then returns the message.
string | $signedMessage | A signed message |
string | $publicKey | A public key |
SodiumException | |
TypeError | -suppress MixedArgument -suppress MixedInferredReturnType -suppress MixedReturnStatement |
-suppress InvalidReturnStatement -suppress FalsableReturnStatement
Références Sodium\CRYPTO_SIGN_BYTES, Sodium\CRYPTO_SIGN_PUBLICKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Crypto32\sign_open(), ParagonIE_Sodium_Crypto\sign_open(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Extract an Ed25519 public key from an Ed25519 keypair.
string | $keypair | Keypair |
SodiumException | |
TypeError | -suppress MixedArgument |
Références Sodium\CRYPTO_SIGN_KEYPAIRBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core32_Ed25519\publickey(), ParagonIE_Sodium_Core_Ed25519\publickey(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Calculate an Ed25519 public key from an Ed25519 secret key.
string | $secretKey | Your Ed25519 secret key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références Sodium\CRYPTO_SIGN_SECRETKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Extract an Ed25519 secret key from an Ed25519 keypair.
string | $keypair | Keypair |
SodiumException | |
TypeError | -suppress MixedArgument |
Références Sodium\CRYPTO_SIGN_KEYPAIRBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core32_Ed25519\secretkey(), ParagonIE_Sodium_Core_Ed25519\secretkey(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Generate an Ed25519 keypair from a seed.
string | $seed | Input seed |
SodiumException | |
TypeError | -suppress MixedArgument |
Références ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
Verify the Ed25519 signature of a message.
string | $signature | Digital sginature |
string | $message | Message to be verified |
string | $publicKey | Public key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $message, Sodium\CRYPTO_SIGN_BYTES, Sodium\CRYPTO_SIGN_PUBLICKEYBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Crypto32\sign_verify_detached(), ParagonIE_Sodium_Crypto\sign_verify_detached(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Expand a key and nonce into a keystream of pseudorandom bytes.
int | $len | Number of bytes desired |
string | $nonce | Number to be used Once; must be 24 bytes |
string | $key | XSalsa20 key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, Sodium\CRYPTO_STREAM_KEYBYTES, Sodium\CRYPTO_STREAM_NONCEBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core_Util\strlen(), ParagonIE_Sodium_Core32_XSalsa20\xsalsa20(), et ParagonIE_Sodium_Core_XSalsa20\xsalsa20().
|
static |
Return a secure random key for use with crypto_stream
Exception | |
Error |
Références Sodium\CRYPTO_STREAM_KEYBYTES.
|
static |
Expand a key and nonce into a keystream of pseudorandom bytes.
int | $len | Number of bytes desired |
string | $nonce | Number to be used Once; must be 24 bytes |
string | $key | XChaCha20 key |
bool | $dontFallback |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core32_XChaCha20\stream(), ParagonIE_Sodium_Core_XChaCha20\stream(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
Return a secure random key for use with crypto_stream_xchacha20
Exception | |
Error |
|
static |
DANGER! UNAUTHENTICATED ENCRYPTION!
Unless you are following expert advice, do not use this feature.
Algorithm: XChaCha20
This DOES NOT provide ciphertext integrity.
string | $message | Plaintext message |
string | $nonce | Number to be used Once; must be 24 bytes |
string | $key | Encryption key |
bool | $dontFallback |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, $message, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core32_XChaCha20\streamXorIc(), ParagonIE_Sodium_Core_XChaCha20\streamXorIc(), et ParagonIE_Sodium_Core_Util\strlen().
|
static |
DANGER! UNAUTHENTICATED ENCRYPTION!
Unless you are following expert advice, do not use this feature.
Algorithm: XSalsa20
This DOES NOT provide ciphertext integrity.
string | $message | Plaintext message |
string | $nonce | Number to be used Once; must be 24 bytes |
string | $key | Encryption key |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $key, $message, Sodium\CRYPTO_STREAM_KEYBYTES, Sodium\CRYPTO_STREAM_NONCEBYTES, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core_Util\strlen(), ParagonIE_Sodium_Core32_XSalsa20\xsalsa20_xor(), et ParagonIE_Sodium_Core_XSalsa20\xsalsa20_xor().
|
static |
Cache-timing-safe implementation of hex2bin().
string | $string | Hexadecimal string |
SodiumException | |
TypeError | -suppress TooFewArguments -suppress MixedArgument |
Références ParagonIE_Sodium_Core_Util\declareScalarType().
|
static |
Increase a string (little endian)
string | $var |
SodiumException | |
TypeError | -suppress MixedArgument |
Références $i, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core_Util\intToChr(), ParagonIE_Sodium_Core_Util\strlen(), et ParagonIE_Sodium_Core_Util\substr().
|
static |
string | $str |
SodiumException |
Références $i.
Référencé par ParagonIE_Sodium_Core_Ed25519\scalar_random(), ParagonIE_Sodium_Core_Ristretto255\scalarmult_ristretto255(), et ParagonIE_Sodium_Core_Ristretto255\scalarmult_ristretto255_base().
|
static |
The equivalent to the libsodium minor version we aim to be compatible with (sans pwhash and memzero).
-suppress UndefinedFunction
Références SODIUM_LIBRARY_MAJOR_VERSION.
|
static |
The equivalent to the libsodium minor version we aim to be compatible with (sans pwhash and memzero).
-suppress UndefinedFunction
Références SODIUM_LIBRARY_MINOR_VERSION.
|
static |
It's actually not possible to zero memory buffers in PHP. You need the native library for that.
string | null | $var | |
-out | string|null $var |
SodiumException | (Unless libsodium is installed) |
TypeError | -suppress TooFewArguments |
-suppress MixedArgument
Références ParagonIE_Sodium_Core_Util\declareScalarType(), et null.
Référencé par ParagonIE_Sodium_Core_Salsa20\salsa20(), ParagonIE_Sodium_Core32_Salsa20\salsa20(), ParagonIE_Sodium_Core_Salsa20\salsa20_xor_ic(), ParagonIE_Sodium_Core32_Salsa20\salsa20_xor_ic(), ParagonIE_Sodium_Core_Ed25519\sign_detached(), et ParagonIE_Sodium_Core32_Ed25519\sign_detached().
|
static |
Will sodium_compat run fast on the current hardware and PHP configuration?
|
static |
Generate a random 16-bit integer.
Exception | |
Error | |
TypeError |
|
static |
Generate an integer between 0 and $range (non-inclusive).
int | $range |
Exception | |
Error | |
TypeError |
Références $range.
|
static |
string | $p | |
string | $q | |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_add().
|
static |
string | $r | |
bool | $dontFallback |
SodiumException |
Références $r, et ParagonIE_Sodium_Core_Ristretto255\ristretto255_from_hash().
|
static |
string | $p | |
bool | $dontFallback |
SodiumException |
Références $r, ParagonIE_Sodium_Core_Ristretto255\ristretto255_frombytes(), et ParagonIE_Sodium_Core_Ristretto255\ristretto255_point_is_canonical().
|
static |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_random().
|
static |
string | $x | |
string | $y | |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_scalar_add().
|
static |
string | $s | |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_scalar_complement().
|
static |
string | $s | |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_scalar_invert().
|
static |
string | $x | |
string | $y | |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_scalar_mul().
|
static |
string | $s | |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_scalar_negate().
|
static |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_scalar_random().
|
static |
string | $s | |
bool | $dontFallback |
SodiumException |
|
static |
string | $x | |
string | $y | |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_scalar_sub().
|
static |
string | $p | |
string | $q | |
bool | $dontFallback |
SodiumException |
Références ParagonIE_Sodium_Core_Ristretto255\ristretto255_sub().
|
static |
string | $n | |
string | $p | |
bool | $dontFallback |
SodiumException |
Références $n, et ParagonIE_Sodium_Core_Ristretto255\scalarmult_ristretto255().
|
static |
string | $n | |
string | $p | |
bool | $dontFallback |
SodiumException |
Références $n, et ParagonIE_Sodium_Core_Ristretto255\scalarmult_ristretto255_base().
|
static |
Add two numbers (little-endian unsigned), storing the value in the first parameter.
This mutates $val.
string | $val | |
string | $addv |
SodiumException |
Références $i, et ParagonIE_Sodium_Core_Util\strlen().
Référencé par ParagonIE_Sodium_Core_Ed25519\scalar_complement(), et ParagonIE_Sodium_Core_Ed25519\scalar_negate().
|
static |
string | $padded | |
int | $blockSize | |
bool | $dontFallback |
SodiumException |
Références $i, ParagonIE_Sodium_Core_Util\declareScalarType(), ParagonIE_Sodium_Core_Util\strlen(), et ParagonIE_Sodium_Core_Util\substr().
|
staticprotected |
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.)
If ext/libsodium is available, use it. Return TRUE. Otherwise, we have to use the code provided herein. Return FALSE.
string | $sodium_func_name |
Références null.
|
staticprotected |
Libsodium as implemented in PHP 7.2 and/or ext/sodium (via PECL)
https://wiki.php.net/rfc/libsodium
Références null.
|
static |
This emulates libsodium's version_string() function, except ours is prefixed with 'polyfill-'.
|
static |
|
static |
const BASE64_VARIANT_ORIGINAL = 1 |
const BASE64_VARIANT_ORIGINAL_NO_PADDING = 3 |
const BASE64_VARIANT_URLSAFE = 5 |
const BASE64_VARIANT_URLSAFE_NO_PADDING = 7 |
const CRYPTO_AEAD_AES256GCM_ABYTES = 16 |
const CRYPTO_AEAD_AES256GCM_KEYBYTES = 32 |
const CRYPTO_AEAD_AES256GCM_NPUBBYTES = 12 |
const CRYPTO_AEAD_AES256GCM_NSECBYTES = 0 |
const CRYPTO_AEAD_CHACHA20POLY1305_ABYTES = 16 |
const CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES = 16 |
const CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES = 32 |
const CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES = 12 |
const CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES = 0 |
const CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = 32 |
const CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES = 8 |
const CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = 0 |
const CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES = 16 |
const CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES = 32 |
const CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES = 24 |
const CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES = 0 |
const CRYPTO_AUTH_BYTES = 32 |
const CRYPTO_AUTH_KEYBYTES = 32 |
const CRYPTO_BOX_KEYPAIRBYTES = 64 |
Référencé par ParagonIE_Sodium_Crypto32\box_publickey(), et ParagonIE_Sodium_Crypto\box_publickey().
const CRYPTO_BOX_MACBYTES = 16 |
const CRYPTO_BOX_NONCEBYTES = 24 |
const CRYPTO_BOX_PUBLICKEYBYTES = 32 |
const CRYPTO_BOX_SEALBYTES = 16 |
const CRYPTO_BOX_SECRETKEYBYTES = 32 |
const CRYPTO_BOX_SEEDBYTES = 32 |
const CRYPTO_CORE_RISTRETTO255_BYTES = 32 |
const CRYPTO_CORE_RISTRETTO255_HASHBYTES = 64 |
const CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES = 64 |
const CRYPTO_CORE_RISTRETTO255_SCALARBYTES = 32 |
const CRYPTO_GENERICHASH_BYTES = 32 |
const CRYPTO_GENERICHASH_BYTES_MAX = 64 |
const CRYPTO_GENERICHASH_BYTES_MIN = 16 |
const CRYPTO_GENERICHASH_KEYBYTES = 32 |
const CRYPTO_GENERICHASH_KEYBYTES_MAX = 64 |
const CRYPTO_GENERICHASH_KEYBYTES_MIN = 16 |
const CRYPTO_KDF_BYTES_MAX = 64 |
const CRYPTO_KDF_BYTES_MIN = 16 |
const CRYPTO_KDF_CONTEXTBYTES = 8 |
const CRYPTO_KDF_KEYBYTES = 32 |
const CRYPTO_KX_BYTES = 32 |
const CRYPTO_KX_KEYPAIRBYTES = 64 |
const CRYPTO_KX_PRIMITIVE = 'x25519blake2b' |
const CRYPTO_KX_PUBLICKEYBYTES = 32 |
const CRYPTO_KX_SECRETKEYBYTES = 32 |
const CRYPTO_KX_SEEDBYTES = 32 |
const CRYPTO_KX_SESSIONKEYBYTES = 32 |
const CRYPTO_PWHASH_ALG_ARGON2I13 = 1 |
const CRYPTO_PWHASH_ALG_ARGON2ID13 = 2 |
const CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE = 33554432 |
const CRYPTO_PWHASH_MEMLIMIT_MODERATE = 134217728 |
const CRYPTO_PWHASH_MEMLIMIT_SENSITIVE = 536870912 |
const CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE = 4 |
const CRYPTO_PWHASH_OPSLIMIT_MODERATE = 6 |
const CRYPTO_PWHASH_OPSLIMIT_SENSITIVE = 8 |
const CRYPTO_PWHASH_SALTBYTES = 16 |
const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE = 16777216 |
const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE = 1073741824 |
const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE = 534288 |
const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE = 33554432 |
const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES = 32 |
const CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX = '$7$' |
const CRYPTO_PWHASH_STRPREFIX = '$argon2id$' |
const CRYPTO_SCALARMULT_BYTES = 32 |
const CRYPTO_SCALARMULT_RISTRETTO255_BYTES = 32 |
const CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES = 32 |
const CRYPTO_SCALARMULT_SCALARBYTES = 32 |
const CRYPTO_SECRETBOX_KEYBYTES = 32 |
const CRYPTO_SECRETBOX_MACBYTES = 16 |
const CRYPTO_SECRETBOX_NONCEBYTES = 24 |
const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES = 17 |
const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES = 24 |
const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES = 32 |
const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX = 0x3fffffff80 |
const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL = 3 |
const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL = 1 |
const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH = 0 |
const CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY = 2 |
const CRYPTO_SHORTHASH_BYTES = 8 |
const CRYPTO_SHORTHASH_KEYBYTES = 16 |
const CRYPTO_SIGN_BYTES = 64 |
const CRYPTO_SIGN_KEYPAIRBYTES = 96 |
const CRYPTO_SIGN_PUBLICKEYBYTES = 32 |
const CRYPTO_SIGN_SECRETKEYBYTES = 64 |
const CRYPTO_SIGN_SEEDBYTES = 32 |
const CRYPTO_STREAM_KEYBYTES = 32 |
const CRYPTO_STREAM_NONCEBYTES = 24 |
const CRYPTO_STREAM_XCHACHA20_KEYBYTES = 32 |
const CRYPTO_STREAM_XCHACHA20_NONCEBYTES = 24 |
const LIBRARY_MAJOR_VERSION = 9 |
const LIBRARY_MINOR_VERSION = 1 |
const LIBRARY_VERSION_MAJOR = 9 |
const LIBRARY_VERSION_MINOR = 1 |
const VERSION_STRING = 'polyfill-1.0.8' |