Skip to content

Commit 765aec8

Browse files
authored
Generate optimizer func info from stubs for ext/sodium (#7404)
1 parent 25cbd08 commit 765aec8

File tree

4 files changed

+7
-69
lines changed

4 files changed

+7
-69
lines changed

Zend/Optimizer/zend_func_info.c

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -495,74 +495,6 @@ static const func_info_t old_func_infos[] = {
495495
F1("mhash_get_hash_name", MAY_BE_FALSE | MAY_BE_STRING),
496496
F1("mhash", MAY_BE_FALSE | MAY_BE_FALSE | MAY_BE_STRING),
497497

498-
/* ext/sodium */
499-
F1("sodium_crypto_shorthash", MAY_BE_STRING),
500-
F1("sodium_crypto_secretbox", MAY_BE_STRING),
501-
F1("sodium_crypto_secretbox_open", MAY_BE_FALSE | MAY_BE_STRING),
502-
F1("sodium_crypto_generichash", MAY_BE_STRING),
503-
F1("sodium_crypto_generichash_init", MAY_BE_STRING),
504-
F0("sodium_crypto_generichash_update", MAY_BE_TRUE),
505-
F1("sodium_crypto_generichash_final", MAY_BE_STRING),
506-
F1("sodium_crypto_box_keypair", MAY_BE_STRING),
507-
F1("sodium_crypto_box_seed_keypair", MAY_BE_STRING),
508-
F1("sodium_crypto_box_secretkey", MAY_BE_STRING),
509-
F1("sodium_crypto_box_publickey", MAY_BE_STRING),
510-
F1("sodium_crypto_box", MAY_BE_STRING),
511-
F1("sodium_crypto_box_open", MAY_BE_FALSE | MAY_BE_STRING),
512-
F1("sodium_crypto_box_seal", MAY_BE_STRING),
513-
F1("sodium_crypto_box_seal_open", MAY_BE_FALSE | MAY_BE_STRING),
514-
F1("sodium_crypto_sign_keypair", MAY_BE_STRING),
515-
F1("sodium_crypto_sign_seed_keypair", MAY_BE_STRING),
516-
F1("sodium_crypto_sign_secretkey", MAY_BE_STRING),
517-
F1("sodium_crypto_sign_publickey", MAY_BE_STRING),
518-
F1("sodium_crypto_sign", MAY_BE_STRING),
519-
F1("sodium_crypto_sign_open", MAY_BE_FALSE | MAY_BE_STRING),
520-
F1("sodium_crypto_sign_detached", MAY_BE_STRING),
521-
F1("sodium_crypto_stream", MAY_BE_STRING),
522-
F1("sodium_crypto_stream_xor", MAY_BE_STRING),
523-
F1("sodium_crypto_pwhash", MAY_BE_STRING),
524-
F1("sodium_crypto_pwhash_str", MAY_BE_STRING),
525-
F1("sodium_crypto_aead_aes256gcm_encrypt", MAY_BE_STRING),
526-
F1("sodium_crypto_aead_aes256gcm_decrypt", MAY_BE_FALSE | MAY_BE_STRING),
527-
F1("sodium_bin2hex", MAY_BE_STRING),
528-
F1("sodium_hex2bin", MAY_BE_STRING),
529-
F1("sodium_crypto_scalarmult", MAY_BE_STRING),
530-
F1("sodium_crypto_kx_seed_keypair", MAY_BE_STRING),
531-
F1("sodium_crypto_kx_keypair", MAY_BE_STRING),
532-
F1("sodium_crypto_kx_secretkey", MAY_BE_STRING),
533-
F1("sodium_crypto_kx_publickey", MAY_BE_STRING),
534-
F1("sodium_crypto_kx_client_session_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
535-
F1("sodium_crypto_kx_server_session_keys", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
536-
F1("sodium_crypto_auth", MAY_BE_STRING),
537-
F1("sodium_crypto_aead_aes256gcm_keygen", MAY_BE_STRING),
538-
F1("sodium_crypto_auth_keygen", MAY_BE_STRING),
539-
F1("sodium_crypto_generichash_keygen", MAY_BE_STRING),
540-
F1("sodium_crypto_kdf_keygen", MAY_BE_STRING),
541-
F1("sodium_crypto_secretbox_keygen", MAY_BE_STRING),
542-
F1("sodium_crypto_shorthash_keygen", MAY_BE_STRING),
543-
F1("sodium_crypto_stream_keygen", MAY_BE_STRING),
544-
F1("sodium_crypto_kdf_derive_from_key", MAY_BE_STRING),
545-
F1("sodium_pad", MAY_BE_STRING),
546-
F1("sodium_unpad", MAY_BE_STRING),
547-
548-
F1("sodium_crypto_box_keypair_from_secretkey_and_publickey", MAY_BE_STRING),
549-
F1("sodium_crypto_box_publickey_from_secretkey", MAY_BE_STRING),
550-
F1("sodium_crypto_sign_keypair_from_secretkey_and_publickey", MAY_BE_STRING),
551-
F1("sodium_crypto_sign_publickey_from_secretkey", MAY_BE_STRING),
552-
F1("sodium_crypto_pwhash_scryptsalsa208sha256", MAY_BE_STRING),
553-
F1("sodium_crypto_pwhash_scryptsalsa208sha256_str", MAY_BE_STRING),
554-
F1("sodium_crypto_sign_ed25519_sk_to_curve25519", MAY_BE_STRING),
555-
F1("sodium_crypto_sign_ed25519_pk_to_curve25519", MAY_BE_STRING),
556-
F1("sodium_crypto_aead_chacha20poly1305_encrypt", MAY_BE_STRING),
557-
F1("sodium_crypto_aead_chacha20poly1305_decrypt", MAY_BE_FALSE | MAY_BE_STRING),
558-
F1("sodium_crypto_aead_chacha20poly1305_ietf_encrypt", MAY_BE_STRING),
559-
F1("sodium_crypto_aead_chacha20poly1305_ietf_decrypt", MAY_BE_FALSE | MAY_BE_STRING),
560-
F1("sodium_crypto_aead_xchacha20poly1305_ietf_encrypt", MAY_BE_STRING),
561-
F1("sodium_crypto_aead_xchacha20poly1305_ietf_decrypt", MAY_BE_FALSE | MAY_BE_STRING),
562-
F1("sodium_crypto_aead_chacha20poly1305_keygen", MAY_BE_STRING),
563-
F1("sodium_crypto_aead_chacha20poly1305_ietf_keygen", MAY_BE_STRING),
564-
F1("sodium_crypto_aead_xchacha20poly1305_ietf_keygen", MAY_BE_STRING),
565-
566498
/* ext/pgsql */
567499
F1("pg_dbname", MAY_BE_STRING),
568500
F1("pg_options", MAY_BE_STRING),

Zend/Optimizer/zend_func_infos.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ static const func_info_t func_infos[] = {
143143
F1("exif_read_data", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
144144
F1("exif_thumbnail", MAY_BE_STRING|MAY_BE_FALSE),
145145
F1("pg_socket", MAY_BE_RESOURCE|MAY_BE_FALSE),
146+
FN("sodium_crypto_kx_client_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
147+
FN("sodium_crypto_kx_server_session_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
148+
F0("sodium_crypto_generichash_update", MAY_BE_TRUE),
146149
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),
147150
F1("filter_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
148151
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),

ext/sodium/libsodium.stub.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ function sodium_crypto_kx_secretkey(string $key_pair): string {}
9494

9595
function sodium_crypto_kx_seed_keypair(string $seed): string {}
9696

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

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

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

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

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

109112
function sodium_crypto_generichash_final(string &$state, int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {}

ext/sodium/libsodium_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 7213518d1b2e9322194d677f13634f61c5f71af8 */
2+
* Stub hash: 91286b83d2bbfb3fb3c99eb5da907d788f7e17ac */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0)
55
ZEND_END_ARG_INFO()

0 commit comments

Comments
 (0)