@@ -203,16 +203,20 @@ const zend_function_entry sodium_functions[] = {
203
203
#ifdef HAVE_AESGCM
204
204
PHP_FE (sodium_crypto_aead_aes256gcm_decrypt , AI_StringAndADAndNonceAndKey )
205
205
PHP_FE (sodium_crypto_aead_aes256gcm_encrypt , AI_StringAndADAndNonceAndKey )
206
+ PHP_FE (sodium_crypto_aead_aes256gcm_keygen , AI_None )
206
207
#endif
207
208
PHP_FE (sodium_crypto_aead_chacha20poly1305_decrypt , AI_StringAndADAndNonceAndKey )
208
209
PHP_FE (sodium_crypto_aead_chacha20poly1305_encrypt , AI_StringAndADAndNonceAndKey )
210
+ PHP_FE (sodium_crypto_aead_chacha20poly1305_keygen , AI_None )
209
211
PHP_FE (sodium_crypto_aead_chacha20poly1305_ietf_decrypt , AI_StringAndADAndNonceAndKey )
210
212
PHP_FE (sodium_crypto_aead_chacha20poly1305_ietf_encrypt , AI_StringAndADAndNonceAndKey )
211
213
#ifdef crypto_aead_xchacha20poly1305_IETF_NPUBBYTES
212
214
PHP_FE (sodium_crypto_aead_xchacha20poly1305_ietf_decrypt , AI_StringAndADAndNonceAndKey )
215
+ PHP_FE (sodium_crypto_aead_chacha20poly1305_ietf_keygen , AI_None )
213
216
PHP_FE (sodium_crypto_aead_xchacha20poly1305_ietf_encrypt , AI_StringAndADAndNonceAndKey )
214
217
#endif
215
218
PHP_FE (sodium_crypto_auth , AI_StringAndKey )
219
+ PHP_FE (sodium_crypto_auth_keygen , AI_None )
216
220
PHP_FE (sodium_crypto_auth_verify , AI_SignatureAndStringAndKey )
217
221
PHP_FE (sodium_crypto_box , AI_StringAndNonceAndKeyPair )
218
222
PHP_FE (sodium_crypto_box_keypair , AI_None )
@@ -221,10 +225,8 @@ const zend_function_entry sodium_functions[] = {
221
225
PHP_FE (sodium_crypto_box_open , AI_StringAndNonceAndKey )
222
226
PHP_FE (sodium_crypto_box_publickey , AI_Key )
223
227
PHP_FE (sodium_crypto_box_publickey_from_secretkey , AI_Key )
224
- #ifdef crypto_box_SEALBYTES
225
228
PHP_FE (sodium_crypto_box_seal , AI_StringAndKey )
226
229
PHP_FE (sodium_crypto_box_seal_open , AI_StringAndKey )
227
- #endif
228
230
PHP_FE (sodium_crypto_box_secretkey , AI_Key )
229
231
PHP_FE (sodium_crypto_kx_keypair , AI_None )
230
232
PHP_FE (sodium_crypto_kx_publickey , AI_Key )
@@ -233,10 +235,12 @@ const zend_function_entry sodium_functions[] = {
233
235
PHP_FE (sodium_crypto_kx_client_session_keys , AI_KXClientSession )
234
236
PHP_FE (sodium_crypto_kx_server_session_keys , AI_KXServerSession )
235
237
PHP_FE (sodium_crypto_generichash , AI_StringAndMaybeKeyAndLength )
238
+ PHP_FE (sodium_crypto_generichash_keygen , AI_None )
236
239
PHP_FE (sodium_crypto_generichash_init , AI_MaybeKeyAndLength )
237
240
PHP_FE (sodium_crypto_generichash_update , AI_StateByReferenceAndString )
238
241
PHP_FE (sodium_crypto_generichash_final , AI_StateByReferenceAndMaybeLength )
239
242
PHP_FE (sodium_crypto_kdf_derive_from_key , AI_KDF )
243
+ PHP_FE (sodium_crypto_kdf_keygen , AI_None )
240
244
#ifdef crypto_pwhash_SALTBYTES
241
245
PHP_FE (sodium_crypto_pwhash , AI_LengthAndPasswordAndSaltAndOpsLimitAndMemLimit )
242
246
PHP_FE (sodium_crypto_pwhash_str , AI_PasswordAndOpsLimitAndMemLimit )
@@ -249,8 +253,10 @@ const zend_function_entry sodium_functions[] = {
249
253
#endif
250
254
PHP_FE (sodium_crypto_scalarmult , AI_TwoStrings )
251
255
PHP_FE (sodium_crypto_secretbox , AI_StringAndNonceAndKey )
256
+ PHP_FE (sodium_crypto_secretbox_keygen , AI_None )
252
257
PHP_FE (sodium_crypto_secretbox_open , AI_StringAndNonceAndKey )
253
258
PHP_FE (sodium_crypto_shorthash , AI_StringAndKey )
259
+ PHP_FE (sodium_crypto_shorthash_keygen , AI_None )
254
260
PHP_FE (sodium_crypto_sign , AI_StringAndKeyPair )
255
261
PHP_FE (sodium_crypto_sign_detached , AI_StringAndKeyPair )
256
262
PHP_FE (sodium_crypto_sign_ed25519_pk_to_curve25519 , AI_Key )
@@ -264,36 +270,26 @@ const zend_function_entry sodium_functions[] = {
264
270
PHP_FE (sodium_crypto_sign_seed_keypair , AI_Key )
265
271
PHP_FE (sodium_crypto_sign_verify_detached , AI_SignatureAndStringAndKey )
266
272
PHP_FE (sodium_crypto_stream , AI_LengthAndNonceAndKey )
273
+ PHP_FE (sodium_crypto_stream_keygen , AI_None )
267
274
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 )
271
279
PHP_FE (sodium_compare , AI_TwoStrings )
272
- #endif
273
- PHP_FE (sodium_hex2bin , AI_StringAndMaybeString )
274
280
PHP_FE (sodium_increment , AI_StringRef )
275
- PHP_FE (sodium_add , AI_StringRefAndString )
276
281
PHP_FE (sodium_memcmp , AI_TwoStrings )
277
282
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
-
294
283
PHP_FE (sodium_pad , AI_StringAndLength )
295
284
PHP_FE (sodium_unpad , AI_StringAndLength )
296
285
286
+ /* codecs */
287
+
288
+ PHP_FE (sodium_bin2hex , AI_String )
289
+ PHP_FE (sodium_hex2bin , AI_StringAndMaybeString )
290
+
291
+ /* aliases */
292
+
297
293
PHP_FALIAS (sodium_crypto_scalarmult_base , sodium_crypto_box_publickey_from_secretkey , AI_TwoStrings )
298
294
299
295
PHP_FE_END
0 commit comments