xref: /PHP-8.2/ext/sodium/libsodium.stub.php (revision 4679805c)
1<?php
2
3/** @generate-class-entries */
4
5/**
6 * @var string
7 * @cvalue SODIUM_LIBRARY_VERSION()
8 */
9const SODIUM_LIBRARY_VERSION = UNKNOWN;
10/**
11 * @var int
12 * @cvalue sodium_library_version_major()
13 */
14const SODIUM_LIBRARY_MAJOR_VERSION = UNKNOWN;
15/**
16 * @var int
17 * @cvalue sodium_library_version_minor()
18 */
19const SODIUM_LIBRARY_MINOR_VERSION = UNKNOWN;
20#ifdef HAVE_AESGCM
21/**
22 * @var int
23 * @cvalue crypto_aead_aes256gcm_KEYBYTES
24 */
25const SODIUM_CRYPTO_AEAD_AES256GCM_KEYBYTES = UNKNOWN;
26/**
27 * @var int
28 * @cvalue crypto_aead_aes256gcm_NSECBYTES
29 */
30const SODIUM_CRYPTO_AEAD_AES256GCM_NSECBYTES = UNKNOWN;
31/**
32 * @var int
33 * @cvalue crypto_aead_aes256gcm_NPUBBYTES
34 */
35const SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES = UNKNOWN;
36/**
37 * @var int
38 * @cvalue crypto_aead_aes256gcm_ABYTES
39 */
40const SODIUM_CRYPTO_AEAD_AES256GCM_ABYTES = UNKNOWN;
41#endif
42
43/**
44 * @var int
45 * @cvalue crypto_aead_chacha20poly1305_KEYBYTES
46 */
47const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = UNKNOWN;
48/**
49 * @var int
50 * @cvalue crypto_aead_chacha20poly1305_NSECBYTES
51 */
52const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = UNKNOWN;
53/**
54 * @var int
55 * @cvalue crypto_aead_chacha20poly1305_NPUBBYTES
56 */
57const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES = UNKNOWN;
58/**
59 * @var int
60 * @cvalue crypto_aead_chacha20poly1305_ABYTES
61 */
62const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_ABYTES = UNKNOWN;
63/**
64 * @var int
65 * @cvalue crypto_aead_chacha20poly1305_IETF_KEYBYTES
66 */
67const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES = UNKNOWN;
68/**
69 * @var int
70 * @cvalue crypto_aead_chacha20poly1305_IETF_NSECBYTES
71 */
72const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES = UNKNOWN;
73/**
74 * @var int
75 * @cvalue crypto_aead_chacha20poly1305_IETF_NPUBBYTES
76 */
77const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES = UNKNOWN;
78/**
79 * @var int
80 * @cvalue crypto_aead_chacha20poly1305_IETF_ABYTES
81 */
82const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES = UNKNOWN;
83#ifdef crypto_aead_xchacha20poly1305_IETF_NPUBBYTES
84/**
85 * @var int
86 * @cvalue crypto_aead_xchacha20poly1305_IETF_KEYBYTES
87 */
88const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES = UNKNOWN;
89/**
90 * @var int
91 * @cvalue crypto_aead_xchacha20poly1305_IETF_NSECBYTES
92 */
93const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES = UNKNOWN;
94/**
95 * @var int
96 * @cvalue crypto_aead_xchacha20poly1305_IETF_NPUBBYTES
97 */
98const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES = UNKNOWN;
99/**
100 * @var int
101 * @cvalue crypto_aead_xchacha20poly1305_IETF_ABYTES
102 */
103const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES = UNKNOWN;
104#endif
105/**
106 * @var int
107 * @cvalue crypto_auth_BYTES
108 */
109const SODIUM_CRYPTO_AUTH_BYTES = UNKNOWN;
110/**
111 * @var int
112 * @cvalue crypto_auth_KEYBYTES
113 */
114const SODIUM_CRYPTO_AUTH_KEYBYTES = UNKNOWN;
115/**
116 * @var int
117 * @cvalue crypto_box_SEALBYTES
118 */
119const SODIUM_CRYPTO_BOX_SEALBYTES = UNKNOWN;
120/**
121 * @var int
122 * @cvalue crypto_box_SECRETKEYBYTES
123 */
124const SODIUM_CRYPTO_BOX_SECRETKEYBYTES = UNKNOWN;
125/**
126 * @var int
127 * @cvalue crypto_box_PUBLICKEYBYTES
128 */
129const SODIUM_CRYPTO_BOX_PUBLICKEYBYTES = UNKNOWN;
130/**
131 * @var int
132 * @cvalue SODIUM_CRYPTO_BOX_KEYPAIRBYTES()
133 */
134const SODIUM_CRYPTO_BOX_KEYPAIRBYTES = UNKNOWN;
135/**
136 * @var int
137 * @cvalue crypto_box_MACBYTES
138 */
139const SODIUM_CRYPTO_BOX_MACBYTES = UNKNOWN;
140/**
141 * @var int
142 * @cvalue crypto_box_NONCEBYTES
143 */
144const SODIUM_CRYPTO_BOX_NONCEBYTES = UNKNOWN;
145/**
146 * @var int
147 * @cvalue crypto_box_SEEDBYTES
148 */
149const SODIUM_CRYPTO_BOX_SEEDBYTES = UNKNOWN;
150
151/**
152 * @var int
153 * @cvalue crypto_kdf_BYTES_MIN
154 */
155const SODIUM_CRYPTO_KDF_BYTES_MIN = UNKNOWN;
156/**
157 * @var int
158 * @cvalue crypto_kdf_BYTES_MAX
159 */
160const SODIUM_CRYPTO_KDF_BYTES_MAX = UNKNOWN;
161/**
162 * @var int
163 * @cvalue crypto_kdf_CONTEXTBYTES
164 */
165const SODIUM_CRYPTO_KDF_CONTEXTBYTES = UNKNOWN;
166/**
167 * @var int
168 * @cvalue crypto_kdf_KEYBYTES
169 */
170const SODIUM_CRYPTO_KDF_KEYBYTES = UNKNOWN;
171
172/**
173 * @var int
174 * @cvalue crypto_kx_SEEDBYTES
175 */
176const SODIUM_CRYPTO_KX_SEEDBYTES = UNKNOWN;
177/**
178 * @var int
179 * @cvalue crypto_kx_SESSIONKEYBYTES
180 */
181const SODIUM_CRYPTO_KX_SESSIONKEYBYTES = UNKNOWN;
182/**
183 * @var int
184 * @cvalue crypto_kx_PUBLICKEYBYTES
185 */
186const SODIUM_CRYPTO_KX_PUBLICKEYBYTES = UNKNOWN;
187/**
188 * @var int
189 * @cvalue crypto_kx_SECRETKEYBYTES
190 */
191const SODIUM_CRYPTO_KX_SECRETKEYBYTES = UNKNOWN;
192/**
193 * @var int
194 * @cvalue SODIUM_CRYPTO_KX_KEYPAIRBYTES()
195 */
196const SODIUM_CRYPTO_KX_KEYPAIRBYTES = UNKNOWN;
197#ifdef crypto_secretstream_xchacha20poly1305_ABYTES
198/**
199 * @var int
200 * @cvalue crypto_secretstream_xchacha20poly1305_ABYTES
201 */
202const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES = UNKNOWN;
203/**
204 * @var int
205 * @cvalue crypto_secretstream_xchacha20poly1305_HEADERBYTES
206 */
207const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES = UNKNOWN;
208/**
209 * @var int
210 * @cvalue crypto_secretstream_xchacha20poly1305_KEYBYTES
211 */
212const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES = UNKNOWN;
213/**
214 * @var int
215 * @cvalue crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX
216 */
217const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX = UNKNOWN;
218/**
219 * @var int
220 * @cvalue crypto_secretstream_xchacha20poly1305_TAG_MESSAGE
221 */
222const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE = UNKNOWN;
223/**
224 * @var int
225 * @cvalue crypto_secretstream_xchacha20poly1305_TAG_PUSH
226 */
227const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH = UNKNOWN;
228/**
229 * @var int
230 * @cvalue crypto_secretstream_xchacha20poly1305_TAG_REKEY
231 */
232const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY = UNKNOWN;
233/**
234 * @var int
235 * @cvalue crypto_secretstream_xchacha20poly1305_TAG_FINAL
236 */
237const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL = UNKNOWN;
238#endif
239
240/**
241 * @var int
242 * @cvalue crypto_generichash_BYTES
243 */
244const SODIUM_CRYPTO_GENERICHASH_BYTES = UNKNOWN;
245/**
246 * @var int
247 * @cvalue crypto_generichash_BYTES_MIN
248 */
249const SODIUM_CRYPTO_GENERICHASH_BYTES_MIN = UNKNOWN;
250/**
251 * @var int
252 * @cvalue crypto_generichash_BYTES_MAX
253 */
254const SODIUM_CRYPTO_GENERICHASH_BYTES_MAX = UNKNOWN;
255/**
256 * @var int
257 * @cvalue crypto_generichash_KEYBYTES
258 */
259const SODIUM_CRYPTO_GENERICHASH_KEYBYTES = UNKNOWN;
260/**
261 * @var int
262 * @cvalue crypto_generichash_KEYBYTES_MIN
263 */
264const SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MIN = UNKNOWN;
265/**
266 * @var int
267 * @cvalue crypto_generichash_KEYBYTES_MAX
268 */
269const SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MAX = UNKNOWN;
270#ifdef crypto_pwhash_SALTBYTES
271/**
272 * @var int
273 * @cvalue crypto_pwhash_ALG_ARGON2I13
274 */
275const SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13 = UNKNOWN;
276# ifdef crypto_pwhash_ALG_ARGON2ID13
277/**
278 * @var int
279 * @cvalue crypto_pwhash_ALG_ARGON2ID13
280 */
281const SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 = UNKNOWN;
282# endif
283/**
284 * @var int
285 * @cvalue crypto_pwhash_ALG_DEFAULT
286 */
287const SODIUM_CRYPTO_PWHASH_ALG_DEFAULT = UNKNOWN;
288/**
289 * @var int
290 * @cvalue crypto_pwhash_SALTBYTES
291 */
292const SODIUM_CRYPTO_PWHASH_SALTBYTES = UNKNOWN;
293/**
294 * @var string
295 * @cvalue crypto_pwhash_STRPREFIX
296 */
297const SODIUM_CRYPTO_PWHASH_STRPREFIX = UNKNOWN;
298/**
299 * @var int
300 * @cvalue crypto_pwhash_opslimit_interactive()
301 */
302const SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE = UNKNOWN;
303/**
304 * @var int
305 * @cvalue crypto_pwhash_memlimit_interactive()
306 */
307const SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE = UNKNOWN;
308/**
309 * @var int
310 * @cvalue crypto_pwhash_opslimit_moderate()
311 */
312const SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE = UNKNOWN;
313/**
314 * @var int
315 * @cvalue crypto_pwhash_memlimit_moderate()
316 */
317const SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE = UNKNOWN;
318/**
319 * @var int
320 * @cvalue crypto_pwhash_opslimit_sensitive()
321 */
322const SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE = UNKNOWN;
323/**
324 * @var int
325 * @cvalue crypto_pwhash_memlimit_sensitive()
326 */
327const SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE = UNKNOWN;
328#endif
329#ifdef crypto_pwhash_scryptsalsa208sha256_SALTBYTES
330/**
331 * @var int
332 * @cvalue crypto_pwhash_scryptsalsa208sha256_SALTBYTES
333 */
334const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES = UNKNOWN;
335/**
336 * @var string
337 * @cvalue crypto_pwhash_scryptsalsa208sha256_STRPREFIX
338 */
339const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX = UNKNOWN;
340/**
341 * @var int
342 * @cvalue crypto_pwhash_scryptsalsa208sha256_opslimit_interactive()
343 */
344const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE = UNKNOWN;
345/**
346 * @var int
347 * @cvalue crypto_pwhash_scryptsalsa208sha256_memlimit_interactive()
348 */
349const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE = UNKNOWN;
350/**
351 * @var int
352 * @cvalue crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive()
353 */
354const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE = UNKNOWN;
355/**
356 * @var int
357 * @cvalue crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive()
358 */
359const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE = UNKNOWN;
360#endif
361
362/**
363 * @var int
364 * @cvalue crypto_scalarmult_BYTES
365 */
366const SODIUM_CRYPTO_SCALARMULT_BYTES = UNKNOWN;
367/**
368 * @var int
369 * @cvalue crypto_scalarmult_SCALARBYTES
370 */
371const SODIUM_CRYPTO_SCALARMULT_SCALARBYTES = UNKNOWN;
372/**
373 * @var int
374 * @cvalue crypto_shorthash_BYTES
375 */
376const SODIUM_CRYPTO_SHORTHASH_BYTES = UNKNOWN;
377/**
378 * @var int
379 * @cvalue crypto_shorthash_KEYBYTES
380 */
381const SODIUM_CRYPTO_SHORTHASH_KEYBYTES = UNKNOWN;
382/**
383 * @var int
384 * @cvalue crypto_secretbox_KEYBYTES
385 */
386const SODIUM_CRYPTO_SECRETBOX_KEYBYTES = UNKNOWN;
387/**
388 * @var int
389 * @cvalue crypto_secretbox_MACBYTES
390 */
391const SODIUM_CRYPTO_SECRETBOX_MACBYTES = UNKNOWN;
392/**
393 * @var int
394 * @cvalue crypto_secretbox_NONCEBYTES
395 */
396const SODIUM_CRYPTO_SECRETBOX_NONCEBYTES = UNKNOWN;
397/**
398 * @var int
399 * @cvalue crypto_sign_BYTES
400 */
401const SODIUM_CRYPTO_SIGN_BYTES = UNKNOWN;
402/**
403 * @var int
404 * @cvalue crypto_sign_SEEDBYTES
405 */
406const SODIUM_CRYPTO_SIGN_SEEDBYTES = UNKNOWN;
407/**
408 * @var int
409 * @cvalue crypto_sign_PUBLICKEYBYTES
410 */
411const SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES = UNKNOWN;
412/**
413 * @var int
414 * @cvalue crypto_sign_SECRETKEYBYTES
415 */
416const SODIUM_CRYPTO_SIGN_SECRETKEYBYTES = UNKNOWN;
417/**
418 * @var int
419 * @cvalue SODIUM_CRYPTO_SIGN_KEYPAIRBYTES()
420 */
421const SODIUM_CRYPTO_SIGN_KEYPAIRBYTES = UNKNOWN;
422/**
423 * @var int
424 * @cvalue crypto_stream_NONCEBYTES
425 */
426const SODIUM_CRYPTO_STREAM_NONCEBYTES = UNKNOWN;
427/**
428 * @var int
429 * @cvalue crypto_stream_KEYBYTES
430 */
431const SODIUM_CRYPTO_STREAM_KEYBYTES = UNKNOWN;
432
433#ifdef crypto_stream_xchacha20_KEYBYTES
434/**
435 * @var int
436 * @cvalue crypto_stream_xchacha20_NONCEBYTES
437 */
438const SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES = UNKNOWN;
439/**
440 * @var int
441 * @cvalue crypto_stream_xchacha20_KEYBYTES
442 */
443const SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES = UNKNOWN;
444#endif
445#ifdef sodium_base64_VARIANT_ORIGINAL
446/**
447 * @var int
448 * @cvalue sodium_base64_VARIANT_ORIGINAL
449 */
450const SODIUM_BASE64_VARIANT_ORIGINAL = UNKNOWN;
451/**
452 * @var int
453 * @cvalue sodium_base64_VARIANT_ORIGINAL_NO_PADDING
454 */
455const SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING = UNKNOWN;
456/**
457 * @var int
458 * @cvalue sodium_base64_VARIANT_URLSAFE
459 */
460const SODIUM_BASE64_VARIANT_URLSAFE = UNKNOWN;
461/**
462 * @var int
463 * @cvalue sodium_base64_VARIANT_URLSAFE_NO_PADDING
464 */
465const SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING = UNKNOWN;
466#endif
467#ifdef crypto_core_ristretto255_HASHBYTES
468/**
469 * @var int
470 * @cvalue crypto_scalarmult_ristretto255_BYTES
471 */
472const SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_BYTES = UNKNOWN;
473/**
474 * @var int
475 * @cvalue crypto_scalarmult_ristretto255_SCALARBYTES
476 */
477const SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES = UNKNOWN;
478/**
479 * @var int
480 * @cvalue crypto_core_ristretto255_BYTES
481 */
482const SODIUM_CRYPTO_CORE_RISTRETTO255_BYTES = UNKNOWN;
483/**
484 * @var int
485 * @cvalue crypto_core_ristretto255_HASHBYTES
486 */
487const SODIUM_CRYPTO_CORE_RISTRETTO255_HASHBYTES = UNKNOWN;
488/**
489 * @var int
490 * @cvalue crypto_core_ristretto255_SCALARBYTES
491 */
492const SODIUM_CRYPTO_CORE_RISTRETTO255_SCALARBYTES = UNKNOWN;
493/**
494 * @var int
495 * @cvalue crypto_core_ristretto255_NONREDUCEDSCALARBYTES
496 */
497const SODIUM_CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES = UNKNOWN;
498#endif
499
500function sodium_crypto_aead_aes256gcm_is_available(): bool {}
501
502#ifdef HAVE_AESGCM
503function sodium_crypto_aead_aes256gcm_decrypt(string $ciphertext, string $additional_data, string $nonce, #[\SensitiveParameter] string $key): string|false {}
504
505function sodium_crypto_aead_aes256gcm_encrypt(#[\SensitiveParameter] string $message, string $additional_data, string $nonce, #[\SensitiveParameter] string $key): string {}
506
507function sodium_crypto_aead_aes256gcm_keygen(): string {}
508#endif
509
510function sodium_crypto_aead_chacha20poly1305_decrypt(string $ciphertext, string $additional_data, string $nonce, #[\SensitiveParameter] string $key): string|false {}
511
512function sodium_crypto_aead_chacha20poly1305_encrypt(#[\SensitiveParameter] string $message, string $additional_data, string $nonce, #[\SensitiveParameter] string $key): string {}
513
514function sodium_crypto_aead_chacha20poly1305_keygen(): string {}
515
516function sodium_crypto_aead_chacha20poly1305_ietf_decrypt(string $ciphertext, string $additional_data, string $nonce, #[\SensitiveParameter] string $key): string|false {}
517
518function sodium_crypto_aead_chacha20poly1305_ietf_encrypt(#[\SensitiveParameter] string $message, string $additional_data, string $nonce, #[\SensitiveParameter] string $key): string {}
519
520function sodium_crypto_aead_chacha20poly1305_ietf_keygen(): string {}
521
522#ifdef crypto_aead_xchacha20poly1305_IETF_NPUBBYTES
523function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt(string $ciphertext, string $additional_data, string $nonce, #[\SensitiveParameter] string $key): string|false {}
524
525function sodium_crypto_aead_xchacha20poly1305_ietf_keygen(): string {}
526
527function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(#[\SensitiveParameter] string $message, string $additional_data, string $nonce, #[\SensitiveParameter] string $key): string {}
528#endif
529
530function sodium_crypto_auth(string $message, #[\SensitiveParameter] string $key): string {}
531
532function sodium_crypto_auth_keygen(): string {}
533
534function sodium_crypto_auth_verify(string $mac, string $message, #[\SensitiveParameter] string $key): bool {}
535
536function sodium_crypto_box(#[\SensitiveParameter] string $message, string $nonce, #[\SensitiveParameter] string $key_pair): string {}
537
538function sodium_crypto_box_keypair(): string {}
539
540function sodium_crypto_box_seed_keypair(#[\SensitiveParameter] string $seed): string {}
541
542function sodium_crypto_box_keypair_from_secretkey_and_publickey(#[\SensitiveParameter] string $secret_key, string $public_key): string {}
543
544function sodium_crypto_box_open(string $ciphertext, string $nonce, #[\SensitiveParameter] string $key_pair): string|false {}
545
546function sodium_crypto_box_publickey(#[\SensitiveParameter] string $key_pair): string {}
547
548function sodium_crypto_box_publickey_from_secretkey(#[\SensitiveParameter] string $secret_key): string {}
549
550function sodium_crypto_box_seal(#[\SensitiveParameter] string $message, string $public_key): string {}
551
552function sodium_crypto_box_seal_open(string $ciphertext, #[\SensitiveParameter] string $key_pair): string|false {}
553
554function sodium_crypto_box_secretkey(#[\SensitiveParameter] string $key_pair): string {}
555
556#ifdef crypto_core_ristretto255_HASHBYTES
557function sodium_crypto_core_ristretto255_add(string $p, string $q): string {}
558
559function sodium_crypto_core_ristretto255_from_hash(string $s): string {}
560
561function sodium_crypto_core_ristretto255_is_valid_point(string $s): bool {}
562
563function sodium_crypto_core_ristretto255_random(): string {}
564
565function sodium_crypto_core_ristretto255_scalar_add(string $x, string $y): string {}
566
567function sodium_crypto_core_ristretto255_scalar_complement(string $s): string {}
568
569function sodium_crypto_core_ristretto255_scalar_invert(string $s): string {}
570
571function sodium_crypto_core_ristretto255_scalar_mul(string $x, string $y): string {}
572
573function sodium_crypto_core_ristretto255_scalar_negate(string $s): string {}
574
575function sodium_crypto_core_ristretto255_scalar_random(): string {}
576
577function sodium_crypto_core_ristretto255_scalar_reduce(string $s): string {}
578
579function sodium_crypto_core_ristretto255_scalar_sub(string $x, string $y): string {}
580
581function sodium_crypto_core_ristretto255_sub(string $p, string $q): string {}
582#endif
583
584function sodium_crypto_kx_keypair(): string {}
585
586function sodium_crypto_kx_publickey(#[\SensitiveParameter] string $key_pair): string {}
587
588function sodium_crypto_kx_secretkey(#[\SensitiveParameter] string $key_pair): string {}
589
590function sodium_crypto_kx_seed_keypair(#[\SensitiveParameter] string $seed): string {}
591
592/**
593 * @return array<int, string>
594 */
595function sodium_crypto_kx_client_session_keys(#[\SensitiveParameter] string $client_key_pair, string $server_key): array {}
596
597/**
598 * @return array<int, string>
599 *
600 */
601function sodium_crypto_kx_server_session_keys(#[\SensitiveParameter] string $server_key_pair, string $client_key): array {}
602
603function sodium_crypto_generichash(string $message, #[\SensitiveParameter] string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {}
604
605function sodium_crypto_generichash_keygen(): string {}
606
607function sodium_crypto_generichash_init(#[\SensitiveParameter] string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {}
608
609function sodium_crypto_generichash_update(string &$state, string $message): true {}
610
611function sodium_crypto_generichash_final(string &$state, int $length = SODIUM_CRYPTO_GENERICHASH_BYTES): string {}
612
613function sodium_crypto_kdf_derive_from_key(int $subkey_length, int $subkey_id, string $context, #[\SensitiveParameter] string $key): string {}
614
615function sodium_crypto_kdf_keygen(): string {}
616
617#ifdef crypto_pwhash_SALTBYTES
618function sodium_crypto_pwhash(int $length, #[\SensitiveParameter] string $password, string $salt, int $opslimit, int $memlimit, int $algo = SODIUM_CRYPTO_PWHASH_ALG_DEFAULT): string {}
619
620function sodium_crypto_pwhash_str(#[\SensitiveParameter] string $password, int $opslimit, int $memlimit): string {}
621
622function sodium_crypto_pwhash_str_verify(string $hash, #[\SensitiveParameter] string $password): bool {}
623#endif
624
625#if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
626function sodium_crypto_pwhash_str_needs_rehash(string $password, int $opslimit, int $memlimit): bool {}
627#endif
628
629#ifdef crypto_pwhash_scryptsalsa208sha256_SALTBYTES
630function sodium_crypto_pwhash_scryptsalsa208sha256(int $length, #[\SensitiveParameter] string $password, string $salt, int $opslimit, int $memlimit): string {}
631
632function sodium_crypto_pwhash_scryptsalsa208sha256_str(#[\SensitiveParameter] string $password, int $opslimit, int $memlimit): string {}
633
634function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify(string $hash, #[\SensitiveParameter] string $password): bool {}
635#endif
636
637function sodium_crypto_scalarmult(string $n, string $p): string {}
638
639#ifdef crypto_core_ristretto255_HASHBYTES
640function sodium_crypto_scalarmult_ristretto255(string $n, string $p): string {}
641
642function sodium_crypto_scalarmult_ristretto255_base(string $n): string {}
643#endif
644
645function sodium_crypto_secretbox(#[\SensitiveParameter] string $message, string $nonce, #[\SensitiveParameter] string $key): string {}
646
647function sodium_crypto_secretbox_keygen(): string {}
648
649function sodium_crypto_secretbox_open(string $ciphertext, string $nonce, #[\SensitiveParameter] string $key): string|false {}
650
651#ifdef crypto_secretstream_xchacha20poly1305_ABYTES
652function sodium_crypto_secretstream_xchacha20poly1305_keygen(): string {}
653
654/**
655 * @return array<int, string>
656 */
657function sodium_crypto_secretstream_xchacha20poly1305_init_push(#[\SensitiveParameter] string $key): array {}
658
659function sodium_crypto_secretstream_xchacha20poly1305_push(string &$state, #[\SensitiveParameter] string $message, string $additional_data = "", int $tag = SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE): string {}
660
661function sodium_crypto_secretstream_xchacha20poly1305_init_pull(string $header, #[\SensitiveParameter] string $key): string {}
662
663/** @return array<int, int|string>|false */
664function sodium_crypto_secretstream_xchacha20poly1305_pull(string &$state, string $ciphertext, string $additional_data = ""): array|false {}
665
666function sodium_crypto_secretstream_xchacha20poly1305_rekey(string &$state): void {}
667#endif
668
669function sodium_crypto_shorthash(string $message, #[\SensitiveParameter] string $key): string {}
670
671function sodium_crypto_shorthash_keygen(): string {}
672
673function sodium_crypto_sign(string $message, #[\SensitiveParameter] string $secret_key): string {}
674
675function sodium_crypto_sign_detached(string $message, #[\SensitiveParameter] string $secret_key): string {}
676
677function sodium_crypto_sign_ed25519_pk_to_curve25519(string $public_key): string {}
678
679function sodium_crypto_sign_ed25519_sk_to_curve25519(#[\SensitiveParameter] string $secret_key): string {}
680
681function sodium_crypto_sign_keypair(): string {}
682
683function sodium_crypto_sign_keypair_from_secretkey_and_publickey(#[\SensitiveParameter] string $secret_key, string $public_key): string {}
684
685function sodium_crypto_sign_open(string $signed_message, string $public_key): string|false {}
686
687function sodium_crypto_sign_publickey(#[\SensitiveParameter] string $key_pair): string {}
688
689function sodium_crypto_sign_secretkey(#[\SensitiveParameter] string $key_pair): string {}
690
691function sodium_crypto_sign_publickey_from_secretkey(#[\SensitiveParameter] string $secret_key): string {}
692
693function sodium_crypto_sign_seed_keypair(#[\SensitiveParameter] string $seed): string {}
694
695function sodium_crypto_sign_verify_detached(string $signature, string $message, string $public_key): bool {}
696
697function sodium_crypto_stream(int $length, string $nonce, #[\SensitiveParameter] string $key): string {}
698
699function sodium_crypto_stream_keygen(): string {}
700
701function sodium_crypto_stream_xor(#[\SensitiveParameter] string $message, string $nonce, #[\SensitiveParameter] string $key): string {}
702
703#if defined(crypto_stream_xchacha20_KEYBYTES)
704function sodium_crypto_stream_xchacha20(int $length, string $nonce, #[\SensitiveParameter] string $key): string {}
705
706function sodium_crypto_stream_xchacha20_keygen(): string {}
707
708function sodium_crypto_stream_xchacha20_xor(#[\SensitiveParameter] string $message, string $nonce, #[\SensitiveParameter] string $key): string {}
709
710function sodium_crypto_stream_xchacha20_xor_ic(#[\SensitiveParameter] string $message, string $nonce, int $counter,#[\SensitiveParameter]  string $key): string {}
711#endif
712
713function sodium_add(string &$string1, string $string2): void {}
714
715function sodium_compare(#[\SensitiveParameter] string $string1, #[\SensitiveParameter] string $string2): int {}
716
717function sodium_increment(string &$string): void {}
718
719function sodium_memcmp(#[\SensitiveParameter] string $string1, #[\SensitiveParameter] string $string2): int {}
720
721function sodium_memzero(#[\SensitiveParameter] string &$string): void {}
722
723function sodium_pad(#[\SensitiveParameter] string $string, int $block_size): string {}
724
725function sodium_unpad(#[\SensitiveParameter] string $string, int $block_size): string {}
726
727function sodium_bin2hex(#[\SensitiveParameter] string $string): string {}
728
729function sodium_hex2bin(#[\SensitiveParameter] string $string, string $ignore = ""): string {}
730
731#ifdef sodium_base64_VARIANT_ORIGINAL
732function sodium_bin2base64(#[\SensitiveParameter] string $string, int $id): string {}
733
734function sodium_base642bin(#[\SensitiveParameter] string $string, int $id, string $ignore = ""): string {}
735#endif
736
737/**
738 * @alias sodium_crypto_box_publickey_from_secretkey
739 */
740function sodium_crypto_scalarmult_base(#[\SensitiveParameter] string $secret_key): string {}
741
742class SodiumException extends Exception {}
743