1 ! Copyright (C) 2017, 2018, 2020 Alexander Ilin.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: alien alien.c-types alien.libraries alien.syntax
4 classes.struct combinators literals math.order
5 sodium.ffi.const sodium.ffi.const.size_max system ;
9 { [ os windows? ] [ "libsodium.dll" ] }
10 { [ os macosx? ] [ "libsodium.dylib" ] }
11 { [ os unix? ] [ "libsodium.so" ] }
12 } cond cdecl add-library >>
16 FUNCTION: int sodium_init ( )
19 FUNCTION: void randombytes_buf ( void* buf, size_t size )
20 FUNCTION: uint32_t randombytes_random ( )
21 FUNCTION: uint32_t randombytes_uniform ( uint32_t upper_bound )
22 FUNCTION: void randombytes_stir ( )
24 ! crypto_pwhash_argon2id_H
25 CONSTANT: crypto_pwhash_argon2id_ALG_ARGON2ID13 2
26 CONSTANT: crypto_pwhash_argon2id_BYTES_MIN 16
27 CONSTANT: crypto_pwhash_argon2id_BYTES_MAX 4294967295
28 CONSTANT: crypto_pwhash_argon2id_PASSWD_MIN 0
29 CONSTANT: crypto_pwhash_argon2id_PASSWD_MAX 4294967295
30 CONSTANT: crypto_pwhash_argon2id_SALTBYTES 16
31 CONSTANT: crypto_pwhash_argon2id_STRBYTES 128
32 CONSTANT: crypto_pwhash_argon2id_STRPREFIX "$argon2id$"
33 CONSTANT: crypto_pwhash_argon2id_OPSLIMIT_MIN 1
34 CONSTANT: crypto_pwhash_argon2id_OPSLIMIT_MAX 4294967295
35 CONSTANT: crypto_pwhash_argon2id_MEMLIMIT_MIN 8192
36 CONSTANT: crypto_pwhash_argon2id_MEMLIMIT_MAX 4398046510080
37 CONSTANT: crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE 2
38 CONSTANT: crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE 67108864
39 CONSTANT: crypto_pwhash_argon2id_OPSLIMIT_MODERATE 3
40 CONSTANT: crypto_pwhash_argon2id_MEMLIMIT_MODERATE 268435456
41 CONSTANT: crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE 4
42 CONSTANT: crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE 1073741824
44 FUNCTION: int crypto_pwhash_argon2id_alg_argon2id13 ( )
45 FUNCTION: size_t crypto_pwhash_argon2id_bytes_min ( )
46 FUNCTION: size_t crypto_pwhash_argon2id_bytes_max ( )
47 FUNCTION: size_t crypto_pwhash_argon2id_passwd_min ( )
48 FUNCTION: size_t crypto_pwhash_argon2id_passwd_max ( )
49 FUNCTION: size_t crypto_pwhash_argon2id_saltbytes ( )
50 FUNCTION: size_t crypto_pwhash_argon2id_strbytes ( )
51 FUNCTION: char* crypto_pwhash_argon2id_strprefix ( )
52 FUNCTION: size_t crypto_pwhash_argon2id_opslimit_min ( )
53 FUNCTION: size_t crypto_pwhash_argon2id_opslimit_max ( )
54 FUNCTION: size_t crypto_pwhash_argon2id_memlimit_min ( )
55 FUNCTION: size_t crypto_pwhash_argon2id_memlimit_max ( )
56 FUNCTION: size_t crypto_pwhash_argon2id_opslimit_interactive ( )
57 FUNCTION: size_t crypto_pwhash_argon2id_memlimit_interactive ( )
58 FUNCTION: size_t crypto_pwhash_argon2id_opslimit_moderate ( )
59 FUNCTION: size_t crypto_pwhash_argon2id_memlimit_moderate ( )
60 FUNCTION: size_t crypto_pwhash_argon2id_opslimit_sensitive ( )
61 FUNCTION: size_t crypto_pwhash_argon2id_memlimit_sensitive ( )
62 FUNCTION: int crypto_pwhash_argon2id (
63 uchar* out, ulonglong outlen,
64 char* passwd, ulonglong passwdlen,
65 uchar* salt, ulonglong opslimit, size_t memlimit, int alg )
66 FUNCTION: int crypto_pwhash_argon2id_str (
67 char[crypto_pwhash_argon2id_STRBYTES] out,
68 char* passwd, ulonglong passwdlen,
69 ulonglong opslimit, size_t memlimit )
70 FUNCTION: int crypto_pwhash_argon2id_str_verify (
71 char[crypto_pwhash_argon2id_STRBYTES] str,
72 char* passwd, ulonglong passwdlen )
73 FUNCTION: int crypto_pwhash_argon2id_str_needs_rehash (
74 char[crypto_pwhash_argon2id_STRBYTES] str,
75 ulonglong opslimit, size_t memlimit )
77 ! crypto_pwhash_scryptsalsa208sha256_H
78 CONSTANT: crypto_pwhash_scryptsalsa208sha256_BYTES_MIN 16
79 CONSTANT: crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN 0
80 CONSTANT: crypto_pwhash_scryptsalsa208sha256_BYTES_MAX $[ SODIUM_SIZE_MAX 0x1fffffffe0 min ]
81 CONSTANT: crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX SODIUM_SIZE_MAX
82 CONSTANT: crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX $[ SIZE_MAX 68719476736 min ]
83 CONSTANT: crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE 16777216
84 CONSTANT: crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN 16777216
85 CONSTANT: crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE 1073741824
86 CONSTANT: crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE 524288
87 CONSTANT: crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX 4294967295
88 CONSTANT: crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN 32768
89 CONSTANT: crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE 33554432
90 CONSTANT: crypto_pwhash_scryptsalsa208sha256_SALTBYTES 32
91 CONSTANT: crypto_pwhash_scryptsalsa208sha256_STRBYTES 102
92 CONSTANT: crypto_pwhash_scryptsalsa208sha256_STRPREFIX "$7$"
94 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_bytes_min ( )
95 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_bytes_max ( )
96 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_passwd_min ( )
97 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_passwd_max ( )
98 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_memlimit_interactive ( )
99 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max ( )
100 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_memlimit_min ( )
101 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive ( )
102 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_opslimit_interactive ( )
103 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max ( )
104 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_opslimit_min ( )
105 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive ( )
106 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_saltbytes ( )
107 FUNCTION: size_t crypto_pwhash_scryptsalsa208sha256_strbytes ( )
108 FUNCTION: char* crypto_pwhash_scryptsalsa208sha256_strprefix ( )
110 FUNCTION: int crypto_pwhash_scryptsalsa208sha256 (
111 uchar* out, ulonglong outlen,
112 char* passwd, ulonglong passwdlen,
114 ulonglong opslimit, size_t memlimit )
116 FUNCTION: int crypto_pwhash_scryptsalsa208sha256_str (
117 char[crypto_pwhash_scryptsalsa208sha256_STRBYTES] out,
118 char* passwd, ulonglong passwdlen,
119 ulonglong opslimit, size_t memlimit )
121 FUNCTION: int crypto_pwhash_scryptsalsa208sha256_str_verify (
122 char[crypto_pwhash_scryptsalsa208sha256_STRBYTES] str,
123 char* passwd, ulonglong passwdlen )
125 FUNCTION: int crypto_pwhash_scryptsalsa208sha256_ll (
126 uint8_t* passwd, size_t passwdlen,
127 uint8_t* salt, size_t saltlen,
128 uint64_t N, uint32_t r, uint32_t p,
129 uint8_t* buf, size_t buflen )
131 FUNCTION: int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash (
132 char[crypto_pwhash_scryptsalsa208sha256_STRBYTES] str,
133 ulonglong opslimit, size_t memlimit )
136 CONSTANT: crypto_pwhash_STRBYTES 128
138 FUNCTION: int crypto_pwhash_alg_argon2i13 ( )
139 FUNCTION: int crypto_pwhash_alg_default ( )
140 FUNCTION: size_t crypto_pwhash_saltbytes ( )
141 FUNCTION: size_t crypto_pwhash_strbytes ( )
142 FUNCTION: char* crypto_pwhash_strprefix ( )
143 FUNCTION: size_t crypto_pwhash_opslimit_interactive ( )
144 FUNCTION: size_t crypto_pwhash_memlimit_interactive ( )
145 FUNCTION: size_t crypto_pwhash_opslimit_moderate ( )
146 FUNCTION: size_t crypto_pwhash_memlimit_moderate ( )
147 FUNCTION: size_t crypto_pwhash_opslimit_sensitive ( )
148 FUNCTION: size_t crypto_pwhash_memlimit_sensitive ( )
149 FUNCTION: int crypto_pwhash (
150 uchar* out, ulonglong outlen,
151 char* passwd, ulonglong passwdlen,
153 ulonglong opslimit, size_t memlimit, int alg )
154 FUNCTION: int crypto_pwhash_str (
155 char[crypto_pwhash_STRBYTES]* out,
156 char* passwd, ulonglong passwdlen,
157 ulonglong opslimit, size_t memlimit )
158 FUNCTION: int crypto_pwhash_str_verify (
159 char[crypto_pwhash_STRBYTES]* str,
160 char* passwd, ulonglong passwdlen )
161 FUNCTION: char* crypto_pwhash_primitive ( )
164 FUNCTION: void sodium_memzero ( void* pnt, size_t len )
165 FUNCTION: void sodium_stackzero ( size_t len )
166 FUNCTION: int sodium_memcmp (
167 void* b1_, void* b2_, size_t len )
168 FUNCTION: int sodium_compare (
169 uchar* b1_, uchar* b2_, size_t len )
170 FUNCTION: int sodium_is_zero ( uchar* n, size_t nlen )
171 FUNCTION: void sodium_increment ( uchar* n, size_t nlen )
172 FUNCTION: void sodium_add ( uchar* a, uchar* b, size_t len )
173 FUNCTION: char* sodium_bin2hex (
174 char* hex, size_t hex_maxlen,
175 uchar* bin, size_t bin_len )
176 FUNCTION: int sodium_hex2bin (
177 uchar* bin, size_t bin_maxlen,
178 char* hex, size_t hex_len,
179 char* ignore, size_t* bin_len,
181 CONSTANT: sodium_base64_VARIANT_ORIGINAL 1
182 CONSTANT: sodium_base64_VARIANT_ORIGINAL_NO_PADDING 3
183 CONSTANT: sodium_base64_VARIANT_URLSAFE 5
184 CONSTANT: sodium_base64_VARIANT_URLSAFE_NO_PADDING 7
185 FUNCTION: size_t sodium_base64_encoded_len ( size_t bin_len, int variant )
186 FUNCTION: char* sodium_bin2base64 (
187 char* b64, size_t b64_maxlen,
188 uchar* bin, size_t bin_len,
190 FUNCTION: int sodium_base642bin (
191 uchar* bin, size_t bin_maxlen,
192 char* b64, size_t b64_len,
193 char* ignore, size_t* bin_len,
194 char** b64_end, int variant )
195 FUNCTION: int sodium_mlock ( void* addr, size_t len )
196 FUNCTION: int sodium_munlock ( void* addr, size_t len )
197 FUNCTION: void* sodium_malloc ( size_t size )
198 FUNCTION: void* sodium_allocarray ( size_t count, size_t size )
199 FUNCTION: void sodium_free ( void* ptr )
200 FUNCTION: int sodium_mprotect_noaccess ( void* ptr )
201 FUNCTION: int sodium_mprotect_readonly ( void* ptr )
202 FUNCTION: int sodium_mprotect_readwrite ( void* ptr )
203 FUNCTION: int sodium_pad (
204 size_t* padded_buflen_p, uchar* buf,
205 size_t unpadded_buflen, size_t blocksize, size_t max_buflen )
206 FUNCTION: int sodium_unpad (
207 size_t* unpadded_buflen_p, uchar* buf,
208 size_t padded_buflen, size_t blocksize )
210 ! crypto_generichash_H
211 TYPEDEF: void* crypto_generichash_state
212 FUNCTION: size_t crypto_generichash_bytes_min ( )
213 FUNCTION: size_t crypto_generichash_bytes_max ( )
214 FUNCTION: size_t crypto_generichash_bytes ( )
215 FUNCTION: size_t crypto_generichash_keybytes_min ( )
216 FUNCTION: size_t crypto_generichash_keybytes_max ( )
217 FUNCTION: size_t crypto_generichash_keybytes ( )
218 FUNCTION: char* crypto_generichash_primitive ( )
219 FUNCTION: size_t crypto_generichash_statebytes ( )
220 FUNCTION: int crypto_generichash (
221 uchar* out, size_t outlen,
222 uchar* in, ulonglong inlen,
223 uchar* key, size_t keylen )
224 FUNCTION: int crypto_generichash_init (
225 crypto_generichash_state* state,
226 uchar* key, size_t keylen, size_t outlen )
227 FUNCTION: int crypto_generichash_update (
228 crypto_generichash_state* state, uchar* in, ulonglong inlen )
229 FUNCTION: int crypto_generichash_final (
230 crypto_generichash_state* state, uchar* out, size_t outlen )
233 FUNCTION: size_t crypto_secretbox_keybytes ( )
234 FUNCTION: size_t crypto_secretbox_noncebytes ( )
235 FUNCTION: size_t crypto_secretbox_macbytes ( )
236 FUNCTION: char* crypto_secretbox_primitive ( )
237 FUNCTION: int crypto_secretbox_easy (
238 uchar* c, uchar* m, ulonglong mlen,
240 FUNCTION: int crypto_secretbox_open_easy (
241 uchar* m, uchar* c, ulonglong clen,
243 FUNCTION: int crypto_secretbox_detached (
244 uchar* c, uchar* mac, uchar* m, ulonglong mlen,
246 FUNCTION: int crypto_secretbox_open_detached (
247 uchar* m, uchar* c, uchar* mac, ulonglong clen,
249 FUNCTION: void crypto_secretbox_keygen (
250 uchar[crypto_secretbox_keybytes] k )
253 FUNCTION: size_t crypto_box_seedbytes ( )
254 FUNCTION: size_t crypto_box_publickeybytes ( )
255 FUNCTION: size_t crypto_box_secretkeybytes ( )
256 FUNCTION: size_t crypto_box_noncebytes ( )
257 FUNCTION: size_t crypto_box_macbytes ( )
258 FUNCTION: size_t crypto_box_messagebytes_max ( )
259 FUNCTION: char* crypto_box_primitive ( )
260 FUNCTION: int crypto_box_seed_keypair (
261 uchar* pk, uchar* sk, uchar* seed )
262 FUNCTION: int crypto_box_keypair ( uchar* pk, uchar* sk )
263 FUNCTION: int crypto_box_easy (
264 uchar* c, uchar* m, ulonglong mlen, uchar* n,
265 uchar* pk, uchar* sk )
266 FUNCTION: int crypto_box_open_easy (
267 uchar* m, uchar* c, ulonglong clen, uchar* n,
268 uchar* pk, uchar* sk )
269 FUNCTION: int crypto_box_detached (
270 uchar* c, uchar* mac, uchar* m, ulonglong mlen, uchar* n,
271 uchar* pk, uchar* sk )
272 FUNCTION: int crypto_box_open_detached (
273 uchar* m, uchar* c, uchar* mac, ulonglong clen, uchar* n,
274 uchar* pk, uchar* sk )
275 FUNCTION: size_t crypto_box_beforenmbytes ( )
276 FUNCTION: int crypto_box_beforenm (
277 uchar* k, uchar* pk, uchar* sk )
278 FUNCTION: int crypto_box_easy_afternm (
279 uchar* c, uchar* m, ulonglong mlen, uchar* n, uchar* k )
280 FUNCTION: int crypto_box_open_easy_afternm (
281 uchar* m, uchar* c, ulonglong clen, uchar* n, uchar* k )
282 FUNCTION: int crypto_box_detached_afternm (
283 uchar* c, uchar* mac, uchar* m, ulonglong mlen, uchar* n, uchar* k )
284 FUNCTION: int crypto_box_open_detached_afternm (
285 uchar* m, uchar* c, uchar* mac, ulonglong clen, uchar* n, uchar* k )
286 FUNCTION: size_t crypto_box_sealbytes ( )
287 FUNCTION: int crypto_box_seal (
288 uchar* c, uchar* m, ulonglong mlen, uchar* pk )
289 FUNCTION: int crypto_box_seal_open (
290 uchar* m, uchar* c, ulonglong clen, uchar* pk, uchar* sk )
293 FUNCTION: size_t crypto_auth_bytes ( )
294 FUNCTION: size_t crypto_auth_keybytes ( )
295 FUNCTION: char* crypto_auth_primitive ( )
296 FUNCTION: int crypto_auth (
297 uchar* out, uchar* in, ulonglong inlen, uchar* k )
298 FUNCTION: int crypto_auth_verify (
299 uchar* h, uchar* in, ulonglong inlen, uchar* k )
300 FUNCTION: void crypto_auth_keygen ( uchar[crypto_auth_keybytes] k )
302 ! crypto_hash_sha256_H
303 CONSTANT: crypto_hash_sha256_BYTES 32
304 STRUCT: crypto_hash_sha256_state
305 { state uint32_t[8] }
307 { buf uint8_t[64] } ;
309 FUNCTION: size_t crypto_hash_sha256_statebytes ( )
310 FUNCTION: size_t crypto_hash_sha256_bytes ( )
311 FUNCTION: int crypto_hash_sha256 (
312 uchar* out, uchar* in, ulonglong inlen )
313 FUNCTION: int crypto_hash_sha256_init (
314 crypto_hash_sha256_state* state )
315 FUNCTION: int crypto_hash_sha256_update (
316 crypto_hash_sha256_state* state, uchar* in, ulonglong inlen )
317 FUNCTION: int crypto_hash_sha256_final (
318 crypto_hash_sha256_state* state, uchar* out )
320 ! crypto_auth_hmacsha256_H
321 CONSTANT: crypto_auth_hmacsha256_BYTES 32
322 CONSTANT: crypto_auth_hmacsha256_KEYBYTES 32
324 STRUCT: crypto_auth_hmacsha256_state
325 { ictx crypto_hash_sha256_state }
326 { octx crypto_hash_sha256_state } ;
328 FUNCTION: size_t crypto_auth_hmacsha256_bytes ( )
329 FUNCTION: size_t crypto_auth_hmacsha256_keybytes ( )
330 FUNCTION: int crypto_auth_hmacsha256 (
331 uchar* out, uchar* in, ulonglong inlen, uchar* k )
332 FUNCTION: int crypto_auth_hmacsha256_verify (
333 uchar* h, uchar* in, ulonglong inlen, uchar* k )
334 FUNCTION: size_t crypto_auth_hmacsha256_statebytes ( )
335 FUNCTION: int crypto_auth_hmacsha256_init (
336 crypto_auth_hmacsha256_state* state, uchar* key, size_t keylen )
337 FUNCTION: int crypto_auth_hmacsha256_update (
338 crypto_auth_hmacsha256_state* state, uchar* in, ulonglong inlen )
339 FUNCTION: int crypto_auth_hmacsha256_final (
340 crypto_auth_hmacsha256_state* state, uchar* out )
341 FUNCTION: void crypto_auth_hmacsha256_keygen (
342 uchar[crypto_auth_hmacsha256_KEYBYTES] k )
344 ! crypto_hash_sha512_H
345 CONSTANT: crypto_hash_sha512_BYTES 64
347 STRUCT: crypto_hash_sha512_state
348 { state uint64_t[8] }
349 { count uint64_t[2] }
350 { buf uint8_t[128] } ;
352 FUNCTION: size_t crypto_hash_sha512_statebytes ( )
353 FUNCTION: size_t crypto_hash_sha512_bytes ( )
354 FUNCTION: int crypto_hash_sha512 (
355 uchar* out, uchar* in, ulonglong inlen )
356 FUNCTION: int crypto_hash_sha512_init (
357 crypto_hash_sha512_state* state )
358 FUNCTION: int crypto_hash_sha512_update (
359 crypto_hash_sha512_state* state, uchar* in, ulonglong inlen )
360 FUNCTION: int crypto_hash_sha512_final (
361 crypto_hash_sha512_state* state, uchar* out )
363 ! crypto_auth_hmacsha512_H
364 CONSTANT: crypto_auth_hmacsha512_BYTES 64
365 CONSTANT: crypto_auth_hmacsha512_KEYBYTES 32
367 STRUCT: crypto_auth_hmacsha512_state
368 { ict crypto_hash_sha512_state }
369 { octx crypto_hash_sha512_state } ;
371 FUNCTION: size_t crypto_auth_hmacsha512_bytes ( )
372 FUNCTION: size_t crypto_auth_hmacsha512_keybytes ( )
373 FUNCTION: int crypto_auth_hmacsha512 (
374 uchar* in, uchar* out, ulonglong inlen, uchar* k )
375 FUNCTION: int crypto_auth_hmacsha512_verify (
376 uchar* h, uchar* in, ulonglong inlen, uchar* k )
377 FUNCTION: size_t crypto_auth_hmacsha512_statebytes ( )
378 FUNCTION: int crypto_auth_hmacsha512_init (
379 crypto_auth_hmacsha512_state* state, uchar* key, size_t keylen )
380 FUNCTION: int crypto_auth_hmacsha512_update (
381 crypto_auth_hmacsha512_state* state, uchar* in, ulonglong inlen )
382 FUNCTION: int crypto_auth_hmacsha512_final (
383 crypto_auth_hmacsha512_state* state, uchar* out )
384 FUNCTION: void crypto_auth_hmacsha512_keygen (
385 uchar[crypto_auth_hmacsha512_KEYBYTES] k )
387 ! crypto_auth_hmacsha512256_H
388 CONSTANT: crypto_auth_hmacsha512256_BYTES 32
389 CONSTANT: crypto_auth_hmacsha512256_KEYBYTES 32
391 TYPEDEF: crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state
393 FUNCTION: size_t crypto_auth_hmacsha512256_bytes ( )
394 FUNCTION: size_t crypto_auth_hmacsha512256_keybytes ( )
395 FUNCTION: int crypto_auth_hmacsha512256 (
396 uchar* out, uchar* in, ulonglong inlen, uchar* k )
397 FUNCTION: int crypto_auth_hmacsha512256_verify (
398 uchar* h, uchar* in, ulonglong inlen, uchar* k )
399 FUNCTION: size_t crypto_auth_hmacsha512256_statebytes ( )
400 FUNCTION: int crypto_auth_hmacsha512256_init (
401 crypto_auth_hmacsha512256_state* state,
402 uchar* key, size_t keylen )
403 FUNCTION: int crypto_auth_hmacsha512256_update (
404 crypto_auth_hmacsha512256_state* state,
405 uchar* in, ulonglong inlen )
406 FUNCTION: int crypto_auth_hmacsha512256_final (
407 crypto_auth_hmacsha512256_state* state, uchar* out )
408 FUNCTION: void crypto_auth_hmacsha512256_keygen (
409 uchar[crypto_auth_hmacsha512256_KEYBYTES] k )
412 FUNCTION: size_t crypto_kdf_bytes_min ( )
413 FUNCTION: size_t crypto_kdf_bytes_max ( )
414 FUNCTION: size_t crypto_kdf_contextbytes ( )
415 FUNCTION: size_t crypto_kdf_keybytes ( )
416 FUNCTION: char* crypto_kdf_primitive ( )
417 FUNCTION: int crypto_kdf_derive_from_key (
418 uchar* subkey, size_t subkey_len,
420 char[crypto_kdf_contextbytes] ctx,
421 uchar[crypto_kdf_keybytes] key )
422 FUNCTION: void crypto_kdf_keygen ( uchar[crypto_kdf_keybytes] k )
425 FUNCTION: size_t crypto_kx_publickeybytes ( )
426 FUNCTION: size_t crypto_kx_secretkeybytes ( )
427 FUNCTION: size_t crypto_kx_seedbytes ( )
428 FUNCTION: size_t crypto_kx_sessionkeybytes ( )
429 FUNCTION: char* crypto_kx_primitive ( )
430 FUNCTION: int crypto_kx_seed_keypair (
431 uchar[crypto_kx_publickeybytes] pk,
432 uchar[crypto_kx_secretkeybytes] sk,
433 uchar[crypto_kx_seedbytes] seed )
434 FUNCTION: int crypto_kx_keypair (
435 uchar[crypto_kx_publickeybytes] pk,
436 uchar[crypto_kx_secretkeybytes] sk )
437 FUNCTION: int crypto_kx_client_session_keys (
438 uchar[crypto_kx_sessionkeybytes] rx,
439 uchar[crypto_kx_sessionkeybytes] tx,
440 uchar[crypto_kx_publickeybytes] client_pk,
441 uchar[crypto_kx_secretkeybytes] client_sk,
442 uchar[crypto_kx_publickeybytes] server_pk )
443 FUNCTION: int crypto_kx_server_session_keys (
444 uchar[crypto_kx_sessionkeybytes] rx,
445 uchar[crypto_kx_sessionkeybytes] tx,
446 uchar[crypto_kx_publickeybytes] server_pk,
447 uchar[crypto_kx_secretkeybytes] server_sk,
448 uchar[crypto_kx_publickeybytes] client_pk )
450 ! crypto_onetimeauth_H
451 STRUCT: crypto_onetimeauth_state
452 { opaque uchar[256] }
454 FUNCTION: size_t crypto_onetimeauth_statebytes ( )
455 FUNCTION: size_t crypto_onetimeauth_bytes ( )
456 FUNCTION: size_t crypto_onetimeauth_keybytes ( )
457 FUNCTION: char* crypto_onetimeauth_primitive ( )
458 FUNCTION: int crypto_onetimeauth (
459 uchar* out, uchar* in, ulonglong inlen, uchar* k )
460 FUNCTION: int crypto_onetimeauth_verify (
461 uchar* h, uchar* in, ulonglong inlen, uchar* k )
462 FUNCTION: int crypto_onetimeauth_init (
463 crypto_onetimeauth_state* state, uchar* key )
464 FUNCTION: int crypto_onetimeauth_update (
465 crypto_onetimeauth_state* state, uchar* in, ulonglong inlen )
466 FUNCTION: int crypto_onetimeauth_final (
467 crypto_onetimeauth_state* state, uchar* out )
468 FUNCTION: void crypto_onetimeauth_keygen (
469 uchar[crypto_onetimeauth_keybytes] k )
472 STRUCT: crypto_sign_state
473 { hs crypto_hash_sha512_state }
475 FUNCTION: size_t crypto_sign_statebytes ( )
476 FUNCTION: size_t crypto_sign_bytes ( )
477 FUNCTION: size_t crypto_sign_seedbytes ( )
478 FUNCTION: size_t crypto_sign_publickeybytes ( )
479 FUNCTION: size_t crypto_sign_secretkeybytes ( )
480 FUNCTION: size_t crypto_sign_messagebytes_max ( )
481 FUNCTION: char* crypto_sign_primitive ( )
482 FUNCTION: int crypto_sign_seed_keypair (
483 uchar* pk, uchar* sk, uchar* seed )
484 FUNCTION: int crypto_sign_keypair ( uchar* pk, uchar* sk )
485 FUNCTION: int crypto_sign (
486 uchar* sm, ulonglong* smlen_p,
487 uchar* m, ulonglong mlen,
489 FUNCTION: int crypto_sign_open (
490 uchar* m, ulonglong* mlen_p,
491 uchar* sm, ulonglong smlen,
493 FUNCTION: int crypto_sign_detached (
494 uchar* sig, ulonglong* siglen_p,
495 uchar* m, ulonglong mlen,
497 FUNCTION: int crypto_sign_verify_detached (
498 uchar* sig, uchar* m, ulonglong mlen, uchar* pk )
499 FUNCTION: int crypto_sign_init ( crypto_sign_state* state )
500 FUNCTION: int crypto_sign_update (
501 crypto_sign_state* state, uchar* m, ulonglong mlen )
502 FUNCTION: int crypto_sign_final_create (
503 crypto_sign_state* state, uchar* sig, ulonglong* siglen_p, uchar* sk )
504 FUNCTION: int crypto_sign_final_verify (
505 crypto_sign_state* state, uchar* sig, uchar* pk )
507 ! crypto_aead_xchacha20poly1305_H
508 FUNCTION: size_t crypto_aead_xchacha20poly1305_ietf_keybytes ( )
509 FUNCTION: size_t crypto_aead_xchacha20poly1305_ietf_nsecbytes ( )
510 FUNCTION: size_t crypto_aead_xchacha20poly1305_ietf_npubbytes ( )
511 FUNCTION: size_t crypto_aead_xchacha20poly1305_ietf_abytes ( )
512 FUNCTION: size_t crypto_aead_xchacha20poly1305_ietf_messagebytes_max ( )
513 FUNCTION: int crypto_aead_xchacha20poly1305_ietf_encrypt (
514 uchar* c, ulonglong* clen_p,
515 uchar* m, ulonglong mlen,
516 uchar* ad, ulonglong adlen,
517 uchar* nsec, uchar* npub, uchar* k )
518 FUNCTION: int crypto_aead_xchacha20poly1305_ietf_decrypt (
519 uchar* m, ulonglong* mlen_p, uchar* nsec,
520 uchar* c, ulonglong clen,
521 uchar* ad, ulonglong adlen,
522 uchar* npub, uchar* k )
523 FUNCTION: int crypto_aead_xchacha20poly1305_ietf_encrypt_detached (
524 uchar* c, uchar* mac, ulonglong* maclen_p,
525 uchar* m, ulonglong mlen,
526 uchar* ad, ulonglong adlen,
527 uchar* nsec, uchar* npub, uchar* k )
528 FUNCTION: int crypto_aead_xchacha20poly1305_ietf_decrypt_detached (
529 uchar* m, uchar* nsec,
530 uchar* c, ulonglong clen,
532 uchar* ad, ulonglong adlen,
533 uchar* npub, uchar* k )
534 FUNCTION: void crypto_aead_xchacha20poly1305_ietf_keygen (
535 uchar[crypto_aead_xchacha20poly1305_ietf_keybytes] k )
537 ! crypto_secretstream_xchacha20poly1305_H
538 FUNCTION: size_t crypto_secretstream_xchacha20poly1305_abytes ( )
539 FUNCTION: size_t crypto_secretstream_xchacha20poly1305_headerbytes ( )
540 FUNCTION: size_t crypto_secretstream_xchacha20poly1305_keybytes ( )
541 FUNCTION: size_t crypto_secretstream_xchacha20poly1305_messagebytes_max ( )
542 FUNCTION: uchar crypto_secretstream_xchacha20poly1305_tag_message ( )
543 FUNCTION: uchar crypto_secretstream_xchacha20poly1305_tag_push ( )
544 FUNCTION: uchar crypto_secretstream_xchacha20poly1305_tag_rekey ( )
545 FUNCTION: uchar crypto_secretstream_xchacha20poly1305_tag_final ( )
546 CONSTANT: crypto_stream_chacha20_ietf_KEYBYTES 32
547 CONSTANT: crypto_stream_chacha20_ietf_NONCEBYTES 12
548 STRUCT: crypto_secretstream_xchacha20poly1305_state
549 { k uchar[crypto_stream_chacha20_ietf_KEYBYTES] }
550 { nonce uchar[crypto_stream_chacha20_ietf_NONCEBYTES] }
553 FUNCTION: size_t crypto_secretstream_xchacha20poly1305_statebytes ( )
554 FUNCTION: void crypto_secretstream_xchacha20poly1305_keygen (
555 uchar[crypto_secretstream_xchacha20poly1305_keybytes] k )
556 FUNCTION: int crypto_secretstream_xchacha20poly1305_init_push (
557 crypto_secretstream_xchacha20poly1305_state* state,
558 uchar[crypto_secretstream_xchacha20poly1305_headerbytes] header,
559 uchar[crypto_secretstream_xchacha20poly1305_keybytes] k )
560 FUNCTION: int crypto_secretstream_xchacha20poly1305_push (
561 crypto_secretstream_xchacha20poly1305_state* state,
562 uchar* c, ulonglong* clen_p,
563 uchar* m, ulonglong mlen,
564 uchar* ad, ulonglong adlen, uchar tag )
565 FUNCTION: int crypto_secretstream_xchacha20poly1305_init_pull (
566 crypto_secretstream_xchacha20poly1305_state* state,
567 uchar[crypto_secretstream_xchacha20poly1305_headerbytes] header,
568 uchar[crypto_secretstream_xchacha20poly1305_keybytes] k )
569 FUNCTION: int crypto_secretstream_xchacha20poly1305_pull (
570 crypto_secretstream_xchacha20poly1305_state* state,
571 uchar* m, ulonglong* mlen_p, uchar* tag_p,
572 uchar* c, ulonglong clen,
573 uchar* ad, ulonglong adlen )
574 FUNCTION: void crypto_secretstream_xchacha20poly1305_rekey (
575 crypto_secretstream_xchacha20poly1305_state* state )
578 FUNCTION: int sodium_runtime_has_neon ( )
579 FUNCTION: int sodium_runtime_has_sse2 ( )
580 FUNCTION: int sodium_runtime_has_sse3 ( )
581 FUNCTION: int sodium_runtime_has_ssse3 ( )
582 FUNCTION: int sodium_runtime_has_sse41 ( )
583 FUNCTION: int sodium_runtime_has_avx ( )
584 FUNCTION: int sodium_runtime_has_avx2 ( )
585 FUNCTION: int sodium_runtime_has_avx512f ( )
586 FUNCTION: int sodium_runtime_has_pclmul ( )
587 FUNCTION: int sodium_runtime_has_aesni ( )
588 FUNCTION: int sodium_runtime_has_rdrand ( )