package | Default |
---|
add(string &$val,string $addv): void
This mutates $val.
Throws |
|
---|
string
string
base642bin(string $encoded,integer $variant,string $ignore = ''): string
Throws |
|
---|
string
integer
string
string
bin2base64(string $decoded,integer $variant): string
Throws |
|
---|
string
integer
string
bin2hex(string $string): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
A string (probably raw binary)
string
A hexadecimal-encoded string
compare(string $left,string $right): integer
Compared to memcmp(), compare() is more useful for sorting.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
The left operand; must be a string
string
The right operand; must be a string
integer
If < 0 if the left operand is less than the right If = 0 if both strings are equal If > 0 if the right operand is less than the left
crypto_aead_aes256gcm_decrypt(string $ciphertext = '',string $assocData = '',string $nonce = '',string $key = ''): string|boolean
Algorithm: AES-256-GCM
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.
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
Encrypted message (with Poly1305 MAC appended)
string
Authenticated Associated Data (unencrypted)
string
Number to be used only Once; must be 8 bytes
string
Encryption key
string|boolean
The original plaintext message
crypto_aead_aes256gcm_encrypt(string $plaintext = '',string $assocData = '',string $nonce = '',string $key = ''): string
Algorithm: AES-256-GCM
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Message to be encrypted
string
Authenticated Associated Data (unencrypted)
string
Number to be used only Once; must be 8 bytes
string
Encryption key
string
Ciphertext with a 16-byte GCM message authentication code appended
crypto_aead_aes256gcm_is_available(): boolean
psalm-suppress | UndefinedFunction MixedInferredReturnType MixedReturnStatement |
---|---|
boolean
crypto_aead_aes256gcm_keygen(): string
Throws |
|
---|
string
crypto_aead_chacha20poly1305_decrypt(string $ciphertext = '',string $assocData = '',string $nonce = '',string $key = ''): string
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.
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
Encrypted message (with Poly1305 MAC appended)
string
Authenticated Associated Data (unencrypted)
string
Number to be used only Once; must be 8 bytes
string
Encryption key
string
The original plaintext message
crypto_aead_chacha20poly1305_encrypt(string $plaintext = '',string $assocData = '',string $nonce = '',string $key = ''): string
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.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Message to be encrypted
string
Authenticated Associated Data (unencrypted)
string
Number to be used only Once; must be 8 bytes
string
Encryption key
string
Ciphertext with a 16-byte Poly1305 message authentication code appended
crypto_aead_chacha20poly1305_ietf_decrypt(string $ciphertext = '',string $assocData = '',string $nonce = '',string $key = ''): string
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.
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
Encrypted message (with Poly1305 MAC appended)
string
Authenticated Associated Data (unencrypted)
string
Number to be used only Once; must be 12 bytes
string
Encryption key
string
The original plaintext message
crypto_aead_chacha20poly1305_ietf_encrypt(string $plaintext = '',string $assocData = '',string $nonce = '',string $key = ''): string
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.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Message to be encrypted
string
Authenticated Associated Data (unencrypted)
string
Number to be used only Once; must be 8 bytes
string
Encryption key
string
Ciphertext with a 16-byte Poly1305 message authentication code appended
crypto_aead_chacha20poly1305_ietf_keygen(): string
Throws |
|
---|
string
crypto_aead_chacha20poly1305_keygen(): string
Throws |
|
---|
string
crypto_aead_xchacha20poly1305_ietf_decrypt(string $ciphertext = '',string $assocData = '',string $nonce = '',string $key = '',boolean $dontFallback = false): string|boolean
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.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Encrypted message (with Poly1305 MAC appended)
string
Authenticated Associated Data (unencrypted)
string
Number to be used only Once; must be 8 bytes
string
Encryption key
boolean
Don't fallback to ext/sodium
string|boolean
The original plaintext message
crypto_aead_xchacha20poly1305_ietf_encrypt(string $plaintext = '',string $assocData = '',string $nonce = '',string $key = '',boolean $dontFallback = false): string
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.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Message to be encrypted
string
Authenticated Associated Data (unencrypted)
string
Number to be used only Once; must be 8 bytes
string
Encryption key
boolean
Don't fallback to ext/sodium
string
Ciphertext with a 16-byte Poly1305 message authentication code appended
crypto_aead_xchacha20poly1305_ietf_keygen(): string
Throws |
|
---|
string
crypto_auth(string $message,string $key): string
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).
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Message to be authenticated
string
Symmetric authentication key
string
Message authentication code
crypto_auth_keygen(): string
Throws |
|
---|
string
crypto_auth_verify(string $mac,string $message,string $key): boolean
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Message authentication code
string
Message whose authenticity you are attempting to verify (with a given MAC and key)
string
Symmetric authentication key
boolean
TRUE if authenticated, FALSE otherwise
crypto_box(string $plaintext,string $nonce,string $keypair): string
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.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
The message to be encrypted
string
A Number to only be used Once; must be 24 bytes
string
Your secret key and your recipient's public key
string
Ciphertext with 16-byte Poly1305 MAC
crypto_box_keypair(): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
A 64-byte string; the first 32 are your secret key, while the last 32 are your public key. crypto_box_secretkey() and crypto_box_publickey() exist to separate them so you don't accidentally get them mixed up!
crypto_box_keypair_from_secretkey_and_publickey(string $secretKey,string $publicKey): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Secret key
string
Public key
string
Keypair
crypto_box_open(string $ciphertext,string $nonce,string $keypair): string
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
Encrypted message
string
Number to only be used Once; must be 24 bytes
string
Your secret key and the sender's public key
string
The original plaintext message
crypto_box_publickey(string $keypair): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Keypair containing secret and public key
string
Your crypto_box public key
crypto_box_publickey_from_secretkey(string $secretKey): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Any X25519 secret key
string
The corresponding X25519 public key
crypto_box_seal(string $plaintext,string $publicKey): string
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.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Message to be sealed
string
Your recipient's public key
string
Sealed message that only your recipient can decrypt
crypto_box_seal_open(string $ciphertext,string $keypair): string
This validates ciphertext integrity.
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
Sealed message to be opened
string
Your crypto_box keypair
string
The original plaintext message
crypto_box_secretkey(string $keypair): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
string
Your crypto_box secret key
crypto_box_seed_keypair(string $seed): string
psalm-suppress | MixedArgument UndefinedFunction |
---|---|
Throws |
|
string
string
crypto_generichash(string $message,string|null $key = '',integer $length = self::CRYPTO_GENERICHASH_BYTES): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
The message to be hashed
string|null
If specified, must be a string between 16 and 64 bytes long
integer
Output length in bytes; must be between 16 and 64 (default = 32)
string
Raw binary
crypto_generichash_final(string &$ctx,integer $length = self::CRYPTO_GENERICHASH_BYTES): string
psalm-suppress | MixedArgument ReferenceConstraintViolation ConflictingReferenceConstraint |
---|---|
Throws |
|
string
BLAKE2 hashing context. Generated by crypto_generichash_init().
integer
Hash output size.
string
Final BLAKE2b hash.
crypto_generichash_init(string|null $key = '',integer $length = self::CRYPTO_GENERICHASH_BYTES): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string|null
If specified must be a string between 16 and 64 bytes
integer
The size of the desired hash output
string
A BLAKE2 hashing context, encoded as a string (To be 100% compatible with ext/libsodium)
crypto_generichash_init_salt_personal(string|null $key = '',integer $length = self::CRYPTO_GENERICHASH_BYTES,string $salt = '',string $personal = ''): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string|null
If specified must be a string between 16 and 64 bytes
integer
The size of the desired hash output
string
Salt (up to 16 bytes)
string
Personalization string (up to 16 bytes)
string
A BLAKE2 hashing context, encoded as a string (To be 100% compatible with ext/libsodium)
crypto_generichash_keygen(): string
Throws |
|
---|
string
crypto_generichash_update(string &$ctx,string $message): void
param-out | string $ctx |
---|---|
psalm-suppress | MixedArgument ReferenceConstraintViolation |
Throws |
|
string
BLAKE2 hashing context. Generated by crypto_generichash_init(). $ctx is passed by reference and gets updated in-place.
string
The message to append to the existing hash state.
crypto_kdf_derive_from_key(integer $subkey_len,integer $subkey_id,string $context,string $key): string
Throws |
|
---|
integer
integer
string
string
string
crypto_kdf_keygen(): string
Throws |
|
---|
string
crypto_kx(string $my_secret,string $their_public,string $client_public,string $server_public,boolean $dontFallback = false): string
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.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
string
string
string
boolean
string
crypto_kx_client_session_keys(string $keypair,string $serverPublicKey): \array{0:
Throws |
|
---|
string
string
\array{0:
string, 1: string}
crypto_kx_keypair(): string
Throws |
|
---|
string
crypto_kx_publickey(string $kp): string
Throws |
|
---|
string
string
crypto_kx_secretkey(string $kp): string
Throws |
|
---|
string
string
crypto_kx_seed_keypair(string $seed): string
Throws |
|
---|
string
string
crypto_kx_server_session_keys(string $keypair,string $clientPublicKey): \array{0:
Throws |
|
---|
string
string
\array{0:
string, 1: string}
crypto_pwhash(integer $outlen,string $passwd,string $salt,integer $opslimit,integer $memlimit,integer|null $alg = null): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
integer
string
string
integer
integer
integer|null
string
crypto_pwhash_is_available(): boolean
This returns TRUE if the native crypto_pwhash API is available by libsodium. This returns FALSE if only sodium_compat is available.
boolean
crypto_pwhash_scryptsalsa208sha256(integer $outlen,string $passwd,string $salt,integer $opslimit,integer $memlimit): string
Throws |
|
---|
integer
string
string
integer
integer
string
crypto_pwhash_scryptsalsa208sha256_is_available(): boolean
This returns TRUE if the native crypto_pwhash API is available by libsodium. This returns FALSE if only sodium_compat is available.
boolean
crypto_pwhash_scryptsalsa208sha256_str(string $passwd,integer $opslimit,integer $memlimit): string
Throws |
|
---|
string
integer
integer
string
crypto_pwhash_scryptsalsa208sha256_str_verify(string $passwd,string $hash): boolean
Throws |
|
---|
string
string
boolean
crypto_pwhash_str(string $passwd,integer $opslimit,integer $memlimit): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
integer
integer
string
crypto_pwhash_str_needs_rehash(string $hash,integer $opslimit,integer $memlimit): boolean
Throws |
|
---|
string
integer
integer
boolean
crypto_pwhash_str_verify(string $passwd,string $hash): boolean
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
string
boolean
crypto_scalarmult(string $secretKey,string $publicKey): string
Algorithm: X25519 (ECDH over Curve25519)
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
string
string
crypto_scalarmult_base(string $secretKey): string
psalm-suppress | TooFewArguments MixedArgument |
---|---|
Throws |
|
string
string
crypto_secretbox(string $plaintext,string $nonce,string $key): string
Algorithm: XSalsa20-Poly1305
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
The message you're encrypting
string
A Number to be used Once; must be 24 bytes
string
Symmetric encryption key
string
Ciphertext with Poly1305 MAC
crypto_secretbox_keygen(): string
Throws |
|
---|
string
crypto_secretbox_open(string $ciphertext,string $nonce,string $key): string
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
Ciphertext with Poly1305 MAC
string
A Number to be used Once; must be 24 bytes
string
Symmetric encryption key
string
Original plaintext message
crypto_secretbox_xchacha20poly1305(string $plaintext,string $nonce,string $key): string
Algorithm: XChaCha20-Poly1305
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
The message you're encrypting
string
A Number to be used Once; must be 24 bytes
string
Symmetric encryption key
string
Ciphertext with Poly1305 MAC
crypto_secretbox_xchacha20poly1305_open(string $ciphertext,string $nonce,string $key): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Ciphertext with Poly1305 MAC
string
A Number to be used Once; must be 24 bytes
string
Symmetric encryption key
string
Original plaintext message
crypto_secretstream_xchacha20poly1305_init_pull(string $header,string $key): string
Throws |
|
---|
string
string
string
Returns a state.
crypto_secretstream_xchacha20poly1305_init_push(string $key): \array<int,
Throws |
|
---|
string
\arraystring> Returns a state and a header.
crypto_secretstream_xchacha20poly1305_keygen(): string
Throws |
|
---|
string
crypto_secretstream_xchacha20poly1305_pull(string &$state,string $msg,string $aad = ''): boolean|\array{0:
Throws |
|
---|
string
string
string
boolean|\array{0:
string, 1: int}
crypto_secretstream_xchacha20poly1305_push(string &$state,string $msg,string $aad = '',integer $tag): string
Throws |
|
---|
string
string
string
integer
string
crypto_secretstream_xchacha20poly1305_rekey(string &$state): void
Throws |
|
---|
string
crypto_shorthash(string $message,string $key): string
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
Input message
string
SipHash-2-4 key
string
Hash
crypto_shorthash_keygen(): string
Throws |
|
---|
string
crypto_sign(string $message,string $secretKey): string
Algorithm: Ed25519 (EdDSA over Curve25519)
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
Message to be signed.
string
Secret signing key.
string
Signed message (signature is prefixed).
crypto_sign_detached(string $message,string $secretKey): string
Algorithm: Ed25519 (EdDSA over Curve25519)
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Message to be signed
string
Secret signing key
string
Digital signature
crypto_sign_ed25519_pk_to_curve25519(string $pk): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
string
crypto_sign_ed25519_sk_to_curve25519(string $sk): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
string
crypto_sign_keypair(): string
Throws |
|
---|
string
crypto_sign_keypair_from_secretkey_and_publickey(string $sk,string $pk): string
Throws |
|
---|
string
string
string
crypto_sign_open(string $signedMessage,string $publicKey): string
psalm-suppress | MixedArgument MixedInferredReturnType MixedReturnStatement |
---|---|
Throws |
|
string
A signed message
string
A public key
string
The original message (if the signature is valid for this public key)
crypto_sign_publickey(string $keypair): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Keypair
string
Public key
crypto_sign_publickey_from_secretkey(string $secretKey): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Your Ed25519 secret key
string
The corresponding Ed25519 public key
crypto_sign_secretkey(string $keypair): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Keypair
string
Secret key
crypto_sign_seed_keypair(string $seed): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Input seed
string
Keypair
crypto_sign_verify_detached(string $signature,string $message,string $publicKey): boolean
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Digital sginature
string
Message to be verified
string
Public key
boolean
TRUE if this signature is good for this public key; FALSE otherwise
crypto_stream(integer $len,string $nonce,string $key): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
integer
Number of bytes desired
string
Number to be used Once; must be 24 bytes
string
XSalsa20 key
string
Pseudorandom stream that can be XORed with messages to provide encryption (but not authentication; see Poly1305 or crypto_auth() for that, which is not optional for security)
crypto_stream_keygen(): string
Throws |
|
---|
string
crypto_stream_xchacha20(integer $len,string $nonce,string $key,boolean $dontFallback = false): string
psalm-suppress | MixedArgument |
---|---|
Throws |
|
integer
Number of bytes desired
string
Number to be used Once; must be 24 bytes
string
XChaCha20 key
boolean
string
Pseudorandom stream that can be XORed with messages to provide encryption (but not authentication; see Poly1305 or crypto_auth() for that, which is not optional for security)
crypto_stream_xchacha20_keygen(): string
Throws |
|
---|
string
crypto_stream_xchacha20_xor(string $message,string $nonce,string $key,boolean $dontFallback = false): string
Unless you are following expert advice, do not use this feature.
Algorithm: XChaCha20
This DOES NOT provide ciphertext integrity.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Plaintext message
string
Number to be used Once; must be 24 bytes
string
Encryption key
boolean
string
Encrypted text which is vulnerable to chosen- ciphertext attacks unless you implement some other mitigation to the ciphertext (i.e. Encrypt then MAC)
crypto_stream_xchacha20_xor_ic(string $message,string $nonce,integer $counter,string $key,boolean $dontFallback = false): string
Unless you are following expert advice, do not use this feature.
Algorithm: XChaCha20
This DOES NOT provide ciphertext integrity.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Plaintext message
string
Number to be used Once; must be 24 bytes
integer
string
Encryption key
boolean
string
Encrypted text which is vulnerable to chosen- ciphertext attacks unless you implement some other mitigation to the ciphertext (i.e. Encrypt then MAC)
crypto_stream_xor(string $message,string $nonce,string $key): string
Unless you are following expert advice, do not use this feature.
Algorithm: XSalsa20
This DOES NOT provide ciphertext integrity.
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
Plaintext message
string
Number to be used Once; must be 24 bytes
string
Encryption key
string
Encrypted text which is vulnerable to chosen- ciphertext attacks unless you implement some other mitigation to the ciphertext (i.e. Encrypt then MAC)
hex2bin(string $string,string $ignore = ''): string
psalm-suppress | TooFewArguments MixedArgument |
---|---|
Throws |
|
string
Hexadecimal string
string
List of characters to ignore; useful for whitespace
string
Raw binary string
increment(string &$var): void
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
is_zero(string $str): boolean
Throws |
|
---|
string
boolean
library_version_major(): integer
integer
library_version_minor(): integer
integer
memcmp(string $left,string $right): integer
psalm-suppress | MixedArgument |
---|---|
Throws |
|
string
string
integer
memzero(string|null &$var): void
param-out | string|null $var |
---|---|
psalm-suppress | TooFewArguments |
Throws |
|
string|null
pad(string $unpadded,integer $blockSize,boolean $dontFallback = false): string
Throws |
|
---|
string
integer
boolean
string
polyfill_is_fast(): boolean
boolean
randombytes_buf(integer $numBytes): string
Proudly uses /dev/urandom (if getrandom(2) is not available).
Throws |
|
---|
integer
string
randombytes_random16(): integer
Throws |
|
---|
integer
randombytes_uniform(integer $range): integer
Throws |
|
---|
integer
integer
ristretto255_add(string $p,string $q,boolean $dontFallback = false): string
Throws |
|
---|
string
string
boolean
string
ristretto255_from_hash(string $r,boolean $dontFallback = false): string
Throws |
|
---|
string
boolean
string
ristretto255_is_valid_point(string $p,boolean $dontFallback = false): boolean
Throws |
|
---|
string
boolean
boolean
ristretto255_random(boolean $dontFallback = false): string
Throws |
|
---|
boolean
string
ristretto255_scalar_add(string $x,string $y,boolean $dontFallback = false): string
Throws |
|
---|
string
string
boolean
string
ristretto255_scalar_complement(string $s,boolean $dontFallback = false): string
Throws |
|
---|
string
boolean
string
ristretto255_scalar_invert(string $s,boolean $dontFallback = false): string
Throws |
|
---|
string
boolean
string
ristretto255_scalar_mul(string $x,string $y,boolean $dontFallback = false): string
Throws |
|
---|
string
string
boolean
string
ristretto255_scalar_negate(string $s,boolean $dontFallback = false): string
Throws |
|
---|
string
boolean
string
ristretto255_scalar_random(boolean $dontFallback = false): string
Throws |
|
---|
boolean
string
ristretto255_scalar_reduce(string $s,boolean $dontFallback = false): string
Throws |
|
---|
string
boolean
string
ristretto255_scalar_sub(string $x,string $y,boolean $dontFallback = false): string
Throws |
|
---|
string
string
boolean
string
ristretto255_sub(string $p,string $q,boolean $dontFallback = false): string
Throws |
|
---|
string
string
boolean
string
runtime_speed_test(integer $iterations,integer $maxTimeout): boolean
Usage: If runtime_speed_test() returns FALSE, then our 32-bit implementation is to slow to use safely without risking timeouts. If this happens, install sodium from PECL to get acceptable performance.
Throws |
|
---|
integer
Number of multiplications to attempt
integer
Milliseconds
boolean
TRUE if we're fast enough, FALSE is not
scalarmult_ristretto255(string $n,string $p,boolean $dontFallback = false): string
Throws |
|
---|
string
string
boolean
string
scalarmult_ristretto255_base(string $n,boolean $dontFallback = false): string
Throws |
|
---|
string
boolean
string
sub(string &$val,string $addv): void
This mutates $val.
Throws |
|
---|
string
string
unpad(string $padded,integer $blockSize,boolean $dontFallback = false): string
Throws |
|
---|
string
integer
boolean
string
use_fallback(string $sodium_func_name = ''): boolean
If ext/libsodium is available, use it. Return TRUE. Otherwise, we have to use the code provided herein. Return FALSE.
string
boolean
useNewSodiumAPI(): boolean
version_string(): string
psalm-suppress | MixedInferredReturnType UndefinedFunction |
---|---|
string
LIBRARY_MAJOR_VERSION
LIBRARY_MINOR_VERSION
LIBRARY_VERSION_MAJOR
LIBRARY_VERSION_MINOR
VERSION_STRING
BASE64_VARIANT_ORIGINAL
BASE64_VARIANT_ORIGINAL_NO_PADDING
BASE64_VARIANT_URLSAFE
BASE64_VARIANT_URLSAFE_NO_PADDING
CRYPTO_AEAD_AES256GCM_KEYBYTES
CRYPTO_AEAD_AES256GCM_NSECBYTES
CRYPTO_AEAD_AES256GCM_NPUBBYTES
CRYPTO_AEAD_AES256GCM_ABYTES
CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES
CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES
CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES
CRYPTO_AEAD_CHACHA20POLY1305_ABYTES
CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES
CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES
CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES
CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES
CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES
CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES
CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES
CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES
CRYPTO_AUTH_BYTES
CRYPTO_AUTH_KEYBYTES
CRYPTO_BOX_SEALBYTES
CRYPTO_BOX_SECRETKEYBYTES
CRYPTO_BOX_PUBLICKEYBYTES
CRYPTO_BOX_KEYPAIRBYTES
CRYPTO_BOX_MACBYTES
CRYPTO_BOX_NONCEBYTES
CRYPTO_BOX_SEEDBYTES
CRYPTO_CORE_RISTRETTO255_BYTES
CRYPTO_CORE_RISTRETTO255_SCALARBYTES
CRYPTO_CORE_RISTRETTO255_HASHBYTES
CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES
CRYPTO_KDF_BYTES_MIN
CRYPTO_KDF_BYTES_MAX
CRYPTO_KDF_CONTEXTBYTES
CRYPTO_KDF_KEYBYTES
CRYPTO_KX_BYTES
CRYPTO_KX_PRIMITIVE
CRYPTO_KX_SEEDBYTES
CRYPTO_KX_KEYPAIRBYTES
CRYPTO_KX_PUBLICKEYBYTES
CRYPTO_KX_SECRETKEYBYTES
CRYPTO_KX_SESSIONKEYBYTES
CRYPTO_GENERICHASH_BYTES
CRYPTO_GENERICHASH_BYTES_MIN
CRYPTO_GENERICHASH_BYTES_MAX
CRYPTO_GENERICHASH_KEYBYTES
CRYPTO_GENERICHASH_KEYBYTES_MIN
CRYPTO_GENERICHASH_KEYBYTES_MAX
CRYPTO_PWHASH_SALTBYTES
CRYPTO_PWHASH_STRPREFIX
CRYPTO_PWHASH_ALG_ARGON2I13
CRYPTO_PWHASH_ALG_ARGON2ID13
CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE
CRYPTO_PWHASH_MEMLIMIT_MODERATE
CRYPTO_PWHASH_OPSLIMIT_MODERATE
CRYPTO_PWHASH_MEMLIMIT_SENSITIVE
CRYPTO_PWHASH_OPSLIMIT_SENSITIVE
CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES
CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX
CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE
CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE
CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE
CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE
CRYPTO_SCALARMULT_BYTES
CRYPTO_SCALARMULT_SCALARBYTES
CRYPTO_SCALARMULT_RISTRETTO255_BYTES
CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES
CRYPTO_SHORTHASH_BYTES
CRYPTO_SHORTHASH_KEYBYTES
CRYPTO_SECRETBOX_KEYBYTES
CRYPTO_SECRETBOX_MACBYTES
CRYPTO_SECRETBOX_NONCEBYTES
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL
CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX
CRYPTO_SIGN_BYTES
CRYPTO_SIGN_SEEDBYTES
CRYPTO_SIGN_PUBLICKEYBYTES
CRYPTO_SIGN_SECRETKEYBYTES
CRYPTO_SIGN_KEYPAIRBYTES
CRYPTO_STREAM_KEYBYTES
CRYPTO_STREAM_NONCEBYTES
CRYPTO_STREAM_XCHACHA20_KEYBYTES
CRYPTO_STREAM_XCHACHA20_NONCEBYTES
disableFallbackForUnitTests :boolean
It should only be used for unit testing.
var |
---|
boolean
fastMult :boolean
var |
---|
boolean