[phpstorm-stubs] added missed sodium functions

This commit is contained in:
Ivan Fedorov 2022-07-26 14:00:33 +02:00 committed by Ivan Fedorov
parent 41e4077386
commit 9912bc2aa3
4 changed files with 13 additions and 36 deletions

View File

@ -1543,7 +1543,6 @@ const FUNCTIONS = array (
'Sodium\\randombytes_buf' => 'libsodium/libsodium.php',
'Sodium\\randombytes_random16' => 'libsodium/libsodium.php',
'Sodium\\randombytes_uniform' => 'libsodium/libsodium.php',
'Sodium\\sodium_crypto_stream_xchacha20_xor_ic' => 'libsodium/libsodium.php',
'Sodium\\version_string' => 'libsodium/libsodium.php',
'Zstd\\compress' => 'zstd/zstd.php',
'Zstd\\compress_dict' => 'zstd/zstd.php',
@ -5073,6 +5072,8 @@ const FUNCTIONS = array (
'sodium_crypto_secretstream_xchacha20poly1305_init_pull' => 'sodium/sodium.php',
'sodium_crypto_secretstream_xchacha20poly1305_init_push' => 'sodium/sodium.php',
'sodium_crypto_secretstream_xchacha20poly1305_keygen' => 'sodium/sodium.php',
'sodium_crypto_secretstream_xchacha20poly1305_pull' => 'sodium/sodium.php',
'sodium_crypto_secretstream_xchacha20poly1305_push' => 'sodium/sodium.php',
'sodium_crypto_secretstream_xchacha20poly1305_rekey' => 'sodium/sodium.php',
'sodium_crypto_shorthash' => 'sodium/sodium.php',
'sodium_crypto_shorthash_keygen' => 'sodium/sodium.php',
@ -5093,6 +5094,7 @@ const FUNCTIONS = array (
'sodium_crypto_stream_xchacha20' => 'sodium/sodium.php',
'sodium_crypto_stream_xchacha20_keygen' => 'sodium/sodium.php',
'sodium_crypto_stream_xchacha20_xor' => 'sodium/sodium.php',
'sodium_crypto_stream_xchacha20_xor_ic' => 'sodium/sodium.php',
'sodium_crypto_stream_xor' => 'sodium/sodium.php',
'sodium_hex2bin' => 'sodium/sodium.php',
'sodium_increment' => 'sodium/sodium.php',

View File

@ -787,5 +787,3 @@ function version_string(): string {}
* @return string
*/
function crypto_scalarmult_base(string $sk): string {}
function sodium_crypto_stream_xchacha20_xor_ic(#[\SensitiveParameter] string $message, string $nonce, int $counter, #[\SensitiveParameter] string $key): string {}

View File

@ -150,6 +150,9 @@ function sodium_crypto_stream_xchacha20(int $length, string $nonce, string $key)
#[PhpStormStubsElementAvailable('8.1')]
function sodium_crypto_stream_xchacha20_xor(string $message, string $nonce, string $key): string {}
#[PhpStormStubsElementAvailable('8.2')]
function sodium_crypto_stream_xchacha20_xor_ic(#[\SensitiveParameter] string $message, string $nonce, int $counter, #[\SensitiveParameter] string $key): string {}
#[PhpStormStubsElementAvailable('8.1')]
function sodium_crypto_stream_xchacha20_keygen(): string {}
@ -1129,6 +1132,9 @@ function sodium_crypto_secretstream_xchacha20poly1305_keygen(): string {}
*/
function sodium_crypto_secretstream_xchacha20poly1305_init_push(string $key): array {}
#[PhpStormStubsElementAvailable('8.2')]
function sodium_crypto_secretstream_xchacha20poly1305_push(string &$state, #[\SensitiveParameter] string $message, string $additional_data = "", int $tag = SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE): string {}
/**
* @param string $header
* @param string $key
@ -1139,6 +1145,10 @@ function sodium_crypto_secretstream_xchacha20poly1305_init_push(string $key): ar
*/
function sodium_crypto_secretstream_xchacha20poly1305_init_pull(string $header, string $key): string {}
/** @return array<int, int|string>|false */
#[PhpStormStubsElementAvailable('8.2')]
function sodium_crypto_secretstream_xchacha20poly1305_pull(string &$state, string $ciphertext, string $additional_data = ""): array|false {}
/**
* @param string &$state
* @throws SodiumException

View File

@ -933,28 +933,6 @@
}
]
},
{
"name": "sodium_crypto_secretstream_xchacha20poly1305_push",
"problems": [
{
"description": "missing function",
"versions": [
"ALL"
]
}
]
},
{
"name": "sodium_crypto_secretstream_xchacha20poly1305_pull",
"problems": [
{
"description": "missing function",
"versions": [
"ALL"
]
}
]
},
{
"name": "hash_update_file",
"problems": [
@ -987,17 +965,6 @@
]
}
]
},
{
"name": "sodium_crypto_stream_xchacha20_xor_ic",
"problems": [
{
"description": "missing function",
"versions": [
8.2
]
}
]
}
],
"classes": [