-
Notifications
You must be signed in to change notification settings - Fork 76
/
libsodium.stub.php
352 lines (237 loc) · 11.1 KB
/
libsodium.stub.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<?php
/** @generate-function-entries */
function sodium_crypto_aead_aes256gcm_is_available
(): bool {}
#ifdef HAVE_AESGCM
function sodium_crypto_aead_aes256gcm_decrypt
(string $ciphertext, string $additional_data, string $nonce, string $key) : string | FALSE {}
function sodium_crypto_aead_aes256gcm_encrypt
(string $message, string $additional_data, string $nonce, string $key) : string {}
function sodium_crypto_aead_aes256gcm_keygen
() : string {}
# ifdef HAVE_AEAD_DETACHED
function sodium_crypto_aead_aes256gcm_decrypt_detached
(string $ciphertext, string $mac, string $additional_data, string $nonce, string $key) : string | FALSE {}
function sodium_crypto_aead_aes256gcm_encrypt_detached
(string $message, string $additional_data, string $nonce, string $key) : array {}
# endif
#endif
function sodium_crypto_aead_chacha20poly1305_decrypt
(string $ciphertext, string $additional_data, string $nonce, string $key) : string | FALSE {}
function sodium_crypto_aead_chacha20poly1305_encrypt
(string $message, string $additional_data, string $nonce, string $key) : string {}
function sodium_crypto_aead_chacha20poly1305_keygen
() : string {}
function sodium_crypto_aead_chacha20poly1305_ietf_decrypt
(string $ciphertext, string $additional_data, string $nonce, string $key) : string | FALSE {}
function sodium_crypto_aead_chacha20poly1305_ietf_encrypt
(string $message, string $additional_data, string $nonce, string $key) : string {}
function sodium_crypto_aead_chacha20poly1305_ietf_keygen
() : string {}
#ifdef HAVE_AEAD_DETACHED
function sodium_crypto_aead_chacha20poly1305_decrypt_detached
(string $ciphertext, string $mac, string $additional_data, string $nonce, string $key) : string | FALSE {}
function sodium_crypto_aead_chacha20poly1305_encrypt_detached
(string $message, string $additional_data, string $nonce, string $key) : array {}
function sodium_crypto_aead_chacha20poly1305_ietf_decrypt_detached
(string $ciphertext, string $mac, string $additional_data, string $nonce, string $key) : string | FALSE {}
function sodium_crypto_aead_chacha20poly1305_ietf_encrypt_detached
(string $message, string $additional_data, string $nonce, string $key) : array {}
#endif
#ifdef crypto_aead_xchacha20poly1305_IETF_NPUBBYTES
function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt
(string $ciphertext, string $additional_data, string $nonce, string $key) : string | FALSE {}
function sodium_crypto_aead_xchacha20poly1305_ietf_keygen
() : string {}
function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt
(string $message, string $additional_data, string $nonce, string $key) : string {}
# ifdef HAVE_AEAD_DETACHED
function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt_detached
(string $ciphertext, string $mac, string $additional_data, string $nonce, string $key) : string | FALSE {}
function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt_detached
(string $message, string $additional_data, string $nonce, string $key) : array {}
# endif
#endif
function sodium_crypto_auth
(string $message, string $key) : string {}
function sodium_crypto_auth_keygen
() : string {}
function sodium_crypto_auth_verify
(string $mac, string $message, string $key) : bool {}
function sodium_crypto_box
(string $message, string $nonce, string $key_pair) : string {}
function sodium_crypto_box_keypair
() : string {}
function sodium_crypto_box_seed_keypair
(string $seed) : string {}
function sodium_crypto_box_keypair_from_secretkey_and_publickey
(string $secret_key, string $public_key) : string {}
function sodium_crypto_box_open
(string $ciphertext, string $nonce, string $key_pair) : string | FALSE {}
function sodium_crypto_box_publickey
(string $key_pair) : string {}
function sodium_crypto_box_publickey_from_secretkey
(string $secret_key) : string {}
function sodium_crypto_box_seal
(string $message, string $key_pair) : string {}
function sodium_crypto_box_seal_open
(string $ciphertext, string $key_pair) : string | FALSE {}
function sodium_crypto_box_secretkey
(string $key_pair) : string {}
#ifdef crypto_core_ristretto255_HASHBYTES
function sodium_crypto_core_ristretto255_add(string $p, string $q): string {}
function sodium_crypto_core_ristretto255_from_hash(string $s): string {}
function sodium_crypto_core_ristretto255_is_valid_point(string $s): bool {}
function sodium_crypto_core_ristretto255_random(): string {}
function sodium_crypto_core_ristretto255_scalar_add(string $p, string $q): string {}
function sodium_crypto_core_ristretto255_scalar_complement(string $s): string {}
function sodium_crypto_core_ristretto255_scalar_invert(string $s): string {}
function sodium_crypto_core_ristretto255_scalar_mul(string $x, string $y): string {}
function sodium_crypto_core_ristretto255_scalar_negate(string $s): string {}
function sodium_crypto_core_ristretto255_scalar_random(): string {}
function sodium_crypto_core_ristretto255_scalar_reduce(string $s): string {}
function sodium_crypto_core_ristretto255_scalar_sub(string $p, string $q): string {}
function sodium_crypto_core_ristretto255_sub(string $p, string $q): string {}
#endif
function sodium_crypto_kx_keypair
() : string {}
function sodium_crypto_kx_publickey
(string $key_pair) : string {}
function sodium_crypto_kx_secretkey
(string $key_pair) : string {}
function sodium_crypto_kx_seed_keypair
(string $seed) : string {}
function sodium_crypto_kx_client_session_keys
(string $client_key_pair, string $server_key) : array {}
function sodium_crypto_kx_server_session_keys
(string $server_key_pair, string $client_key) : array {}
function sodium_crypto_generichash
(string $message, string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES) : string {}
function sodium_crypto_generichash_keygen
() : string {}
function sodium_crypto_generichash_init
(string $key = "", int $length = SODIUM_CRYPTO_GENERICHASH_BYTES) : string {}
function sodium_crypto_generichash_update
(string &$state, string $message) : bool {}
function sodium_crypto_generichash_final
(string &$state, int $length = SODIUM_CRYPTO_GENERICHASH_BYTES) : string {}
function sodium_crypto_kdf_derive_from_key
(int $subkey_length, int $subkey_id, string $context, string $key) : string {}
function sodium_crypto_kdf_keygen
() : string {}
#ifdef crypto_pwhash_SALTBYTES
function sodium_crypto_pwhash
(int $length, string $password, string $salt, int $opslimit, int $memlimit, int $algo = SODIUM_CRYPTO_PWHASH_ALG_DEFAULT) : string {}
function sodium_crypto_pwhash_str
(string $password, int $opslimit, int $memlimit) : string {}
function sodium_crypto_pwhash_str_verify
(string $hash, string $password) : bool {}
#endif
#if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
function sodium_crypto_pwhash_str_needs_rehash
(string $password, int $opslimit, int $memlimit) : bool {}
#endif
#ifdef crypto_pwhash_scryptsalsa208sha256_SALTBYTES
function sodium_crypto_pwhash_scryptsalsa208sha256
(int $length, string $password, string $salt, int $opslimit, int $memlimit) : string {}
function sodium_crypto_pwhash_scryptsalsa208sha256_str
(string $password, int $opslimit, int $memlimit) : string {}
function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify
(string $hash, string $password) : bool {}
#endif
function sodium_crypto_scalarmult
(string $n, string $p) : string {}
#ifdef crypto_core_ristretto255_HASHBYTES
function sodium_crypto_scalarmult_ristretto255(string $n, string $p): string {}
function sodium_crypto_scalarmult_ristretto255_base(string $n): string {}
#endif
function sodium_crypto_secretbox
(string $message, string $nonce, string $key) : string {}
function sodium_crypto_secretbox_keygen
() : string {}
function sodium_crypto_secretbox_open
(string $ciphertext, string $nonce, string $key) : string | FALSE {}
#ifdef crypto_secretstream_xchacha20poly1305_ABYTES
function sodium_crypto_secretstream_xchacha20poly1305_keygen
() : string {}
function sodium_crypto_secretstream_xchacha20poly1305_init_push
(string $key) : array {}
function sodium_crypto_secretstream_xchacha20poly1305_push
(string &$state, string $message, string $additional_data = "", int $tag = SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE) : string {}
function sodium_crypto_secretstream_xchacha20poly1305_init_pull
(string $header, string $key) : string {}
function sodium_crypto_secretstream_xchacha20poly1305_pull
(string &$state, string $ciphertext, string $additional_data = "") : array | FALSE {}
function sodium_crypto_secretstream_xchacha20poly1305_rekey
(string &$state) : void {}
#endif
function sodium_crypto_shorthash
(string $message, string $key) : string {}
function sodium_crypto_shorthash_keygen
() : string {}
function sodium_crypto_sign
(string $message, string $secret_key) : string {}
function sodium_crypto_sign_detached
(string $message, string $secret_key) : string {}
function sodium_crypto_sign_ed25519_pk_to_curve25519
(string $public_key) : string {}
function sodium_crypto_sign_ed25519_sk_to_curve25519
(string $secret_key) : string {}
function sodium_crypto_sign_keypair
() : string {}
function sodium_crypto_sign_keypair_from_secretkey_and_publickey
(string $secret_key, string $public_key) : string {}
function sodium_crypto_sign_open
(string $ciphertext, string $public_key) : string | FALSE {}
function sodium_crypto_sign_publickey
(string $key_pair) : string {}
function sodium_crypto_sign_secretkey
(string $key_pair) : string {}
function sodium_crypto_sign_publickey_from_secretkey
(string $secret_key) : string {}
function sodium_crypto_sign_seed_keypair
(string $seed) : string {}
function sodium_crypto_sign_verify_detached
(string $signature, string $message, string $public_key) : bool {}
function sodium_crypto_stream
(int $length, string $nonce, string $key) : string {}
function sodium_crypto_stream_keygen
() : string {}
function sodium_crypto_stream_xor
(string $message, string $nonce, string $key) : string {}
function sodium_crypto_stream_xchacha20
(int $length, string $nonce, string $key) : string {}
function sodium_crypto_stream_xchacha20_keygen
() : string {}
function sodium_crypto_stream_xchacha20_xor
(string $message, string $nonce, string $key) : string {}
/* ----- helpers ----- */
function sodium_add
(string &$string1, string $string2) : void {}
function sodium_compare
(string $string1, string $string2) : int {}
function sodium_increment
(string &$string) : void {}
function sodium_memcmp
(string $string1, string $string2) : int {}
function sodium_memzero
(string &$string) : void {}
function sodium_pad
(string $string, int $length) : string {}
function sodium_unpad
(string $string, int $block_size) : string {}
/* ----- codecs ----- */
function sodium_bin2hex
(string $string) : string {}
function sodium_hex2bin
(string $string, string $ignore = "") : string {}
#ifdef sodium_base64_VARIANT_ORIGINAL
function sodium_bin2base64
(string $string, int $id) : string {}
function sodium_base642bin
(string $string, int $id, string $ignore = "") : string {}
#endif
/* ----- aliases ----- */
/** @alias sodium_crypto_box_publickey_from_secretkey */
function sodium_crypto_scalarmult_base
(string $secret_key) : string {}