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