Skip to content

Generate optimizer func info from stubs for ext/sodium #7404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions Zend/Optimizer/zend_func_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,74 +527,6 @@ static const func_info_t old_func_infos[] = {
F1("mhash_get_hash_name", MAY_BE_FALSE | MAY_BE_STRING),
F1("mhash", MAY_BE_FALSE | MAY_BE_FALSE | MAY_BE_STRING),

/* ext/sodium */
F1("sodium_crypto_shorthash", MAY_BE_STRING),
F1("sodium_crypto_secretbox", MAY_BE_STRING),
F1("sodium_crypto_secretbox_open", MAY_BE_FALSE | MAY_BE_STRING),
F1("sodium_crypto_generichash", MAY_BE_STRING),
F1("sodium_crypto_generichash_init", MAY_BE_STRING),
F0("sodium_crypto_generichash_update", MAY_BE_TRUE),
F1("sodium_crypto_generichash_final", MAY_BE_STRING),
F1("sodium_crypto_box_keypair", MAY_BE_STRING),
F1("sodium_crypto_box_seed_keypair", MAY_BE_STRING),
F1("sodium_crypto_box_secretkey", MAY_BE_STRING),
F1("sodium_crypto_box_publickey", MAY_BE_STRING),
F1("sodium_crypto_box", MAY_BE_STRING),
F1("sodium_crypto_box_open", MAY_BE_FALSE | MAY_BE_STRING),
F1("sodium_crypto_box_seal", MAY_BE_STRING),
F1("sodium_crypto_box_seal_open", MAY_BE_FALSE | MAY_BE_STRING),
F1("sodium_crypto_sign_keypair", MAY_BE_STRING),
F1("sodium_crypto_sign_seed_keypair", MAY_BE_STRING),
F1("sodium_crypto_sign_secretkey", MAY_BE_STRING),
F1("sodium_crypto_sign_publickey", MAY_BE_STRING),
F1("sodium_crypto_sign", MAY_BE_STRING),
F1("sodium_crypto_sign_open", MAY_BE_FALSE | MAY_BE_STRING),
F1("sodium_crypto_sign_detached", MAY_BE_STRING),
F1("sodium_crypto_stream", MAY_BE_STRING),
F1("sodium_crypto_stream_xor", MAY_BE_STRING),
F1("sodium_crypto_pwhash", MAY_BE_STRING),
F1("sodium_crypto_pwhash_str", MAY_BE_STRING),
F1("sodium_crypto_aead_aes256gcm_encrypt", MAY_BE_STRING),
F1("sodium_crypto_aead_aes256gcm_decrypt", MAY_BE_FALSE | MAY_BE_STRING),
F1("sodium_bin2hex", MAY_BE_STRING),
F1("sodium_hex2bin", MAY_BE_STRING),
F1("sodium_crypto_scalarmult", MAY_BE_STRING),
F1("sodium_crypto_kx_seed_keypair", MAY_BE_STRING),
F1("sodium_crypto_kx_keypair", MAY_BE_STRING),
F1("sodium_crypto_kx_secretkey", MAY_BE_STRING),
F1("sodium_crypto_kx_publickey", MAY_BE_STRING),
F1("sodium_crypto_kx_client_session_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("sodium_crypto_kx_server_session_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("sodium_crypto_auth", MAY_BE_STRING),
F1("sodium_crypto_aead_aes256gcm_keygen", MAY_BE_STRING),
F1("sodium_crypto_auth_keygen", MAY_BE_STRING),
F1("sodium_crypto_generichash_keygen", MAY_BE_STRING),
F1("sodium_crypto_kdf_keygen", MAY_BE_STRING),
F1("sodium_crypto_secretbox_keygen", MAY_BE_STRING),
F1("sodium_crypto_shorthash_keygen", MAY_BE_STRING),
F1("sodium_crypto_stream_keygen", MAY_BE_STRING),
F1("sodium_crypto_kdf_derive_from_key", MAY_BE_STRING),
F1("sodium_pad", MAY_BE_STRING),
F1("sodium_unpad", MAY_BE_STRING),

F1("sodium_crypto_box_keypair_from_secretkey_and_publickey", MAY_BE_STRING),
F1("sodium_crypto_box_publickey_from_secretkey", MAY_BE_STRING),
F1("sodium_crypto_sign_keypair_from_secretkey_and_publickey", MAY_BE_STRING),
F1("sodium_crypto_sign_publickey_from_secretkey", MAY_BE_STRING),
F1("sodium_crypto_pwhash_scryptsalsa208sha256", MAY_BE_STRING),
F1("sodium_crypto_pwhash_scryptsalsa208sha256_str", MAY_BE_STRING),
F1("sodium_crypto_sign_ed25519_sk_to_curve25519", MAY_BE_STRING),
F1("sodium_crypto_sign_ed25519_pk_to_curve25519", MAY_BE_STRING),
F1("sodium_crypto_aead_chacha20poly1305_encrypt", MAY_BE_STRING),
F1("sodium_crypto_aead_chacha20poly1305_decrypt", MAY_BE_FALSE | MAY_BE_STRING),
F1("sodium_crypto_aead_chacha20poly1305_ietf_encrypt", MAY_BE_STRING),
F1("sodium_crypto_aead_chacha20poly1305_ietf_decrypt", MAY_BE_FALSE | MAY_BE_STRING),
F1("sodium_crypto_aead_xchacha20poly1305_ietf_encrypt", MAY_BE_STRING),
F1("sodium_crypto_aead_xchacha20poly1305_ietf_decrypt", MAY_BE_FALSE | MAY_BE_STRING),
F1("sodium_crypto_aead_chacha20poly1305_keygen", MAY_BE_STRING),
F1("sodium_crypto_aead_chacha20poly1305_ietf_keygen", MAY_BE_STRING),
F1("sodium_crypto_aead_xchacha20poly1305_ietf_keygen", MAY_BE_STRING),

/* ext/pgsql */
F1("pg_dbname", MAY_BE_STRING),
F1("pg_options", MAY_BE_STRING),
Expand Down
3 changes: 3 additions & 0 deletions Zend/Optimizer/zend_func_infos.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ static const func_info_t func_infos[] = {
F1("exif_read_data", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
F1("exif_thumbnail", MAY_BE_STRING|MAY_BE_FALSE),
F1("pg_socket", MAY_BE_RESOURCE|MAY_BE_FALSE),
FN("sodium_crypto_kx_client_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
FN("sodium_crypto_kx_server_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F0("sodium_crypto_generichash_update", MAY_BE_TRUE),
F1("filter_input_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE|MAY_BE_NULL),
F1("filter_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
FN("pcntl_signal_get_handler", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_OBJECT|MAY_BE_LONG),
Expand Down
3 changes: 3 additions & 0 deletions ext/sodium/libsodium.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ function sodium_crypto_kx_secretkey(string $key_pair): string {}

function sodium_crypto_kx_seed_keypair(string $seed): string {}

/** @return array<int, string> */
function sodium_crypto_kx_client_session_keys(string $client_key_pair, string $server_key): array {}

/** @return array<int, string> */
function sodium_crypto_kx_server_session_keys(string $server_key_pair, string $client_key): array {}

function sodium_crypto_generichash(string $message, string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {}
Expand All @@ -104,6 +106,7 @@ function sodium_crypto_generichash_keygen(): string {}

function sodium_crypto_generichash_init(string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {}

/** @return true */
function sodium_crypto_generichash_update(string &$state, string $message): bool {}

function sodium_crypto_generichash_final(string &$state, int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {}
Expand Down
2 changes: 1 addition & 1 deletion ext/sodium/libsodium_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 7213518d1b2e9322194d677f13634f61c5f71af8 */
* Stub hash: 91286b83d2bbfb3fb3c99eb5da907d788f7e17ac */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
Expand Down