Skip to content

Commit 519ca1d

Browse files
committed
ext/sodium: sort prototypes
1 parent 2606c5f commit 519ca1d

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

ext/sodium/libsodium.c

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,20 @@ const zend_function_entry sodium_functions[] = {
203203
#ifdef HAVE_AESGCM
204204
PHP_FE(sodium_crypto_aead_aes256gcm_decrypt, AI_StringAndADAndNonceAndKey)
205205
PHP_FE(sodium_crypto_aead_aes256gcm_encrypt, AI_StringAndADAndNonceAndKey)
206+
PHP_FE(sodium_crypto_aead_aes256gcm_keygen, AI_None)
206207
#endif
207208
PHP_FE(sodium_crypto_aead_chacha20poly1305_decrypt, AI_StringAndADAndNonceAndKey)
208209
PHP_FE(sodium_crypto_aead_chacha20poly1305_encrypt, AI_StringAndADAndNonceAndKey)
210+
PHP_FE(sodium_crypto_aead_chacha20poly1305_keygen, AI_None)
209211
PHP_FE(sodium_crypto_aead_chacha20poly1305_ietf_decrypt, AI_StringAndADAndNonceAndKey)
210212
PHP_FE(sodium_crypto_aead_chacha20poly1305_ietf_encrypt, AI_StringAndADAndNonceAndKey)
211213
#ifdef crypto_aead_xchacha20poly1305_IETF_NPUBBYTES
212214
PHP_FE(sodium_crypto_aead_xchacha20poly1305_ietf_decrypt, AI_StringAndADAndNonceAndKey)
215+
PHP_FE(sodium_crypto_aead_chacha20poly1305_ietf_keygen, AI_None)
213216
PHP_FE(sodium_crypto_aead_xchacha20poly1305_ietf_encrypt, AI_StringAndADAndNonceAndKey)
214217
#endif
215218
PHP_FE(sodium_crypto_auth, AI_StringAndKey)
219+
PHP_FE(sodium_crypto_auth_keygen, AI_None)
216220
PHP_FE(sodium_crypto_auth_verify, AI_SignatureAndStringAndKey)
217221
PHP_FE(sodium_crypto_box, AI_StringAndNonceAndKeyPair)
218222
PHP_FE(sodium_crypto_box_keypair, AI_None)
@@ -221,10 +225,8 @@ const zend_function_entry sodium_functions[] = {
221225
PHP_FE(sodium_crypto_box_open, AI_StringAndNonceAndKey)
222226
PHP_FE(sodium_crypto_box_publickey, AI_Key)
223227
PHP_FE(sodium_crypto_box_publickey_from_secretkey, AI_Key)
224-
#ifdef crypto_box_SEALBYTES
225228
PHP_FE(sodium_crypto_box_seal, AI_StringAndKey)
226229
PHP_FE(sodium_crypto_box_seal_open, AI_StringAndKey)
227-
#endif
228230
PHP_FE(sodium_crypto_box_secretkey, AI_Key)
229231
PHP_FE(sodium_crypto_kx_keypair, AI_None)
230232
PHP_FE(sodium_crypto_kx_publickey, AI_Key)
@@ -233,10 +235,12 @@ const zend_function_entry sodium_functions[] = {
233235
PHP_FE(sodium_crypto_kx_client_session_keys, AI_KXClientSession)
234236
PHP_FE(sodium_crypto_kx_server_session_keys, AI_KXServerSession)
235237
PHP_FE(sodium_crypto_generichash, AI_StringAndMaybeKeyAndLength)
238+
PHP_FE(sodium_crypto_generichash_keygen, AI_None)
236239
PHP_FE(sodium_crypto_generichash_init, AI_MaybeKeyAndLength)
237240
PHP_FE(sodium_crypto_generichash_update, AI_StateByReferenceAndString)
238241
PHP_FE(sodium_crypto_generichash_final, AI_StateByReferenceAndMaybeLength)
239242
PHP_FE(sodium_crypto_kdf_derive_from_key, AI_KDF)
243+
PHP_FE(sodium_crypto_kdf_keygen, AI_None)
240244
#ifdef crypto_pwhash_SALTBYTES
241245
PHP_FE(sodium_crypto_pwhash, AI_LengthAndPasswordAndSaltAndOpsLimitAndMemLimit)
242246
PHP_FE(sodium_crypto_pwhash_str, AI_PasswordAndOpsLimitAndMemLimit)
@@ -249,8 +253,10 @@ const zend_function_entry sodium_functions[] = {
249253
#endif
250254
PHP_FE(sodium_crypto_scalarmult, AI_TwoStrings)
251255
PHP_FE(sodium_crypto_secretbox, AI_StringAndNonceAndKey)
256+
PHP_FE(sodium_crypto_secretbox_keygen, AI_None)
252257
PHP_FE(sodium_crypto_secretbox_open, AI_StringAndNonceAndKey)
253258
PHP_FE(sodium_crypto_shorthash, AI_StringAndKey)
259+
PHP_FE(sodium_crypto_shorthash_keygen, AI_None)
254260
PHP_FE(sodium_crypto_sign, AI_StringAndKeyPair)
255261
PHP_FE(sodium_crypto_sign_detached, AI_StringAndKeyPair)
256262
PHP_FE(sodium_crypto_sign_ed25519_pk_to_curve25519, AI_Key)
@@ -264,36 +270,26 @@ const zend_function_entry sodium_functions[] = {
264270
PHP_FE(sodium_crypto_sign_seed_keypair, AI_Key)
265271
PHP_FE(sodium_crypto_sign_verify_detached, AI_SignatureAndStringAndKey)
266272
PHP_FE(sodium_crypto_stream, AI_LengthAndNonceAndKey)
273+
PHP_FE(sodium_crypto_stream_keygen, AI_None)
267274
PHP_FE(sodium_crypto_stream_xor, AI_StringAndNonceAndKey)
268-
PHP_FE(sodium_bin2hex, AI_String)
269-
#if SODIUM_LIBRARY_VERSION_MAJOR > 7 || \
270-
(SODIUM_LIBRARY_VERSION_MAJOR == 7 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
275+
276+
/* helpers */
277+
278+
PHP_FE(sodium_add, AI_StringRefAndString)
271279
PHP_FE(sodium_compare, AI_TwoStrings)
272-
#endif
273-
PHP_FE(sodium_hex2bin, AI_StringAndMaybeString)
274280
PHP_FE(sodium_increment, AI_StringRef)
275-
PHP_FE(sodium_add, AI_StringRefAndString)
276281
PHP_FE(sodium_memcmp, AI_TwoStrings)
277282
PHP_FE(sodium_memzero, AI_FirstArgByReferenceSecondLength)
278-
279-
#ifdef HAVE_AESGCM
280-
PHP_FE(sodium_crypto_aead_aes256gcm_keygen, AI_None)
281-
#endif
282-
PHP_FE(sodium_crypto_aead_chacha20poly1305_keygen, AI_None)
283-
PHP_FE(sodium_crypto_aead_chacha20poly1305_ietf_keygen, AI_None)
284-
#ifdef crypto_aead_xchacha20poly1305_IETF_NPUBBYTES
285-
PHP_FE(sodium_crypto_aead_xchacha20poly1305_ietf_keygen, AI_None)
286-
#endif
287-
PHP_FE(sodium_crypto_auth_keygen, AI_None)
288-
PHP_FE(sodium_crypto_generichash_keygen, AI_None)
289-
PHP_FE(sodium_crypto_secretbox_keygen, AI_None)
290-
PHP_FE(sodium_crypto_kdf_keygen, AI_None)
291-
PHP_FE(sodium_crypto_shorthash_keygen, AI_None)
292-
PHP_FE(sodium_crypto_stream_keygen, AI_None)
293-
294283
PHP_FE(sodium_pad, AI_StringAndLength)
295284
PHP_FE(sodium_unpad, AI_StringAndLength)
296285

286+
/* codecs */
287+
288+
PHP_FE(sodium_bin2hex, AI_String)
289+
PHP_FE(sodium_hex2bin, AI_StringAndMaybeString)
290+
291+
/* aliases */
292+
297293
PHP_FALIAS(sodium_crypto_scalarmult_base, sodium_crypto_box_publickey_from_secretkey, AI_TwoStrings)
298294

299295
PHP_FE_END

0 commit comments

Comments
 (0)