xref: /PHP-8.1/ext/sodium/libsodium_arginfo.h (revision 10a2079b)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: e172b900040a9d9ac98207c638fdeb3a0c6a13e6 */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0)
5 ZEND_END_ARG_INFO()
6 
7 #if defined(HAVE_AESGCM)
8 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_aead_aes256gcm_decrypt, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
9 	ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
10 	ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
11 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
12 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
13 ZEND_END_ARG_INFO()
14 #endif
15 
16 #if defined(HAVE_AESGCM)
17 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_encrypt, 0, 4, IS_STRING, 0)
18 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
19 	ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
20 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
21 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
22 ZEND_END_ARG_INFO()
23 #endif
24 
25 #if defined(HAVE_AESGCM)
26 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_keygen, 0, 0, IS_STRING, 0)
27 ZEND_END_ARG_INFO()
28 #endif
29 
30 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_aead_chacha20poly1305_decrypt, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
31 	ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
32 	ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
33 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
34 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
35 ZEND_END_ARG_INFO()
36 
37 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_chacha20poly1305_encrypt, 0, 4, IS_STRING, 0)
38 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
39 	ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
40 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
41 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
42 ZEND_END_ARG_INFO()
43 
44 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_chacha20poly1305_keygen, 0, 0, IS_STRING, 0)
45 ZEND_END_ARG_INFO()
46 
47 #define arginfo_sodium_crypto_aead_chacha20poly1305_ietf_decrypt arginfo_sodium_crypto_aead_chacha20poly1305_decrypt
48 
49 #define arginfo_sodium_crypto_aead_chacha20poly1305_ietf_encrypt arginfo_sodium_crypto_aead_chacha20poly1305_encrypt
50 
51 #define arginfo_sodium_crypto_aead_chacha20poly1305_ietf_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
52 
53 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
54 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_decrypt, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
55 	ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
56 	ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
57 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
58 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
59 ZEND_END_ARG_INFO()
60 #endif
61 
62 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
63 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_keygen, 0, 0, IS_STRING, 0)
64 ZEND_END_ARG_INFO()
65 #endif
66 
67 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
68 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_encrypt, 0, 4, IS_STRING, 0)
69 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
70 	ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
71 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
72 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
73 ZEND_END_ARG_INFO()
74 #endif
75 
76 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_auth, 0, 2, IS_STRING, 0)
77 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
78 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
79 ZEND_END_ARG_INFO()
80 
81 #define arginfo_sodium_crypto_auth_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
82 
83 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_auth_verify, 0, 3, _IS_BOOL, 0)
84 	ZEND_ARG_TYPE_INFO(0, mac, IS_STRING, 0)
85 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
86 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
87 ZEND_END_ARG_INFO()
88 
89 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box, 0, 3, IS_STRING, 0)
90 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
91 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
92 	ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
93 ZEND_END_ARG_INFO()
94 
95 #define arginfo_sodium_crypto_box_keypair arginfo_sodium_crypto_aead_chacha20poly1305_keygen
96 
97 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_seed_keypair, 0, 1, IS_STRING, 0)
98 	ZEND_ARG_TYPE_INFO(0, seed, IS_STRING, 0)
99 ZEND_END_ARG_INFO()
100 
101 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_keypair_from_secretkey_and_publickey, 0, 2, IS_STRING, 0)
102 	ZEND_ARG_TYPE_INFO(0, secret_key, IS_STRING, 0)
103 	ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
104 ZEND_END_ARG_INFO()
105 
106 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_box_open, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
107 	ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
108 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
109 	ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
110 ZEND_END_ARG_INFO()
111 
112 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_publickey, 0, 1, IS_STRING, 0)
113 	ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
114 ZEND_END_ARG_INFO()
115 
116 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_publickey_from_secretkey, 0, 1, IS_STRING, 0)
117 	ZEND_ARG_TYPE_INFO(0, secret_key, IS_STRING, 0)
118 ZEND_END_ARG_INFO()
119 
120 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_seal, 0, 2, IS_STRING, 0)
121 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
122 	ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
123 ZEND_END_ARG_INFO()
124 
125 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_box_seal_open, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
126 	ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
127 	ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
128 ZEND_END_ARG_INFO()
129 
130 #define arginfo_sodium_crypto_box_secretkey arginfo_sodium_crypto_box_publickey
131 
132 #if defined(crypto_core_ristretto255_HASHBYTES)
133 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_add, 0, 2, IS_STRING, 0)
134 	ZEND_ARG_TYPE_INFO(0, p, IS_STRING, 0)
135 	ZEND_ARG_TYPE_INFO(0, q, IS_STRING, 0)
136 ZEND_END_ARG_INFO()
137 #endif
138 
139 #if defined(crypto_core_ristretto255_HASHBYTES)
140 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_from_hash, 0, 1, IS_STRING, 0)
141 	ZEND_ARG_TYPE_INFO(0, s, IS_STRING, 0)
142 ZEND_END_ARG_INFO()
143 #endif
144 
145 #if defined(crypto_core_ristretto255_HASHBYTES)
146 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_is_valid_point, 0, 1, _IS_BOOL, 0)
147 	ZEND_ARG_TYPE_INFO(0, s, IS_STRING, 0)
148 ZEND_END_ARG_INFO()
149 #endif
150 
151 #if defined(crypto_core_ristretto255_HASHBYTES)
152 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_random, 0, 0, IS_STRING, 0)
153 ZEND_END_ARG_INFO()
154 #endif
155 
156 #if defined(crypto_core_ristretto255_HASHBYTES)
157 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_scalar_add, 0, 2, IS_STRING, 0)
158 	ZEND_ARG_TYPE_INFO(0, x, IS_STRING, 0)
159 	ZEND_ARG_TYPE_INFO(0, y, IS_STRING, 0)
160 ZEND_END_ARG_INFO()
161 #endif
162 
163 #if defined(crypto_core_ristretto255_HASHBYTES)
164 #define arginfo_sodium_crypto_core_ristretto255_scalar_complement arginfo_sodium_crypto_core_ristretto255_from_hash
165 #endif
166 
167 #if defined(crypto_core_ristretto255_HASHBYTES)
168 #define arginfo_sodium_crypto_core_ristretto255_scalar_invert arginfo_sodium_crypto_core_ristretto255_from_hash
169 #endif
170 
171 #if defined(crypto_core_ristretto255_HASHBYTES)
172 #define arginfo_sodium_crypto_core_ristretto255_scalar_mul arginfo_sodium_crypto_core_ristretto255_scalar_add
173 #endif
174 
175 #if defined(crypto_core_ristretto255_HASHBYTES)
176 #define arginfo_sodium_crypto_core_ristretto255_scalar_negate arginfo_sodium_crypto_core_ristretto255_from_hash
177 #endif
178 
179 #if defined(crypto_core_ristretto255_HASHBYTES)
180 #define arginfo_sodium_crypto_core_ristretto255_scalar_random arginfo_sodium_crypto_core_ristretto255_random
181 #endif
182 
183 #if defined(crypto_core_ristretto255_HASHBYTES)
184 #define arginfo_sodium_crypto_core_ristretto255_scalar_reduce arginfo_sodium_crypto_core_ristretto255_from_hash
185 #endif
186 
187 #if defined(crypto_core_ristretto255_HASHBYTES)
188 #define arginfo_sodium_crypto_core_ristretto255_scalar_sub arginfo_sodium_crypto_core_ristretto255_scalar_add
189 #endif
190 
191 #if defined(crypto_core_ristretto255_HASHBYTES)
192 #define arginfo_sodium_crypto_core_ristretto255_sub arginfo_sodium_crypto_core_ristretto255_add
193 #endif
194 
195 #define arginfo_sodium_crypto_kx_keypair arginfo_sodium_crypto_aead_chacha20poly1305_keygen
196 
197 #define arginfo_sodium_crypto_kx_publickey arginfo_sodium_crypto_box_publickey
198 
199 #define arginfo_sodium_crypto_kx_secretkey arginfo_sodium_crypto_box_publickey
200 
201 #define arginfo_sodium_crypto_kx_seed_keypair arginfo_sodium_crypto_box_seed_keypair
202 
203 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_kx_client_session_keys, 0, 2, IS_ARRAY, 0)
204 	ZEND_ARG_TYPE_INFO(0, client_key_pair, IS_STRING, 0)
205 	ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0)
206 ZEND_END_ARG_INFO()
207 
208 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_kx_server_session_keys, 0, 2, IS_ARRAY, 0)
209 	ZEND_ARG_TYPE_INFO(0, server_key_pair, IS_STRING, 0)
210 	ZEND_ARG_TYPE_INFO(0, client_key, IS_STRING, 0)
211 ZEND_END_ARG_INFO()
212 
213 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash, 0, 1, IS_STRING, 0)
214 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
215 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "\"\"")
216 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "SODIUM_CRYPTO_GENERICHASH_BYTES")
217 ZEND_END_ARG_INFO()
218 
219 #define arginfo_sodium_crypto_generichash_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
220 
221 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_init, 0, 0, IS_STRING, 0)
222 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "\"\"")
223 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "SODIUM_CRYPTO_GENERICHASH_BYTES")
224 ZEND_END_ARG_INFO()
225 
226 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_update, 0, 2, _IS_BOOL, 0)
227 	ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
228 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
229 ZEND_END_ARG_INFO()
230 
231 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_final, 0, 1, IS_STRING, 0)
232 	ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
233 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "SODIUM_CRYPTO_GENERICHASH_BYTES")
234 ZEND_END_ARG_INFO()
235 
236 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_kdf_derive_from_key, 0, 4, IS_STRING, 0)
237 	ZEND_ARG_TYPE_INFO(0, subkey_length, IS_LONG, 0)
238 	ZEND_ARG_TYPE_INFO(0, subkey_id, IS_LONG, 0)
239 	ZEND_ARG_TYPE_INFO(0, context, IS_STRING, 0)
240 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
241 ZEND_END_ARG_INFO()
242 
243 #define arginfo_sodium_crypto_kdf_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
244 
245 #if defined(crypto_pwhash_SALTBYTES)
246 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash, 0, 5, IS_STRING, 0)
247 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
248 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
249 	ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
250 	ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
251 	ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
252 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, algo, IS_LONG, 0, "SODIUM_CRYPTO_PWHASH_ALG_DEFAULT")
253 ZEND_END_ARG_INFO()
254 #endif
255 
256 #if defined(crypto_pwhash_SALTBYTES)
257 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_str, 0, 3, IS_STRING, 0)
258 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
259 	ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
260 	ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
261 ZEND_END_ARG_INFO()
262 #endif
263 
264 #if defined(crypto_pwhash_SALTBYTES)
265 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_str_verify, 0, 2, _IS_BOOL, 0)
266 	ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0)
267 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
268 ZEND_END_ARG_INFO()
269 #endif
270 
271 #if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
272 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_str_needs_rehash, 0, 3, _IS_BOOL, 0)
273 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
274 	ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
275 	ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
276 ZEND_END_ARG_INFO()
277 #endif
278 
279 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
280 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_scryptsalsa208sha256, 0, 5, IS_STRING, 0)
281 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
282 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
283 	ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
284 	ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
285 	ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
286 ZEND_END_ARG_INFO()
287 #endif
288 
289 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
290 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_scryptsalsa208sha256_str, 0, 3, IS_STRING, 0)
291 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
292 	ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
293 	ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
294 ZEND_END_ARG_INFO()
295 #endif
296 
297 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
298 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_scryptsalsa208sha256_str_verify, 0, 2, _IS_BOOL, 0)
299 	ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0)
300 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
301 ZEND_END_ARG_INFO()
302 #endif
303 
304 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_scalarmult, 0, 2, IS_STRING, 0)
305 	ZEND_ARG_TYPE_INFO(0, n, IS_STRING, 0)
306 	ZEND_ARG_TYPE_INFO(0, p, IS_STRING, 0)
307 ZEND_END_ARG_INFO()
308 
309 #if defined(crypto_core_ristretto255_HASHBYTES)
310 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_scalarmult_ristretto255, 0, 2, IS_STRING, 0)
311 	ZEND_ARG_TYPE_INFO(0, n, IS_STRING, 0)
312 	ZEND_ARG_TYPE_INFO(0, p, IS_STRING, 0)
313 ZEND_END_ARG_INFO()
314 #endif
315 
316 #if defined(crypto_core_ristretto255_HASHBYTES)
317 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_scalarmult_ristretto255_base, 0, 1, IS_STRING, 0)
318 	ZEND_ARG_TYPE_INFO(0, n, IS_STRING, 0)
319 ZEND_END_ARG_INFO()
320 #endif
321 
322 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretbox, 0, 3, IS_STRING, 0)
323 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
324 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
325 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
326 ZEND_END_ARG_INFO()
327 
328 #define arginfo_sodium_crypto_secretbox_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
329 
330 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_secretbox_open, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
331 	ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
332 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
333 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
334 ZEND_END_ARG_INFO()
335 
336 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
337 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_keygen, 0, 0, IS_STRING, 0)
338 ZEND_END_ARG_INFO()
339 #endif
340 
341 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
342 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_init_push, 0, 1, IS_ARRAY, 0)
343 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
344 ZEND_END_ARG_INFO()
345 #endif
346 
347 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
348 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_push, 0, 2, IS_STRING, 0)
349 	ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
350 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
351 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_data, IS_STRING, 0, "\"\"")
352 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tag, IS_LONG, 0, "SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE")
353 ZEND_END_ARG_INFO()
354 #endif
355 
356 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
357 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_init_pull, 0, 2, IS_STRING, 0)
358 	ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0)
359 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
360 ZEND_END_ARG_INFO()
361 #endif
362 
363 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
364 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_pull, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
365 	ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
366 	ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
367 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_data, IS_STRING, 0, "\"\"")
368 ZEND_END_ARG_INFO()
369 #endif
370 
371 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
372 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_rekey, 0, 1, IS_VOID, 0)
373 	ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
374 ZEND_END_ARG_INFO()
375 #endif
376 
377 #define arginfo_sodium_crypto_shorthash arginfo_sodium_crypto_auth
378 
379 #define arginfo_sodium_crypto_shorthash_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
380 
381 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_sign, 0, 2, IS_STRING, 0)
382 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
383 	ZEND_ARG_TYPE_INFO(0, secret_key, IS_STRING, 0)
384 ZEND_END_ARG_INFO()
385 
386 #define arginfo_sodium_crypto_sign_detached arginfo_sodium_crypto_sign
387 
388 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_sign_ed25519_pk_to_curve25519, 0, 1, IS_STRING, 0)
389 	ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
390 ZEND_END_ARG_INFO()
391 
392 #define arginfo_sodium_crypto_sign_ed25519_sk_to_curve25519 arginfo_sodium_crypto_box_publickey_from_secretkey
393 
394 #define arginfo_sodium_crypto_sign_keypair arginfo_sodium_crypto_aead_chacha20poly1305_keygen
395 
396 #define arginfo_sodium_crypto_sign_keypair_from_secretkey_and_publickey arginfo_sodium_crypto_box_keypair_from_secretkey_and_publickey
397 
398 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_sign_open, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
399 	ZEND_ARG_TYPE_INFO(0, signed_message, IS_STRING, 0)
400 	ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
401 ZEND_END_ARG_INFO()
402 
403 #define arginfo_sodium_crypto_sign_publickey arginfo_sodium_crypto_box_publickey
404 
405 #define arginfo_sodium_crypto_sign_secretkey arginfo_sodium_crypto_box_publickey
406 
407 #define arginfo_sodium_crypto_sign_publickey_from_secretkey arginfo_sodium_crypto_box_publickey_from_secretkey
408 
409 #define arginfo_sodium_crypto_sign_seed_keypair arginfo_sodium_crypto_box_seed_keypair
410 
411 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_sign_verify_detached, 0, 3, _IS_BOOL, 0)
412 	ZEND_ARG_TYPE_INFO(0, signature, IS_STRING, 0)
413 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
414 	ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
415 ZEND_END_ARG_INFO()
416 
417 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_stream, 0, 3, IS_STRING, 0)
418 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
419 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
420 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
421 ZEND_END_ARG_INFO()
422 
423 #define arginfo_sodium_crypto_stream_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
424 
425 #define arginfo_sodium_crypto_stream_xor arginfo_sodium_crypto_secretbox
426 
427 #if defined(crypto_stream_xchacha20_KEYBYTES)
428 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_stream_xchacha20, 0, 3, IS_STRING, 0)
429 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
430 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
431 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
432 ZEND_END_ARG_INFO()
433 #endif
434 
435 #if defined(crypto_stream_xchacha20_KEYBYTES)
436 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_stream_xchacha20_keygen, 0, 0, IS_STRING, 0)
437 ZEND_END_ARG_INFO()
438 #endif
439 
440 #if defined(crypto_stream_xchacha20_KEYBYTES)
441 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_stream_xchacha20_xor, 0, 3, IS_STRING, 0)
442 	ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
443 	ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
444 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
445 ZEND_END_ARG_INFO()
446 #endif
447 
448 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_add, 0, 2, IS_VOID, 0)
449 	ZEND_ARG_TYPE_INFO(1, string1, IS_STRING, 0)
450 	ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0)
451 ZEND_END_ARG_INFO()
452 
453 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_compare, 0, 2, IS_LONG, 0)
454 	ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0)
455 	ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0)
456 ZEND_END_ARG_INFO()
457 
458 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_increment, 0, 1, IS_VOID, 0)
459 	ZEND_ARG_TYPE_INFO(1, string, IS_STRING, 0)
460 ZEND_END_ARG_INFO()
461 
462 #define arginfo_sodium_memcmp arginfo_sodium_compare
463 
464 #define arginfo_sodium_memzero arginfo_sodium_increment
465 
466 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_pad, 0, 2, IS_STRING, 0)
467 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
468 	ZEND_ARG_TYPE_INFO(0, block_size, IS_LONG, 0)
469 ZEND_END_ARG_INFO()
470 
471 #define arginfo_sodium_unpad arginfo_sodium_pad
472 
473 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_bin2hex, 0, 1, IS_STRING, 0)
474 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
475 ZEND_END_ARG_INFO()
476 
477 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_hex2bin, 0, 1, IS_STRING, 0)
478 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
479 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignore, IS_STRING, 0, "\"\"")
480 ZEND_END_ARG_INFO()
481 
482 #if defined(sodium_base64_VARIANT_ORIGINAL)
483 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_bin2base64, 0, 2, IS_STRING, 0)
484 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
485 	ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0)
486 ZEND_END_ARG_INFO()
487 #endif
488 
489 #if defined(sodium_base64_VARIANT_ORIGINAL)
490 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_base642bin, 0, 2, IS_STRING, 0)
491 	ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
492 	ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0)
493 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignore, IS_STRING, 0, "\"\"")
494 ZEND_END_ARG_INFO()
495 #endif
496 
497 #define arginfo_sodium_crypto_scalarmult_base arginfo_sodium_crypto_box_publickey_from_secretkey
498 
499 
500 ZEND_FUNCTION(sodium_crypto_aead_aes256gcm_is_available);
501 #if defined(HAVE_AESGCM)
502 ZEND_FUNCTION(sodium_crypto_aead_aes256gcm_decrypt);
503 #endif
504 #if defined(HAVE_AESGCM)
505 ZEND_FUNCTION(sodium_crypto_aead_aes256gcm_encrypt);
506 #endif
507 #if defined(HAVE_AESGCM)
508 ZEND_FUNCTION(sodium_crypto_aead_aes256gcm_keygen);
509 #endif
510 ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_decrypt);
511 ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_encrypt);
512 ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_keygen);
513 ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_ietf_decrypt);
514 ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_ietf_encrypt);
515 ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_ietf_keygen);
516 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
517 ZEND_FUNCTION(sodium_crypto_aead_xchacha20poly1305_ietf_decrypt);
518 #endif
519 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
520 ZEND_FUNCTION(sodium_crypto_aead_xchacha20poly1305_ietf_keygen);
521 #endif
522 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
523 ZEND_FUNCTION(sodium_crypto_aead_xchacha20poly1305_ietf_encrypt);
524 #endif
525 ZEND_FUNCTION(sodium_crypto_auth);
526 ZEND_FUNCTION(sodium_crypto_auth_keygen);
527 ZEND_FUNCTION(sodium_crypto_auth_verify);
528 ZEND_FUNCTION(sodium_crypto_box);
529 ZEND_FUNCTION(sodium_crypto_box_keypair);
530 ZEND_FUNCTION(sodium_crypto_box_seed_keypair);
531 ZEND_FUNCTION(sodium_crypto_box_keypair_from_secretkey_and_publickey);
532 ZEND_FUNCTION(sodium_crypto_box_open);
533 ZEND_FUNCTION(sodium_crypto_box_publickey);
534 ZEND_FUNCTION(sodium_crypto_box_publickey_from_secretkey);
535 ZEND_FUNCTION(sodium_crypto_box_seal);
536 ZEND_FUNCTION(sodium_crypto_box_seal_open);
537 ZEND_FUNCTION(sodium_crypto_box_secretkey);
538 #if defined(crypto_core_ristretto255_HASHBYTES)
539 ZEND_FUNCTION(sodium_crypto_core_ristretto255_add);
540 #endif
541 #if defined(crypto_core_ristretto255_HASHBYTES)
542 ZEND_FUNCTION(sodium_crypto_core_ristretto255_from_hash);
543 #endif
544 #if defined(crypto_core_ristretto255_HASHBYTES)
545 ZEND_FUNCTION(sodium_crypto_core_ristretto255_is_valid_point);
546 #endif
547 #if defined(crypto_core_ristretto255_HASHBYTES)
548 ZEND_FUNCTION(sodium_crypto_core_ristretto255_random);
549 #endif
550 #if defined(crypto_core_ristretto255_HASHBYTES)
551 ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_add);
552 #endif
553 #if defined(crypto_core_ristretto255_HASHBYTES)
554 ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_complement);
555 #endif
556 #if defined(crypto_core_ristretto255_HASHBYTES)
557 ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_invert);
558 #endif
559 #if defined(crypto_core_ristretto255_HASHBYTES)
560 ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_mul);
561 #endif
562 #if defined(crypto_core_ristretto255_HASHBYTES)
563 ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_negate);
564 #endif
565 #if defined(crypto_core_ristretto255_HASHBYTES)
566 ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_random);
567 #endif
568 #if defined(crypto_core_ristretto255_HASHBYTES)
569 ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_reduce);
570 #endif
571 #if defined(crypto_core_ristretto255_HASHBYTES)
572 ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_sub);
573 #endif
574 #if defined(crypto_core_ristretto255_HASHBYTES)
575 ZEND_FUNCTION(sodium_crypto_core_ristretto255_sub);
576 #endif
577 ZEND_FUNCTION(sodium_crypto_kx_keypair);
578 ZEND_FUNCTION(sodium_crypto_kx_publickey);
579 ZEND_FUNCTION(sodium_crypto_kx_secretkey);
580 ZEND_FUNCTION(sodium_crypto_kx_seed_keypair);
581 ZEND_FUNCTION(sodium_crypto_kx_client_session_keys);
582 ZEND_FUNCTION(sodium_crypto_kx_server_session_keys);
583 ZEND_FUNCTION(sodium_crypto_generichash);
584 ZEND_FUNCTION(sodium_crypto_generichash_keygen);
585 ZEND_FUNCTION(sodium_crypto_generichash_init);
586 ZEND_FUNCTION(sodium_crypto_generichash_update);
587 ZEND_FUNCTION(sodium_crypto_generichash_final);
588 ZEND_FUNCTION(sodium_crypto_kdf_derive_from_key);
589 ZEND_FUNCTION(sodium_crypto_kdf_keygen);
590 #if defined(crypto_pwhash_SALTBYTES)
591 ZEND_FUNCTION(sodium_crypto_pwhash);
592 #endif
593 #if defined(crypto_pwhash_SALTBYTES)
594 ZEND_FUNCTION(sodium_crypto_pwhash_str);
595 #endif
596 #if defined(crypto_pwhash_SALTBYTES)
597 ZEND_FUNCTION(sodium_crypto_pwhash_str_verify);
598 #endif
599 #if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
600 ZEND_FUNCTION(sodium_crypto_pwhash_str_needs_rehash);
601 #endif
602 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
603 ZEND_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256);
604 #endif
605 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
606 ZEND_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256_str);
607 #endif
608 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
609 ZEND_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256_str_verify);
610 #endif
611 ZEND_FUNCTION(sodium_crypto_scalarmult);
612 #if defined(crypto_core_ristretto255_HASHBYTES)
613 ZEND_FUNCTION(sodium_crypto_scalarmult_ristretto255);
614 #endif
615 #if defined(crypto_core_ristretto255_HASHBYTES)
616 ZEND_FUNCTION(sodium_crypto_scalarmult_ristretto255_base);
617 #endif
618 ZEND_FUNCTION(sodium_crypto_secretbox);
619 ZEND_FUNCTION(sodium_crypto_secretbox_keygen);
620 ZEND_FUNCTION(sodium_crypto_secretbox_open);
621 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
622 ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_keygen);
623 #endif
624 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
625 ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_init_push);
626 #endif
627 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
628 ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_push);
629 #endif
630 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
631 ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_init_pull);
632 #endif
633 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
634 ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_pull);
635 #endif
636 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
637 ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_rekey);
638 #endif
639 ZEND_FUNCTION(sodium_crypto_shorthash);
640 ZEND_FUNCTION(sodium_crypto_shorthash_keygen);
641 ZEND_FUNCTION(sodium_crypto_sign);
642 ZEND_FUNCTION(sodium_crypto_sign_detached);
643 ZEND_FUNCTION(sodium_crypto_sign_ed25519_pk_to_curve25519);
644 ZEND_FUNCTION(sodium_crypto_sign_ed25519_sk_to_curve25519);
645 ZEND_FUNCTION(sodium_crypto_sign_keypair);
646 ZEND_FUNCTION(sodium_crypto_sign_keypair_from_secretkey_and_publickey);
647 ZEND_FUNCTION(sodium_crypto_sign_open);
648 ZEND_FUNCTION(sodium_crypto_sign_publickey);
649 ZEND_FUNCTION(sodium_crypto_sign_secretkey);
650 ZEND_FUNCTION(sodium_crypto_sign_publickey_from_secretkey);
651 ZEND_FUNCTION(sodium_crypto_sign_seed_keypair);
652 ZEND_FUNCTION(sodium_crypto_sign_verify_detached);
653 ZEND_FUNCTION(sodium_crypto_stream);
654 ZEND_FUNCTION(sodium_crypto_stream_keygen);
655 ZEND_FUNCTION(sodium_crypto_stream_xor);
656 #if defined(crypto_stream_xchacha20_KEYBYTES)
657 ZEND_FUNCTION(sodium_crypto_stream_xchacha20);
658 #endif
659 #if defined(crypto_stream_xchacha20_KEYBYTES)
660 ZEND_FUNCTION(sodium_crypto_stream_xchacha20_keygen);
661 #endif
662 #if defined(crypto_stream_xchacha20_KEYBYTES)
663 ZEND_FUNCTION(sodium_crypto_stream_xchacha20_xor);
664 #endif
665 ZEND_FUNCTION(sodium_add);
666 ZEND_FUNCTION(sodium_compare);
667 ZEND_FUNCTION(sodium_increment);
668 ZEND_FUNCTION(sodium_memcmp);
669 ZEND_FUNCTION(sodium_memzero);
670 ZEND_FUNCTION(sodium_pad);
671 ZEND_FUNCTION(sodium_unpad);
672 ZEND_FUNCTION(sodium_bin2hex);
673 ZEND_FUNCTION(sodium_hex2bin);
674 #if defined(sodium_base64_VARIANT_ORIGINAL)
675 ZEND_FUNCTION(sodium_bin2base64);
676 #endif
677 #if defined(sodium_base64_VARIANT_ORIGINAL)
678 ZEND_FUNCTION(sodium_base642bin);
679 #endif
680 
681 
682 static const zend_function_entry ext_functions[] = {
683 	ZEND_FE(sodium_crypto_aead_aes256gcm_is_available, arginfo_sodium_crypto_aead_aes256gcm_is_available)
684 #if defined(HAVE_AESGCM)
685 	ZEND_FE(sodium_crypto_aead_aes256gcm_decrypt, arginfo_sodium_crypto_aead_aes256gcm_decrypt)
686 #endif
687 #if defined(HAVE_AESGCM)
688 	ZEND_FE(sodium_crypto_aead_aes256gcm_encrypt, arginfo_sodium_crypto_aead_aes256gcm_encrypt)
689 #endif
690 #if defined(HAVE_AESGCM)
691 	ZEND_FE(sodium_crypto_aead_aes256gcm_keygen, arginfo_sodium_crypto_aead_aes256gcm_keygen)
692 #endif
693 	ZEND_FE(sodium_crypto_aead_chacha20poly1305_decrypt, arginfo_sodium_crypto_aead_chacha20poly1305_decrypt)
694 	ZEND_FE(sodium_crypto_aead_chacha20poly1305_encrypt, arginfo_sodium_crypto_aead_chacha20poly1305_encrypt)
695 	ZEND_FE(sodium_crypto_aead_chacha20poly1305_keygen, arginfo_sodium_crypto_aead_chacha20poly1305_keygen)
696 	ZEND_FE(sodium_crypto_aead_chacha20poly1305_ietf_decrypt, arginfo_sodium_crypto_aead_chacha20poly1305_ietf_decrypt)
697 	ZEND_FE(sodium_crypto_aead_chacha20poly1305_ietf_encrypt, arginfo_sodium_crypto_aead_chacha20poly1305_ietf_encrypt)
698 	ZEND_FE(sodium_crypto_aead_chacha20poly1305_ietf_keygen, arginfo_sodium_crypto_aead_chacha20poly1305_ietf_keygen)
699 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
700 	ZEND_FE(sodium_crypto_aead_xchacha20poly1305_ietf_decrypt, arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_decrypt)
701 #endif
702 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
703 	ZEND_FE(sodium_crypto_aead_xchacha20poly1305_ietf_keygen, arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_keygen)
704 #endif
705 #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
706 	ZEND_FE(sodium_crypto_aead_xchacha20poly1305_ietf_encrypt, arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_encrypt)
707 #endif
708 	ZEND_FE(sodium_crypto_auth, arginfo_sodium_crypto_auth)
709 	ZEND_FE(sodium_crypto_auth_keygen, arginfo_sodium_crypto_auth_keygen)
710 	ZEND_FE(sodium_crypto_auth_verify, arginfo_sodium_crypto_auth_verify)
711 	ZEND_FE(sodium_crypto_box, arginfo_sodium_crypto_box)
712 	ZEND_FE(sodium_crypto_box_keypair, arginfo_sodium_crypto_box_keypair)
713 	ZEND_FE(sodium_crypto_box_seed_keypair, arginfo_sodium_crypto_box_seed_keypair)
714 	ZEND_FE(sodium_crypto_box_keypair_from_secretkey_and_publickey, arginfo_sodium_crypto_box_keypair_from_secretkey_and_publickey)
715 	ZEND_FE(sodium_crypto_box_open, arginfo_sodium_crypto_box_open)
716 	ZEND_FE(sodium_crypto_box_publickey, arginfo_sodium_crypto_box_publickey)
717 	ZEND_FE(sodium_crypto_box_publickey_from_secretkey, arginfo_sodium_crypto_box_publickey_from_secretkey)
718 	ZEND_FE(sodium_crypto_box_seal, arginfo_sodium_crypto_box_seal)
719 	ZEND_FE(sodium_crypto_box_seal_open, arginfo_sodium_crypto_box_seal_open)
720 	ZEND_FE(sodium_crypto_box_secretkey, arginfo_sodium_crypto_box_secretkey)
721 #if defined(crypto_core_ristretto255_HASHBYTES)
722 	ZEND_FE(sodium_crypto_core_ristretto255_add, arginfo_sodium_crypto_core_ristretto255_add)
723 #endif
724 #if defined(crypto_core_ristretto255_HASHBYTES)
725 	ZEND_FE(sodium_crypto_core_ristretto255_from_hash, arginfo_sodium_crypto_core_ristretto255_from_hash)
726 #endif
727 #if defined(crypto_core_ristretto255_HASHBYTES)
728 	ZEND_FE(sodium_crypto_core_ristretto255_is_valid_point, arginfo_sodium_crypto_core_ristretto255_is_valid_point)
729 #endif
730 #if defined(crypto_core_ristretto255_HASHBYTES)
731 	ZEND_FE(sodium_crypto_core_ristretto255_random, arginfo_sodium_crypto_core_ristretto255_random)
732 #endif
733 #if defined(crypto_core_ristretto255_HASHBYTES)
734 	ZEND_FE(sodium_crypto_core_ristretto255_scalar_add, arginfo_sodium_crypto_core_ristretto255_scalar_add)
735 #endif
736 #if defined(crypto_core_ristretto255_HASHBYTES)
737 	ZEND_FE(sodium_crypto_core_ristretto255_scalar_complement, arginfo_sodium_crypto_core_ristretto255_scalar_complement)
738 #endif
739 #if defined(crypto_core_ristretto255_HASHBYTES)
740 	ZEND_FE(sodium_crypto_core_ristretto255_scalar_invert, arginfo_sodium_crypto_core_ristretto255_scalar_invert)
741 #endif
742 #if defined(crypto_core_ristretto255_HASHBYTES)
743 	ZEND_FE(sodium_crypto_core_ristretto255_scalar_mul, arginfo_sodium_crypto_core_ristretto255_scalar_mul)
744 #endif
745 #if defined(crypto_core_ristretto255_HASHBYTES)
746 	ZEND_FE(sodium_crypto_core_ristretto255_scalar_negate, arginfo_sodium_crypto_core_ristretto255_scalar_negate)
747 #endif
748 #if defined(crypto_core_ristretto255_HASHBYTES)
749 	ZEND_FE(sodium_crypto_core_ristretto255_scalar_random, arginfo_sodium_crypto_core_ristretto255_scalar_random)
750 #endif
751 #if defined(crypto_core_ristretto255_HASHBYTES)
752 	ZEND_FE(sodium_crypto_core_ristretto255_scalar_reduce, arginfo_sodium_crypto_core_ristretto255_scalar_reduce)
753 #endif
754 #if defined(crypto_core_ristretto255_HASHBYTES)
755 	ZEND_FE(sodium_crypto_core_ristretto255_scalar_sub, arginfo_sodium_crypto_core_ristretto255_scalar_sub)
756 #endif
757 #if defined(crypto_core_ristretto255_HASHBYTES)
758 	ZEND_FE(sodium_crypto_core_ristretto255_sub, arginfo_sodium_crypto_core_ristretto255_sub)
759 #endif
760 	ZEND_FE(sodium_crypto_kx_keypair, arginfo_sodium_crypto_kx_keypair)
761 	ZEND_FE(sodium_crypto_kx_publickey, arginfo_sodium_crypto_kx_publickey)
762 	ZEND_FE(sodium_crypto_kx_secretkey, arginfo_sodium_crypto_kx_secretkey)
763 	ZEND_FE(sodium_crypto_kx_seed_keypair, arginfo_sodium_crypto_kx_seed_keypair)
764 	ZEND_FE(sodium_crypto_kx_client_session_keys, arginfo_sodium_crypto_kx_client_session_keys)
765 	ZEND_FE(sodium_crypto_kx_server_session_keys, arginfo_sodium_crypto_kx_server_session_keys)
766 	ZEND_FE(sodium_crypto_generichash, arginfo_sodium_crypto_generichash)
767 	ZEND_FE(sodium_crypto_generichash_keygen, arginfo_sodium_crypto_generichash_keygen)
768 	ZEND_FE(sodium_crypto_generichash_init, arginfo_sodium_crypto_generichash_init)
769 	ZEND_FE(sodium_crypto_generichash_update, arginfo_sodium_crypto_generichash_update)
770 	ZEND_FE(sodium_crypto_generichash_final, arginfo_sodium_crypto_generichash_final)
771 	ZEND_FE(sodium_crypto_kdf_derive_from_key, arginfo_sodium_crypto_kdf_derive_from_key)
772 	ZEND_FE(sodium_crypto_kdf_keygen, arginfo_sodium_crypto_kdf_keygen)
773 #if defined(crypto_pwhash_SALTBYTES)
774 	ZEND_FE(sodium_crypto_pwhash, arginfo_sodium_crypto_pwhash)
775 #endif
776 #if defined(crypto_pwhash_SALTBYTES)
777 	ZEND_FE(sodium_crypto_pwhash_str, arginfo_sodium_crypto_pwhash_str)
778 #endif
779 #if defined(crypto_pwhash_SALTBYTES)
780 	ZEND_FE(sodium_crypto_pwhash_str_verify, arginfo_sodium_crypto_pwhash_str_verify)
781 #endif
782 #if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
783 	ZEND_FE(sodium_crypto_pwhash_str_needs_rehash, arginfo_sodium_crypto_pwhash_str_needs_rehash)
784 #endif
785 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
786 	ZEND_FE(sodium_crypto_pwhash_scryptsalsa208sha256, arginfo_sodium_crypto_pwhash_scryptsalsa208sha256)
787 #endif
788 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
789 	ZEND_FE(sodium_crypto_pwhash_scryptsalsa208sha256_str, arginfo_sodium_crypto_pwhash_scryptsalsa208sha256_str)
790 #endif
791 #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
792 	ZEND_FE(sodium_crypto_pwhash_scryptsalsa208sha256_str_verify, arginfo_sodium_crypto_pwhash_scryptsalsa208sha256_str_verify)
793 #endif
794 	ZEND_FE(sodium_crypto_scalarmult, arginfo_sodium_crypto_scalarmult)
795 #if defined(crypto_core_ristretto255_HASHBYTES)
796 	ZEND_FE(sodium_crypto_scalarmult_ristretto255, arginfo_sodium_crypto_scalarmult_ristretto255)
797 #endif
798 #if defined(crypto_core_ristretto255_HASHBYTES)
799 	ZEND_FE(sodium_crypto_scalarmult_ristretto255_base, arginfo_sodium_crypto_scalarmult_ristretto255_base)
800 #endif
801 	ZEND_FE(sodium_crypto_secretbox, arginfo_sodium_crypto_secretbox)
802 	ZEND_FE(sodium_crypto_secretbox_keygen, arginfo_sodium_crypto_secretbox_keygen)
803 	ZEND_FE(sodium_crypto_secretbox_open, arginfo_sodium_crypto_secretbox_open)
804 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
805 	ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_keygen, arginfo_sodium_crypto_secretstream_xchacha20poly1305_keygen)
806 #endif
807 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
808 	ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_init_push, arginfo_sodium_crypto_secretstream_xchacha20poly1305_init_push)
809 #endif
810 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
811 	ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_push, arginfo_sodium_crypto_secretstream_xchacha20poly1305_push)
812 #endif
813 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
814 	ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_init_pull, arginfo_sodium_crypto_secretstream_xchacha20poly1305_init_pull)
815 #endif
816 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
817 	ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_pull, arginfo_sodium_crypto_secretstream_xchacha20poly1305_pull)
818 #endif
819 #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
820 	ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_rekey, arginfo_sodium_crypto_secretstream_xchacha20poly1305_rekey)
821 #endif
822 	ZEND_FE(sodium_crypto_shorthash, arginfo_sodium_crypto_shorthash)
823 	ZEND_FE(sodium_crypto_shorthash_keygen, arginfo_sodium_crypto_shorthash_keygen)
824 	ZEND_FE(sodium_crypto_sign, arginfo_sodium_crypto_sign)
825 	ZEND_FE(sodium_crypto_sign_detached, arginfo_sodium_crypto_sign_detached)
826 	ZEND_FE(sodium_crypto_sign_ed25519_pk_to_curve25519, arginfo_sodium_crypto_sign_ed25519_pk_to_curve25519)
827 	ZEND_FE(sodium_crypto_sign_ed25519_sk_to_curve25519, arginfo_sodium_crypto_sign_ed25519_sk_to_curve25519)
828 	ZEND_FE(sodium_crypto_sign_keypair, arginfo_sodium_crypto_sign_keypair)
829 	ZEND_FE(sodium_crypto_sign_keypair_from_secretkey_and_publickey, arginfo_sodium_crypto_sign_keypair_from_secretkey_and_publickey)
830 	ZEND_FE(sodium_crypto_sign_open, arginfo_sodium_crypto_sign_open)
831 	ZEND_FE(sodium_crypto_sign_publickey, arginfo_sodium_crypto_sign_publickey)
832 	ZEND_FE(sodium_crypto_sign_secretkey, arginfo_sodium_crypto_sign_secretkey)
833 	ZEND_FE(sodium_crypto_sign_publickey_from_secretkey, arginfo_sodium_crypto_sign_publickey_from_secretkey)
834 	ZEND_FE(sodium_crypto_sign_seed_keypair, arginfo_sodium_crypto_sign_seed_keypair)
835 	ZEND_FE(sodium_crypto_sign_verify_detached, arginfo_sodium_crypto_sign_verify_detached)
836 	ZEND_FE(sodium_crypto_stream, arginfo_sodium_crypto_stream)
837 	ZEND_FE(sodium_crypto_stream_keygen, arginfo_sodium_crypto_stream_keygen)
838 	ZEND_FE(sodium_crypto_stream_xor, arginfo_sodium_crypto_stream_xor)
839 #if defined(crypto_stream_xchacha20_KEYBYTES)
840 	ZEND_FE(sodium_crypto_stream_xchacha20, arginfo_sodium_crypto_stream_xchacha20)
841 #endif
842 #if defined(crypto_stream_xchacha20_KEYBYTES)
843 	ZEND_FE(sodium_crypto_stream_xchacha20_keygen, arginfo_sodium_crypto_stream_xchacha20_keygen)
844 #endif
845 #if defined(crypto_stream_xchacha20_KEYBYTES)
846 	ZEND_FE(sodium_crypto_stream_xchacha20_xor, arginfo_sodium_crypto_stream_xchacha20_xor)
847 #endif
848 	ZEND_FE(sodium_add, arginfo_sodium_add)
849 	ZEND_FE(sodium_compare, arginfo_sodium_compare)
850 	ZEND_FE(sodium_increment, arginfo_sodium_increment)
851 	ZEND_FE(sodium_memcmp, arginfo_sodium_memcmp)
852 	ZEND_FE(sodium_memzero, arginfo_sodium_memzero)
853 	ZEND_FE(sodium_pad, arginfo_sodium_pad)
854 	ZEND_FE(sodium_unpad, arginfo_sodium_unpad)
855 	ZEND_FE(sodium_bin2hex, arginfo_sodium_bin2hex)
856 	ZEND_FE(sodium_hex2bin, arginfo_sodium_hex2bin)
857 #if defined(sodium_base64_VARIANT_ORIGINAL)
858 	ZEND_FE(sodium_bin2base64, arginfo_sodium_bin2base64)
859 #endif
860 #if defined(sodium_base64_VARIANT_ORIGINAL)
861 	ZEND_FE(sodium_base642bin, arginfo_sodium_base642bin)
862 #endif
863 	ZEND_FALIAS(sodium_crypto_scalarmult_base, sodium_crypto_box_publickey_from_secretkey, arginfo_sodium_crypto_scalarmult_base)
864 	ZEND_FE_END
865 };
866 
867 
868 static const zend_function_entry class_SodiumException_methods[] = {
869 	ZEND_FE_END
870 };
871 
register_class_SodiumException(zend_class_entry * class_entry_Exception)872 static zend_class_entry *register_class_SodiumException(zend_class_entry *class_entry_Exception)
873 {
874 	zend_class_entry ce, *class_entry;
875 
876 	INIT_CLASS_ENTRY(ce, "SodiumException", class_SodiumException_methods);
877 	class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
878 
879 	return class_entry;
880 }
881