Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

sodium.h
Go to the documentation of this file.
1 /*
2 * (C) 2019 Jack Lloyd
3 *
4 * Botan is released under the Simplified BSD License (see license.txt)
5 */
6
7 #ifndef BOTAN_SODIUM_COMPAT_H_
8 #define BOTAN_SODIUM_COMPAT_H_
9
10 #include <botan/types.h>
11
12 namespace Botan {
13
14 /**
15 * The Sodium namespace contains a partial implementation of the
16 * libsodium API.
17 */
18 namespace Sodium {
19
20 // sodium/randombytes.h
21 enum Sodium_Constants : size_t {
22 SODIUM_SIZE_MAX = 0xFFFFFFFF,
23
24 crypto_aead_chacha20poly1305_ABYTES = 16,
25 crypto_aead_chacha20poly1305_KEYBYTES = 32,
26 crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
27 crypto_aead_chacha20poly1305_NPUBBYTES = 8,
28 crypto_aead_chacha20poly1305_NSECBYTES = 0,
29
30 crypto_aead_chacha20poly1305_ietf_ABYTES = 16,
31 crypto_aead_chacha20poly1305_ietf_KEYBYTES = 32,
32 crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
33 crypto_aead_chacha20poly1305_ietf_NPUBBYTES = 12,
34 crypto_aead_chacha20poly1305_ietf_NSECBYTES = 0,
35
36 crypto_aead_xchacha20poly1305_ietf_ABYTES = 16,
37 crypto_aead_xchacha20poly1305_ietf_KEYBYTES = 32,
38 crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
39 crypto_aead_xchacha20poly1305_ietf_NPUBBYTES = 24,
40 crypto_aead_xchacha20poly1305_ietf_NSECBYTES = 0,
41
42 crypto_auth_hmacsha256_BYTES = 32,
43 crypto_auth_hmacsha256_KEYBYTES = 32,
44 crypto_auth_hmacsha512256_BYTES = 32,
45 crypto_auth_hmacsha512256_KEYBYTES = 32,
46 crypto_auth_hmacsha512_BYTES = 64,
47 crypto_auth_hmacsha512_KEYBYTES = 32,
48
49 crypto_auth_BYTES = crypto_auth_hmacsha512256_BYTES,
50 crypto_auth_KEYBYTES = crypto_auth_hmacsha512256_KEYBYTES,
51
52 crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES = 32,
53 crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES = 16,
54 crypto_box_curve25519xsalsa20poly1305_MACBYTES = 16,
55 crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
56 crypto_box_curve25519xsalsa20poly1305_NONCEBYTES = 24,
57 crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES = 32,
58 crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES = 32,
59 crypto_box_curve25519xsalsa20poly1305_SEEDBYTES = 32,
60 crypto_box_curve25519xsalsa20poly1305_ZEROBYTES = crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES + crypto_box_curve25519xsalsa20poly1305_MACBYTES,
61
62 crypto_box_BEFORENMBYTES = crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES,
63 crypto_box_BOXZEROBYTES = crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES,
64 crypto_box_MACBYTES = crypto_box_curve25519xsalsa20poly1305_MACBYTES,
65 crypto_box_MESSAGEBYTES_MAX = crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX,
66 crypto_box_NONCEBYTES = crypto_box_curve25519xsalsa20poly1305_NONCEBYTES,
67 crypto_box_PUBLICKEYBYTES = crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES,
68 crypto_box_SECRETKEYBYTES = crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES,
69 crypto_box_SEEDBYTES = crypto_box_curve25519xsalsa20poly1305_SEEDBYTES,
70 crypto_box_ZEROBYTES = crypto_box_curve25519xsalsa20poly1305_ZEROBYTES,
71
72 crypto_core_hchacha20_CONSTBYTES = 16,
73 crypto_core_hchacha20_INPUTBYTES = 16,
74 crypto_core_hchacha20_KEYBYTES = 32,
75 crypto_core_hchacha20_OUTPUTBYTES = 32,
76
77 crypto_core_hsalsa20_CONSTBYTES = 16,
78 crypto_core_hsalsa20_INPUTBYTES = 16,
79 crypto_core_hsalsa20_KEYBYTES = 32,
80 crypto_core_hsalsa20_OUTPUTBYTES = 32,
81
82 crypto_hash_sha256_BYTES = 32,
83 crypto_hash_sha512_BYTES = 64,
84 crypto_hash_BYTES = crypto_hash_sha512_BYTES,
85
86 crypto_onetimeauth_poly1305_BYTES = 16,
87 crypto_onetimeauth_poly1305_KEYBYTES = 32,
88 crypto_onetimeauth_BYTES = crypto_onetimeauth_poly1305_BYTES,
89 crypto_onetimeauth_KEYBYTES = crypto_onetimeauth_poly1305_KEYBYTES,
90
91 crypto_scalarmult_curve25519_BYTES = 32,
92 crypto_scalarmult_curve25519_SCALARBYTES = 32,
93 crypto_scalarmult_BYTES = crypto_scalarmult_curve25519_BYTES,
94 crypto_scalarmult_SCALARBYTES = crypto_scalarmult_curve25519_SCALARBYTES,
95
96 crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES = 16,
97 crypto_secretbox_xsalsa20poly1305_KEYBYTES = 32,
98 crypto_secretbox_xsalsa20poly1305_MACBYTES = 16,
99 crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
100 crypto_secretbox_xsalsa20poly1305_NONCEBYTES = 24,
101 crypto_secretbox_xsalsa20poly1305_ZEROBYTES = crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES + crypto_secretbox_xsalsa20poly1305_MACBYTES,
102
103 crypto_secretbox_BOXZEROBYTES = crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES,
104 crypto_secretbox_KEYBYTES = crypto_secretbox_xsalsa20poly1305_KEYBYTES,
105 crypto_secretbox_MACBYTES = crypto_secretbox_xsalsa20poly1305_MACBYTES,
106 crypto_secretbox_MESSAGEBYTES_MAX = crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX,
107 crypto_secretbox_NONCEBYTES = crypto_secretbox_xsalsa20poly1305_NONCEBYTES,
108 crypto_secretbox_ZEROBYTES = crypto_secretbox_xsalsa20poly1305_ZEROBYTES,
109
110 crypto_shorthash_siphash24_BYTES = 8,
111 crypto_shorthash_siphash24_KEYBYTES = 16,
112 crypto_shorthash_BYTES = crypto_shorthash_siphash24_BYTES,
113 crypto_shorthash_KEYBYTES = crypto_shorthash_siphash24_KEYBYTES,
114
115 crypto_sign_ed25519_BYTES = 64,
116 crypto_sign_ed25519_MESSAGEBYTES_MAX = (SODIUM_SIZE_MAX - crypto_sign_ed25519_BYTES),
117 crypto_sign_ed25519_PUBLICKEYBYTES = 32,
118 crypto_sign_ed25519_SECRETKEYBYTES = (32 + 32),
119 crypto_sign_ed25519_SEEDBYTES = 32,
120 crypto_sign_BYTES = crypto_sign_ed25519_BYTES,
121 crypto_sign_MESSAGEBYTES_MAX = crypto_sign_ed25519_MESSAGEBYTES_MAX,
122 crypto_sign_PUBLICKEYBYTES = crypto_sign_ed25519_PUBLICKEYBYTES,
123 crypto_sign_SECRETKEYBYTES = crypto_sign_ed25519_SECRETKEYBYTES,
124 crypto_sign_SEEDBYTES = crypto_sign_ed25519_SEEDBYTES,
125
126 crypto_stream_chacha20_KEYBYTES = 32,
127 crypto_stream_chacha20_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
128 crypto_stream_chacha20_NONCEBYTES = 8,
129 crypto_stream_chacha20_ietf_KEYBYTES = 32,
130 crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
131 crypto_stream_chacha20_ietf_NONCEBYTES = 12,
132 crypto_stream_salsa20_KEYBYTES = 32,
133 crypto_stream_salsa20_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
134 crypto_stream_salsa20_NONCEBYTES = 8,
135 crypto_stream_xchacha20_KEYBYTES = 32,
136 crypto_stream_xchacha20_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
137 crypto_stream_xchacha20_NONCEBYTES = 24,
138 crypto_stream_xsalsa20_KEYBYTES = 32,
139 crypto_stream_xsalsa20_MESSAGEBYTES_MAX = SODIUM_SIZE_MAX,
140 crypto_stream_xsalsa20_NONCEBYTES = 24,
141 crypto_stream_KEYBYTES = crypto_stream_xsalsa20_KEYBYTES,
142 crypto_stream_MESSAGEBYTES_MAX = crypto_stream_xsalsa20_MESSAGEBYTES_MAX,
143 crypto_stream_NONCEBYTES = crypto_stream_xsalsa20_NONCEBYTES,
144
145 crypto_verify_16_BYTES = 16,
146 crypto_verify_32_BYTES = 32,
147 crypto_verify_64_BYTES = 64,
148
149 randombytes_SEEDBYTES = 32,
150 };
151
152 inline const char* sodium_version_string() { return "Botan Sodium Compat"; }
153
154 inline int sodium_library_version_major() { return 0; }
155
156 inline int sodium_library_version_minor() { return 0; }
157
158 inline int sodium_library_minimal() { return 0; }
159
160 inline int sodium_init() { return 0; }
161
162 // sodium/crypto_verify_{16,32,64}.h
163
164 BOTAN_PUBLIC_API(2,11)
165 int crypto_verify_16(const uint8_t x[16], const uint8_t y[16]);
166
167 BOTAN_PUBLIC_API(2,11)
168 int crypto_verify_32(const uint8_t x[32], const uint8_t y[32]);
169
170 BOTAN_PUBLIC_API(2,11)
171 int crypto_verify_64(const uint8_t x[64], const uint8_t y[64]);
172
173 // sodium/utils.h
174 BOTAN_PUBLIC_API(2,11)
175 void sodium_memzero(void* ptr, size_t len);
176
177 BOTAN_PUBLIC_API(2,11)
178 int sodium_memcmp(const void* x, const void* y, size_t len);
179
180 BOTAN_PUBLIC_API(2,11)
181 int sodium_compare(const uint8_t x[], const uint8_t y[], size_t len);
182
183 BOTAN_PUBLIC_API(2,11)
184 int sodium_is_zero(const uint8_t nonce[], size_t nlen);
185
186 BOTAN_PUBLIC_API(2,11)
187 void sodium_increment(uint8_t n[], size_t nlen);
188
189 BOTAN_PUBLIC_API(2,11)
190 void sodium_add(uint8_t a[], const uint8_t b[], size_t len);
191
192 BOTAN_PUBLIC_API(2,11)
193 void* sodium_malloc(size_t size);
194
195 BOTAN_PUBLIC_API(2,11)
196 void* sodium_allocarray(size_t count, size_t size);
197
198 BOTAN_PUBLIC_API(2,11)
199 void sodium_free(void* ptr);
200
201 BOTAN_PUBLIC_API(2,11)
202 int sodium_mprotect_noaccess(void* ptr);
203
204 BOTAN_PUBLIC_API(2,11)
205 int sodium_mprotect_readwrite(void* ptr);
206
207 // sodium/randombytes.h
208
209 inline size_t randombytes_seedbytes() { return randombytes_SEEDBYTES; }
210
211 BOTAN_PUBLIC_API(2,11)
212 void randombytes_buf(void* buf, size_t size);
213
214 BOTAN_PUBLIC_API(2,11)
215 void randombytes_buf_deterministic(void* buf, size_t size,
216 const uint8_t seed[randombytes_SEEDBYTES]);
217
218 BOTAN_PUBLIC_API(2,11)
219 uint32_t randombytes_uniform(uint32_t upper_bound);
220
221 inline uint32_t randombytes_random()
222 {
223 uint32_t x = 0;
224 randombytes_buf(&x, 4);
225 return x;
226 }
227
228 inline void randombytes_stir() {}
229
230 inline int randombytes_close() { return 0; }
231
232 inline const char* randombytes_implementation_name()
233 {
234 return "botan";
235 }
236
237 inline void randombytes(uint8_t buf[], size_t buf_len)
238 {
239 return randombytes_buf(buf, buf_len);
240 }
241
242 // sodium/crypto_secretbox_xsalsa20poly1305.h
243
244 inline size_t crypto_secretbox_xsalsa20poly1305_keybytes()
245 {
246 return crypto_secretbox_xsalsa20poly1305_KEYBYTES;
247 }
248
249 inline size_t crypto_secretbox_xsalsa20poly1305_noncebytes()
250 {
251 return crypto_secretbox_xsalsa20poly1305_NONCEBYTES;
252 }
253
254 inline size_t crypto_secretbox_xsalsa20poly1305_macbytes()
255 {
256 return crypto_secretbox_xsalsa20poly1305_MACBYTES;
257 }
258
259 inline size_t crypto_secretbox_xsalsa20poly1305_messagebytes_max()
260 {
261 return crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX;
262 }
263
264 BOTAN_PUBLIC_API(2,11)
265 int crypto_secretbox_xsalsa20poly1305(uint8_t ctext[],
266 const uint8_t ptext[],
267 size_t ptext_len,
268 const uint8_t nonce[],
269 const uint8_t key[]);
270
271 BOTAN_PUBLIC_API(2,11)
272 int crypto_secretbox_xsalsa20poly1305_open(uint8_t ptext[],
273 const uint8_t ctext[],
274 size_t ctext_len,
275 const uint8_t nonce[],
276 const uint8_t key[]);
277
278 inline void crypto_secretbox_xsalsa20poly1305_keygen(uint8_t k[32])
279 {
280 return randombytes_buf(k, 32);
281 }
282
283 inline size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes()
284 {
285 return crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES;
286 }
287
288 inline size_t crypto_secretbox_xsalsa20poly1305_zerobytes()
289 {
290 return crypto_secretbox_xsalsa20poly1305_ZEROBYTES;
291 }
292
293 // sodium/crypto_secretbox.h
294
295 inline size_t crypto_secretbox_keybytes() { return crypto_secretbox_KEYBYTES; }
296
297 inline size_t crypto_secretbox_noncebytes() { return crypto_secretbox_NONCEBYTES; }
298
299 inline size_t crypto_secretbox_macbytes() { return crypto_secretbox_MACBYTES; }
300
301 inline size_t crypto_secretbox_messagebytes_max() { return crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX; }
302
303 inline const char* crypto_secretbox_primitive() { return "xsalsa20poly1305"; }
304
305 BOTAN_PUBLIC_API(2,11)
306 int crypto_secretbox_detached(uint8_t ctext[], uint8_t mac[],
307 const uint8_t ptext[],
308 size_t ptext_len,
309 const uint8_t nonce[],
310 const uint8_t key[]);
311
312 BOTAN_PUBLIC_API(2,11)
313 int crypto_secretbox_open_detached(uint8_t ptext[],
314 const uint8_t ctext[],
315 const uint8_t mac[],
316 size_t ctext_len,
317 const uint8_t nonce[],
318 const uint8_t key[]);
319
320 inline int crypto_secretbox_easy(uint8_t ctext[], const uint8_t ptext[],
321 size_t ptext_len, const uint8_t nonce[],
322 const uint8_t key[])
323 {
324 return crypto_secretbox_detached(ctext + crypto_secretbox_MACBYTES, ctext,
325 ptext, ptext_len, nonce, key);
326 }
327
328 inline int crypto_secretbox_open_easy(uint8_t out[], const uint8_t ctext[], size_t ctext_len,
329 const uint8_t nonce[], const uint8_t key[])
330 {
331 if(ctext_len < crypto_secretbox_MACBYTES)
332 {
333 return -1;
334 }
335
336 return crypto_secretbox_open_detached(out, ctext + crypto_secretbox_MACBYTES,
337 ctext, ctext_len - crypto_secretbox_MACBYTES,
338 nonce, key);
339 }
340
341 inline void crypto_secretbox_keygen(uint8_t k[32])
342 {
343 return randombytes_buf(k, 32);
344 }
345
346 inline size_t crypto_secretbox_zerobytes()
347 {
348 return crypto_secretbox_ZEROBYTES;
349 }
350
351 inline size_t crypto_secretbox_boxzerobytes()
352 {
353 return crypto_secretbox_BOXZEROBYTES;
354 }
355
356 inline int crypto_secretbox(uint8_t ctext[], const uint8_t ptext[],
357 size_t ptext_len, const uint8_t nonce[],
358 const uint8_t key[])
359 {
360 return crypto_secretbox_xsalsa20poly1305(ctext, ptext, ptext_len, nonce, key);
361 }
362
363 inline int crypto_secretbox_open(uint8_t ptext[], const uint8_t ctext[],
364 size_t ctext_len, const uint8_t nonce[],
365 const uint8_t key[])
366 {
367 return crypto_secretbox_xsalsa20poly1305_open(ptext, ctext, ctext_len, nonce, key);
368 }
369
370 // sodium/crypto_aead_xchacha20poly1305.h
371
372 inline size_t crypto_aead_chacha20poly1305_ietf_keybytes()
373 {
374 return crypto_aead_chacha20poly1305_ietf_KEYBYTES;
375 }
376
377 inline size_t crypto_aead_chacha20poly1305_ietf_nsecbytes()
378 {
379 return crypto_aead_chacha20poly1305_ietf_NSECBYTES;
380 }
381
382 inline size_t crypto_aead_chacha20poly1305_ietf_npubbytes()
383 {
384 return crypto_aead_chacha20poly1305_ietf_NPUBBYTES;
385 }
386
387 inline size_t crypto_aead_chacha20poly1305_ietf_abytes()
388 {
389 return crypto_aead_chacha20poly1305_ietf_ABYTES;
390 }
391
392 inline size_t crypto_aead_chacha20poly1305_ietf_messagebytes_max()
393 {
394 return crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX;
395 }
396
397 BOTAN_PUBLIC_API(2,11)
398 int crypto_aead_chacha20poly1305_ietf_encrypt(uint8_t ctext[],
399 unsigned long long* ctext_len,
400 const uint8_t ptext[],
401 size_t ptext_len,
402 const uint8_t ad[],
403 size_t ad_len,
404 const uint8_t unused_secret_nonce[],
405 const uint8_t nonce[],
406 const uint8_t key[]);
407
408 BOTAN_PUBLIC_API(2,11)
409 int crypto_aead_chacha20poly1305_ietf_decrypt(uint8_t ptext[],
410 unsigned long long* ptext_len,
411 uint8_t unused_secret_nonce[],
412 const uint8_t ctext[],
413 size_t ctext_len,
414 const uint8_t ad[],
415 size_t ad_len,
416 const uint8_t nonce[],
417 const uint8_t key[]);
418
419 BOTAN_PUBLIC_API(2,11)
420 int crypto_aead_chacha20poly1305_ietf_encrypt_detached(uint8_t ctext[],
421 uint8_t mac[],
422 unsigned long long* mac_len,
423 const uint8_t ptext[],
424 size_t ptext_len,
425 const uint8_t ad[],
426 size_t ad_len,
427 const uint8_t unused_secret_nonce[],
428 const uint8_t nonce[],
429 const uint8_t key[]);
430
431 BOTAN_PUBLIC_API(2,11)
432 int crypto_aead_chacha20poly1305_ietf_decrypt_detached(uint8_t m[],
433 uint8_t unused_secret_nonce[],
434 const uint8_t ctext[],
435 size_t ctext_len,
436 const uint8_t mac[],
437 const uint8_t ad[],
438 size_t ad_len,
439 const uint8_t nonce[],
440 const uint8_t key[]);
441
442 inline void crypto_aead_chacha20poly1305_ietf_keygen(uint8_t k[32])
443 {
444 return randombytes_buf(k, crypto_aead_chacha20poly1305_ietf_KEYBYTES);
445 }
446
447 inline size_t crypto_aead_chacha20poly1305_keybytes()
448 {
449 return crypto_aead_chacha20poly1305_KEYBYTES;
450 }
451
452 inline size_t crypto_aead_chacha20poly1305_nsecbytes()
453 {
454 return crypto_aead_chacha20poly1305_NSECBYTES;
455 }
456
457 inline size_t crypto_aead_chacha20poly1305_npubbytes()
458 {
459 return crypto_aead_chacha20poly1305_NPUBBYTES;
460 }
461
462 inline size_t crypto_aead_chacha20poly1305_abytes()
463 {
464 return crypto_aead_chacha20poly1305_ABYTES;
465 }
466
467 inline size_t crypto_aead_chacha20poly1305_messagebytes_max()
468 {
469 return crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX;
470 }
471
472 BOTAN_PUBLIC_API(2,11)
473 int crypto_aead_chacha20poly1305_encrypt(uint8_t ctext[],
474 unsigned long long* ctext_len,
475 const uint8_t ptext[],
476 size_t ptext_len,
477 const uint8_t ad[],
478 size_t ad_len,
479 const uint8_t unused_secret_nonce[],
480 const uint8_t nonce[],
481 const uint8_t key[]);
482
483 BOTAN_PUBLIC_API(2,11)
484 int crypto_aead_chacha20poly1305_decrypt(uint8_t m[],
485 unsigned long long* ptext_len,
486 uint8_t unused_secret_nonce[],
487 const uint8_t ctext[],
488 size_t ctext_len,
489 const uint8_t ad[],
490 size_t ad_len,
491 const uint8_t nonce[],
492 const uint8_t key[]);
493
494 BOTAN_PUBLIC_API(2,11)
495 int crypto_aead_chacha20poly1305_encrypt_detached(uint8_t ctext[],
496 uint8_t mac[],
497 unsigned long long* mac_len,
498 const uint8_t ptext[],
499 size_t ptext_len,
500 const uint8_t ad[],
501 size_t ad_len,
502 const uint8_t unused_secret_nonce[],
503 const uint8_t nonce[],
504 const uint8_t key[]);
505
506 BOTAN_PUBLIC_API(2,11)
507 int crypto_aead_chacha20poly1305_decrypt_detached(uint8_t m[],
508 uint8_t unused_secret_nonce[],
509 const uint8_t ctext[],
510 size_t ctext_len,
511 const uint8_t mac[],
512 const uint8_t ad[],
513 size_t ad_len,
514 const uint8_t nonce[],
515 const uint8_t key[]);
516
517 inline void crypto_aead_chacha20poly1305_keygen(uint8_t k[32])
518 {
519 randombytes_buf(k, 32);
520 }
521
522 // sodium/crypto_aead_xchacha20poly1305.h
523
524 inline size_t crypto_aead_xchacha20poly1305_ietf_keybytes()
525 {
526 return crypto_aead_xchacha20poly1305_ietf_KEYBYTES;
527 }
528
529 inline size_t crypto_aead_xchacha20poly1305_ietf_nsecbytes()
530 {
531 return crypto_aead_xchacha20poly1305_ietf_NSECBYTES;
532 }
533
534 inline size_t crypto_aead_xchacha20poly1305_ietf_npubbytes()
535 {
536 return crypto_aead_xchacha20poly1305_ietf_NPUBBYTES;
537 }
538
539 inline size_t crypto_aead_xchacha20poly1305_ietf_abytes()
540 {
541 return crypto_aead_xchacha20poly1305_ietf_ABYTES;
542 }
543
544 inline size_t crypto_aead_xchacha20poly1305_ietf_messagebytes_max()
545 {
546 return crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX;
547 }
548
549 BOTAN_PUBLIC_API(2,11)
550 int crypto_aead_xchacha20poly1305_ietf_encrypt(uint8_t ctext[],
551 unsigned long long* ctext_len,
552 const uint8_t ptext[],
553 size_t ptext_len,
554 const uint8_t ad[],
555 size_t ad_len,
556 const uint8_t unused_secret_nonce[],
557 const uint8_t nonce[],
558 const uint8_t key[]);
559
560 BOTAN_PUBLIC_API(2,11)
561 int crypto_aead_xchacha20poly1305_ietf_decrypt(uint8_t ptext[],
562 unsigned long long* ptext_len,
563 uint8_t unused_secret_nonce[],
564 const uint8_t ctext[],
565 size_t ctext_len,
566 const uint8_t ad[],
567 size_t ad_len,
568 const uint8_t nonce[],
569 const uint8_t key[]);
570
571 BOTAN_PUBLIC_API(2,11)
572 int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(uint8_t ctext[],
573 uint8_t mac[],
574 unsigned long long* mac_len,
575 const uint8_t ptext[],
576 size_t ptext_len,
577 const uint8_t ad[],
578 size_t ad_len,
579 const uint8_t unused_secret_nonce[],
580 const uint8_t nonce[],
581 const uint8_t key[]);
582
583 BOTAN_PUBLIC_API(2,11)
584 int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(uint8_t ptext[],
585 uint8_t unused_secret_nonce[],
586 const uint8_t ctext[],
587 size_t ctext_len,
588 const uint8_t mac[],
589 const uint8_t ad[],
590 size_t ad_len,
591 const uint8_t nonce[],
592 const uint8_t key[]);
593
594 inline void crypto_aead_xchacha20poly1305_ietf_keygen(uint8_t k[32])
595 {
596 return randombytes_buf(k, 32);
597 }
598
599 // sodium/crypto_box_curve25519xsalsa20poly1305.h
600
601 inline size_t crypto_box_curve25519xsalsa20poly1305_seedbytes()
602 {
603 return crypto_box_curve25519xsalsa20poly1305_SEEDBYTES;
604 }
605
606 inline size_t crypto_box_curve25519xsalsa20poly1305_publickeybytes()
607 {
608 return crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES;
609 }
610
611 inline size_t crypto_box_curve25519xsalsa20poly1305_secretkeybytes()
612 {
613 return crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES;
614 }
615
616 inline size_t crypto_box_curve25519xsalsa20poly1305_beforenmbytes()
617 {
618 return crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES;
619 }
620
621 inline size_t crypto_box_curve25519xsalsa20poly1305_noncebytes()
622 {
623 return crypto_box_curve25519xsalsa20poly1305_NONCEBYTES;
624 }
625
626 inline size_t crypto_box_curve25519xsalsa20poly1305_macbytes()
627 {
628 return crypto_box_curve25519xsalsa20poly1305_MACBYTES;
629 }
630
631 inline size_t crypto_box_curve25519xsalsa20poly1305_messagebytes_max()
632 {
633 return crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX;
634 }
635
636 inline size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes()
637 {
638 return crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES;
639 }
640
641 inline size_t crypto_box_curve25519xsalsa20poly1305_zerobytes()
642 {
643 return crypto_box_curve25519xsalsa20poly1305_ZEROBYTES;
644 }
645
646 BOTAN_PUBLIC_API(2,11)
647 int crypto_box_curve25519xsalsa20poly1305_seed_keypair(uint8_t pk[32],
648 uint8_t sk[32],
649 const uint8_t seed[32]);
650
651 BOTAN_PUBLIC_API(2,11)
652 int crypto_box_curve25519xsalsa20poly1305_keypair(uint8_t pk[32],
653 uint8_t sk[32]);
654
655 BOTAN_PUBLIC_API(2,11)
656 int crypto_box_curve25519xsalsa20poly1305_beforenm(uint8_t key[],
657 const uint8_t pk[32],
658 const uint8_t sk[32]);
659
660 BOTAN_PUBLIC_API(2,11)
661 int crypto_box_curve25519xsalsa20poly1305(uint8_t ctext[],
662 const uint8_t ptext[],
663 size_t ptext_len,
664 const uint8_t nonce[],
665 const uint8_t pk[32],
666 const uint8_t sk[32]);
667
668 BOTAN_PUBLIC_API(2,11)
669 int crypto_box_curve25519xsalsa20poly1305_open(uint8_t ptext[],
670 const uint8_t ctext[],
671 size_t ctext_len,
672 const uint8_t nonce[],
673 const uint8_t pk[32],
674 const uint8_t sk[32]);
675
676 inline int crypto_box_curve25519xsalsa20poly1305_afternm(uint8_t ctext[],
677 const uint8_t ptext[],
678 size_t ptext_len,
679 const uint8_t nonce[],
680 const uint8_t key[])
681 {
682 return crypto_secretbox_xsalsa20poly1305(ctext, ptext, ptext_len, nonce, key);
683 }
684
685 inline int crypto_box_curve25519xsalsa20poly1305_open_afternm(uint8_t ptext[],
686 const uint8_t ctext[],
687 size_t ctext_len,
688 const uint8_t nonce[],
689 const uint8_t key[])
690 {
691 return crypto_secretbox_xsalsa20poly1305_open(ptext, ctext, ctext_len, nonce, key);
692 }
693
694 // sodium/crypto_box.h
695
696 inline size_t crypto_box_seedbytes()
697 {
698 return crypto_box_SEEDBYTES;
699 }
700
701 inline size_t crypto_box_publickeybytes()
702 {
703 return crypto_box_PUBLICKEYBYTES;
704 }
705
706 inline size_t crypto_box_secretkeybytes()
707 {
708 return crypto_box_SECRETKEYBYTES;
709 }
710
711 inline size_t crypto_box_noncebytes()
712 {
713 return crypto_box_NONCEBYTES;
714 }
715
716 inline size_t crypto_box_macbytes()
717 {
718 return crypto_box_MACBYTES;
719 }
720
721 inline size_t crypto_box_messagebytes_max()
722 {
723 return crypto_box_MESSAGEBYTES_MAX;
724 }
725
726 inline size_t crypto_box_beforenmbytes()
727 {
728 return crypto_box_BEFORENMBYTES;
729 }
730
731 inline const char* crypto_box_primitive() { return "curve25519xsalsa20poly1305"; }
732
733 inline int crypto_box_seed_keypair(uint8_t pk[32], uint8_t sk[32],
734 const uint8_t seed[])
735 {
736 return crypto_box_curve25519xsalsa20poly1305_seed_keypair(pk, sk, seed);
737 }
738
739 inline int crypto_box_keypair(uint8_t pk[32], uint8_t sk[32])
740 {
741 return crypto_box_curve25519xsalsa20poly1305_keypair(pk, sk);
742 }
743
744 BOTAN_PUBLIC_API(2,11)
745 int crypto_box_detached(uint8_t ctext[], uint8_t mac[],
746 const uint8_t ptext[], size_t ptext_len,
747 const uint8_t nonce[], const uint8_t pk[32],
748 const uint8_t sk[32]);
749
750 BOTAN_PUBLIC_API(2,11)
751 int crypto_box_open_detached(uint8_t ptext[], const uint8_t ctext[],
752 const uint8_t mac[],
753 size_t ctext_len,
754 const uint8_t nonce[],
755 const uint8_t pk[32],
756 const uint8_t sk[32]);
757
758 inline int crypto_box_easy(uint8_t ctext[], const uint8_t ptext[],
759 size_t ptext_len, const uint8_t nonce[],
760 const uint8_t pk[32], const uint8_t sk[32])
761 {
762 return crypto_box_detached(ctext + crypto_box_MACBYTES, ctext, ptext, ptext_len, nonce, pk, sk);
763 }
764
765 inline int crypto_box_open_easy(uint8_t ptext[], const uint8_t ctext[],
766 size_t ctext_len, const uint8_t nonce[],
767 const uint8_t pk[32], const uint8_t sk[32])
768 {
769 if(ctext_len < crypto_box_MACBYTES)
770 {
771 return -1;
772 }
773
774 return crypto_box_open_detached(ptext, ctext + crypto_box_MACBYTES,
775 ctext, ctext_len - crypto_box_MACBYTES,
776 nonce, pk, sk);
777 }
778
779 inline int crypto_box_beforenm(uint8_t key[], const uint8_t pk[32],
780 const uint8_t sk[32])
781 {
782 return crypto_box_curve25519xsalsa20poly1305_beforenm(key, pk, sk);
783 }
784
785 inline int crypto_box_afternm(uint8_t ctext[], const uint8_t ptext[],
786 size_t ptext_len, const uint8_t nonce[],
787 const uint8_t key[])
788 {
789 return crypto_box_curve25519xsalsa20poly1305_afternm(ctext, ptext, ptext_len, nonce, key);
790 }
791
792 inline int crypto_box_open_afternm(uint8_t ptext[], const uint8_t ctext[],
793 size_t ctext_len, const uint8_t nonce[],
794 const uint8_t key[])
795 {
796 return crypto_box_curve25519xsalsa20poly1305_open_afternm(ptext, ctext, ctext_len, nonce, key);
797 }
798
799 inline int crypto_box_open_detached_afternm(uint8_t ptext[], const uint8_t ctext[],
800 const uint8_t mac[],
801 size_t ctext_len, const uint8_t nonce[],
802 const uint8_t key[])
803 {
804 return crypto_secretbox_open_detached(ptext, ctext, mac, ctext_len, nonce, key);
805 }
806
807 inline int crypto_box_open_easy_afternm(uint8_t ptext[], const uint8_t ctext[],
808 size_t ctext_len, const uint8_t nonce[],
809 const uint8_t key[])
810 {
811 if(ctext_len < crypto_box_MACBYTES)
812 {
813 return -1;
814 }
815
816 return crypto_box_open_detached_afternm(ptext, ctext + crypto_box_MACBYTES,
817 ctext, ctext_len - crypto_box_MACBYTES,
818 nonce, key);
819 }
820
821 inline int crypto_box_detached_afternm(uint8_t ctext[], uint8_t mac[],
822 const uint8_t ptext[], size_t ptext_len,
823 const uint8_t nonce[], const uint8_t key[])
824 {
825 return crypto_secretbox_detached(ctext, mac, ptext, ptext_len, nonce, key);
826 }
827
828 inline int crypto_box_easy_afternm(uint8_t ctext[], const uint8_t ptext[],
829 size_t ptext_len, const uint8_t nonce[],
830 const uint8_t key[])
831 {
832 return crypto_box_detached_afternm(ctext + crypto_box_MACBYTES, ctext, ptext, ptext_len, nonce, key);
833 }
834
835 inline size_t crypto_box_zerobytes() { return crypto_box_ZEROBYTES; }
836
837 inline size_t crypto_box_boxzerobytes() { return crypto_box_BOXZEROBYTES; }
838
839 inline int crypto_box(uint8_t ctext[], const uint8_t ptext[],
840 size_t ptext_len, const uint8_t nonce[],
841 const uint8_t pk[32], const uint8_t sk[32])
842 {
843 return crypto_box_curve25519xsalsa20poly1305(ctext, ptext, ptext_len, nonce, pk, sk);
844 }
845
846 inline int crypto_box_open(uint8_t ptext[], const uint8_t ctext[],
847 size_t ctext_len, const uint8_t nonce[],
848 const uint8_t pk[32], const uint8_t sk[32])
849 {
850 return crypto_box_curve25519xsalsa20poly1305_open(ptext, ctext, ctext_len, nonce, pk, sk);
851 }
852
853 // sodium/crypto_hash_sha512.h
854
855 inline size_t crypto_hash_sha512_bytes() { return crypto_hash_sha512_BYTES; }
856
857 BOTAN_PUBLIC_API(2,11)
858 int crypto_hash_sha512(uint8_t out[64], const uint8_t in[], size_t in_len);
859
860 // sodium/crypto_auth_hmacsha512.h
861
862 inline size_t crypto_auth_hmacsha512_bytes() { return crypto_auth_hmacsha512_BYTES; }
863
864 inline size_t crypto_auth_hmacsha512_keybytes() { return crypto_auth_hmacsha512_KEYBYTES; }
865
866 BOTAN_PUBLIC_API(2,11)
867 int crypto_auth_hmacsha512(uint8_t out[],
868 const uint8_t in[],
869 size_t in_len,
870 const uint8_t key[]);
871
872 BOTAN_PUBLIC_API(2,11)
873 int crypto_auth_hmacsha512_verify(const uint8_t h[],
874 const uint8_t in[],
875 size_t in_len,
876 const uint8_t key[]);
877
878 inline void crypto_auth_hmacsha512_keygen(uint8_t k[32])
879 {
880 return randombytes_buf(k, 32);
881 }
882
883 // sodium/crypto_auth_hmacsha512256.h
884
885 inline size_t crypto_auth_hmacsha512256_bytes()
886 {
887 return crypto_auth_hmacsha512256_BYTES;
888 }
889
890 inline size_t crypto_auth_hmacsha512256_keybytes()
891 {
892 return crypto_auth_hmacsha512256_KEYBYTES;
893 }
894
895 BOTAN_PUBLIC_API(2,11)
896 int crypto_auth_hmacsha512256(uint8_t out[],
897 const uint8_t in[],
898 size_t in_len,
899 const uint8_t key[]);
900
901 BOTAN_PUBLIC_API(2,11)
902 int crypto_auth_hmacsha512256_verify(const uint8_t h[],
903 const uint8_t in[],
904 size_t in_len,
905 const uint8_t key[]);
906
907 inline void crypto_auth_hmacsha512256_keygen(uint8_t k[32])
908 {
909 return randombytes_buf(k, 32);
910 }
911
912 // sodium/crypto_auth.h
913
914 inline size_t crypto_auth_bytes() { return crypto_auth_BYTES; }
915
916 inline size_t crypto_auth_keybytes() { return crypto_auth_KEYBYTES; }
917
918 inline const char* crypto_auth_primitive() { return "hmacsha512256"; }
919
920 inline int crypto_auth(uint8_t out[], const uint8_t in[],
921 size_t in_len, const uint8_t key[])
922 {
923 return crypto_auth_hmacsha512256(out, in, in_len, key);
924 }
925
926 inline int crypto_auth_verify(const uint8_t mac[], const uint8_t in[],
927 size_t in_len, const uint8_t key[])
928 {
929 return crypto_auth_hmacsha512256_verify(mac, in, in_len, key);
930 }
931
932 inline void crypto_auth_keygen(uint8_t k[])
933 {
934 return randombytes_buf(k, crypto_auth_KEYBYTES);
935 }
936
937 // sodium/crypto_hash_sha256.h
938
939 inline size_t crypto_hash_sha256_bytes()
940 {
941 return crypto_hash_sha256_BYTES;
942 }
943
944 BOTAN_PUBLIC_API(2,11)
945 int crypto_hash_sha256(uint8_t out[], const uint8_t in[], size_t in_len);
946
947 // sodium/crypto_auth_hmacsha256.h
948
949 inline size_t crypto_auth_hmacsha256_bytes()
950 {
951 return crypto_auth_hmacsha256_BYTES;
952 }
953
954 inline size_t crypto_auth_hmacsha256_keybytes()
955 {
956 return crypto_auth_hmacsha256_KEYBYTES;
957 }
958
959 BOTAN_PUBLIC_API(2,11)
960 int crypto_auth_hmacsha256(uint8_t out[],
961 const uint8_t in[],
962 size_t in_len,
963 const uint8_t key[]);
964
965 BOTAN_PUBLIC_API(2,11)
966 int crypto_auth_hmacsha256_verify(const uint8_t h[],
967 const uint8_t in[],
968 size_t in_len,
969 const uint8_t key[]);
970
971 inline void crypto_auth_hmacsha256_keygen(uint8_t k[32])
972 {
973 return randombytes_buf(k, 32);
974 }
975
976 // sodium/crypto_stream_xsalsa20.h
977
978 inline size_t crypto_stream_xsalsa20_keybytes()
979 {
980 return crypto_stream_xsalsa20_KEYBYTES;
981 }
982
983 inline size_t crypto_stream_xsalsa20_noncebytes()
984 {
985 return crypto_stream_xsalsa20_NONCEBYTES;
986 }
987
988 inline size_t crypto_stream_xsalsa20_messagebytes_max()
989 {
990 return crypto_stream_xsalsa20_MESSAGEBYTES_MAX;
991 }
992
993 BOTAN_PUBLIC_API(2,11)
994 int crypto_stream_xsalsa20(uint8_t out[], size_t ctext_len,
995 const uint8_t nonce[], const uint8_t key[]);
996
997 BOTAN_PUBLIC_API(2,11)
998 int crypto_stream_xsalsa20_xor(uint8_t out[], const uint8_t ptext[],
999 size_t ptext_len, const uint8_t nonce[],
1000 const uint8_t key[]);
1001
1002 BOTAN_PUBLIC_API(2,11)
1003 int crypto_stream_xsalsa20_xor_ic(uint8_t out[], const uint8_t ptext[],
1004 size_t ptext_len,
1005 const uint8_t nonce[], uint64_t ic,
1006 const uint8_t key[]);
1007
1008 inline void crypto_stream_xsalsa20_keygen(uint8_t k[32])
1009 {
1010 return randombytes_buf(k, 32);
1011 }
1012
1013 // sodium/crypto_core_hsalsa20.h
1014
1015 inline size_t crypto_core_hsalsa20_outputbytes()
1016 {
1017 return crypto_core_hsalsa20_OUTPUTBYTES;
1018 }
1019
1020 inline size_t crypto_core_hsalsa20_inputbytes()
1021 {
1022 return crypto_core_hsalsa20_INPUTBYTES;
1023 }
1024
1025 inline size_t crypto_core_hsalsa20_keybytes()
1026 {
1027 return crypto_core_hsalsa20_KEYBYTES;
1028 }
1029
1030 inline size_t crypto_core_hsalsa20_constbytes()
1031 {
1032 return crypto_core_hsalsa20_CONSTBYTES;
1033 }
1034
1035 BOTAN_PUBLIC_API(2,11)
1036 int crypto_core_hsalsa20(uint8_t out[], const uint8_t in[],
1037 const uint8_t key[], const uint8_t c[]);
1038
1039 // sodium/crypto_hash.h
1040
1041 inline size_t crypto_hash_bytes()
1042 {
1043 return crypto_hash_BYTES;
1044 }
1045
1046 inline int crypto_hash(uint8_t out[], const uint8_t in[], size_t in_len)
1047 {
1048 return crypto_hash_sha512(out, in, in_len);
1049 }
1050
1051 inline const char* crypto_hash_primitive() { return "sha512"; }
1052
1053 // sodium/crypto_onetimeauth_poly1305.h
1054
1055 inline size_t crypto_onetimeauth_poly1305_bytes()
1056 {
1057 return crypto_onetimeauth_poly1305_BYTES;
1058 }
1059
1060 inline size_t crypto_onetimeauth_poly1305_keybytes()
1061 {
1062 return crypto_onetimeauth_poly1305_KEYBYTES;
1063 }
1064
1065 BOTAN_PUBLIC_API(2,11)
1066 int crypto_onetimeauth_poly1305(uint8_t out[],
1067 const uint8_t in[],
1068 size_t in_len,
1069 const uint8_t key[]);
1070
1071 BOTAN_PUBLIC_API(2,11)
1072 int crypto_onetimeauth_poly1305_verify(const uint8_t h[],
1073 const uint8_t in[],
1074 size_t in_len,
1075 const uint8_t key[]);
1076
1077 inline void crypto_onetimeauth_poly1305_keygen(uint8_t k[32])
1078 {
1079 return randombytes_buf(k, 32);
1080 }
1081
1082 // sodium/crypto_onetimeauth.h
1083
1084 inline size_t crypto_onetimeauth_bytes() { return crypto_onetimeauth_BYTES; }
1085
1086 inline size_t crypto_onetimeauth_keybytes() { return crypto_onetimeauth_KEYBYTES; }
1087
1088 inline const char* crypto_onetimeauth_primitive() { return "poly1305"; }
1089
1090 inline int crypto_onetimeauth(uint8_t out[], const uint8_t in[],
1091 size_t in_len, const uint8_t key[])
1092 {
1093 return crypto_onetimeauth_poly1305(out, in, in_len, key);
1094 }
1095
1096 inline int crypto_onetimeauth_verify(const uint8_t h[], const uint8_t in[],
1097 size_t in_len, const uint8_t key[])
1098 {
1099 return crypto_onetimeauth_poly1305_verify(h, in, in_len, key);
1100 }
1101
1102 inline void crypto_onetimeauth_keygen(uint8_t k[32])
1103 {
1104 return crypto_onetimeauth_poly1305_keygen(k);
1105 }
1106
1107 // sodium/crypto_scalarmult_curve25519.h
1108
1109 inline size_t crypto_scalarmult_curve25519_bytes()
1110 {
1111 return crypto_scalarmult_curve25519_BYTES;
1112 }
1113
1114 inline size_t crypto_scalarmult_curve25519_scalarbytes()
1115 {
1116 return crypto_scalarmult_curve25519_SCALARBYTES;
1117 }
1118
1119 BOTAN_PUBLIC_API(2,11)
1120 int crypto_scalarmult_curve25519(uint8_t out[32], const uint8_t scalar[32], const uint8_t basepoint[32]);
1121
1122 BOTAN_PUBLIC_API(2,11)
1123 int crypto_scalarmult_curve25519_base(uint8_t out[32], const uint8_t scalar[32]);
1124
1125 // sodium/crypto_scalarmult.h
1126
1127 inline size_t crypto_scalarmult_bytes() { return crypto_scalarmult_curve25519_bytes(); }
1128
1129 inline size_t crypto_scalarmult_scalarbytes() { return crypto_scalarmult_curve25519_scalarbytes(); }
1130
1131 inline const char* crypto_scalarmult_primitive() { return "curve25519"; }
1132
1133 inline int crypto_scalarmult_base(uint8_t out[], const uint8_t scalar[])
1134 {
1135 return crypto_scalarmult_curve25519_base(out, scalar);
1136 }
1137
1138 inline int crypto_scalarmult(uint8_t out[], const uint8_t scalar[], const uint8_t base[])
1139 {
1140 return crypto_scalarmult_curve25519(out, scalar, base);
1141 }
1142
1143 // sodium/crypto_stream_chacha20.h
1144
1145 inline size_t crypto_stream_chacha20_keybytes()
1146 {
1147 return crypto_stream_chacha20_KEYBYTES;
1148 }
1149
1150 inline size_t crypto_stream_chacha20_noncebytes()
1151 {
1152 return crypto_stream_chacha20_NONCEBYTES;
1153 }
1154
1155 inline size_t crypto_stream_chacha20_messagebytes_max()
1156 {
1157 return crypto_stream_chacha20_MESSAGEBYTES_MAX;
1158 }
1159
1160 BOTAN_PUBLIC_API(2,11)
1161 int crypto_stream_chacha20(uint8_t out[], size_t ctext_len,
1162 const uint8_t nonce[], const uint8_t key[]);
1163
1164 BOTAN_PUBLIC_API(2,11)
1165 int crypto_stream_chacha20_xor(uint8_t out[], const uint8_t ptext[],
1166 size_t ptext_len, const uint8_t nonce[],
1167 const uint8_t key[]);
1168
1169 BOTAN_PUBLIC_API(2,11)
1170 int crypto_stream_chacha20_xor_ic(uint8_t out[], const uint8_t ptext[],
1171 size_t ptext_len,
1172 const uint8_t nonce[], uint64_t ic,
1173 const uint8_t key[]);
1174
1175 inline void crypto_stream_chacha20_keygen(uint8_t k[32])
1176 {
1177 return randombytes_buf(k, 32);
1178 }
1179
1180 inline size_t crypto_stream_chacha20_ietf_keybytes()
1181 {
1182 return crypto_stream_chacha20_ietf_KEYBYTES;
1183 }
1184
1185 inline size_t crypto_stream_chacha20_ietf_noncebytes()
1186 {
1187 return crypto_stream_chacha20_ietf_NONCEBYTES;
1188 }
1189
1190 inline size_t crypto_stream_chacha20_ietf_messagebytes_max()
1191 {
1192 return crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX;
1193 }
1194
1195 BOTAN_PUBLIC_API(2,11)
1196 int crypto_stream_chacha20_ietf(uint8_t out[], size_t ctext_len,
1197 const uint8_t nonce[], const uint8_t key[]);
1198
1199 BOTAN_PUBLIC_API(2,11)
1200 int crypto_stream_chacha20_ietf_xor(uint8_t out[], const uint8_t ptext[],
1201 size_t ptext_len, const uint8_t nonce[],
1202 const uint8_t key[]);
1203
1204 BOTAN_PUBLIC_API(2,11)
1205 int crypto_stream_chacha20_ietf_xor_ic(uint8_t out[], const uint8_t ptext[],
1206 size_t ptext_len,
1207 const uint8_t nonce[], uint32_t ic,
1208 const uint8_t key[]);
1209
1210 inline void crypto_stream_chacha20_ietf_keygen(uint8_t k[32])
1211 {
1212 return randombytes_buf(k, 32);
1213 }
1214
1215 // sodium/crypto_stream_xchacha20.h
1216
1217 inline size_t crypto_stream_xchacha20_keybytes()
1218 {
1219 return crypto_stream_xchacha20_KEYBYTES;
1220 }
1221
1222 inline size_t crypto_stream_xchacha20_noncebytes()
1223 {
1224 return crypto_stream_xchacha20_NONCEBYTES;
1225 }
1226
1227 inline size_t crypto_stream_xchacha20_messagebytes_max()
1228 {
1229 return crypto_stream_xchacha20_MESSAGEBYTES_MAX;
1230 }
1231
1232 BOTAN_PUBLIC_API(2,11)
1233 int crypto_stream_xchacha20(uint8_t out[], size_t ctext_len,
1234 const uint8_t nonce[], const uint8_t key[]);
1235
1236 BOTAN_PUBLIC_API(2,11)
1237 int crypto_stream_xchacha20_xor(uint8_t out[], const uint8_t ptext[],
1238 size_t ptext_len, const uint8_t nonce[],
1239 const uint8_t key[]);
1240
1241 BOTAN_PUBLIC_API(2,11)
1242 int crypto_stream_xchacha20_xor_ic(uint8_t out[], const uint8_t ptext[],
1243 size_t ptext_len,
1244 const uint8_t nonce[], uint64_t ic,
1245 const uint8_t key[]);
1246
1247 inline void crypto_stream_xchacha20_keygen(uint8_t k[32])
1248 {
1249 return randombytes_buf(k, crypto_stream_xchacha20_KEYBYTES);
1250 }
1251
1252 // sodium/crypto_stream_salsa20.h
1253
1254 inline size_t crypto_stream_salsa20_keybytes()
1255 {
1256 return crypto_stream_xsalsa20_KEYBYTES;
1257 }
1258
1259 inline size_t crypto_stream_salsa20_noncebytes()
1260 {
1261 return crypto_stream_salsa20_NONCEBYTES;
1262 }
1263
1264 inline size_t crypto_stream_salsa20_messagebytes_max()
1265 {
1266 return crypto_stream_salsa20_MESSAGEBYTES_MAX;
1267 }
1268
1269 BOTAN_PUBLIC_API(2,11)
1270 int crypto_stream_salsa20(uint8_t out[], size_t ctext_len,
1271 const uint8_t nonce[], const uint8_t key[]);
1272
1273 BOTAN_PUBLIC_API(2,11)
1274 int crypto_stream_salsa20_xor(uint8_t out[], const uint8_t ptext[],
1275 size_t ptext_len, const uint8_t nonce[],
1276 const uint8_t key[]);
1277
1278 BOTAN_PUBLIC_API(2,11)
1279 int crypto_stream_salsa20_xor_ic(uint8_t out[], const uint8_t ptext[],
1280 size_t ptext_len,
1281 const uint8_t nonce[], uint64_t ic,
1282 const uint8_t key[]);
1283
1284 inline void crypto_stream_salsa20_keygen(uint8_t k[32])
1285 {
1286 return randombytes_buf(k, 32);
1287 }
1288
1289 // sodium/crypto_stream.h
1290
1291 inline size_t crypto_stream_keybytes() { return crypto_stream_xsalsa20_keybytes(); }
1292
1293 inline size_t crypto_stream_noncebytes() { return crypto_stream_xsalsa20_noncebytes(); }
1294
1295 inline size_t crypto_stream_messagebytes_max() { return crypto_stream_MESSAGEBYTES_MAX; }
1296
1297 inline const char* crypto_stream_primitive() { return "xsalsa20"; }
1298
1299 inline int crypto_stream(uint8_t out[], size_t out_len,
1300 const uint8_t nonce[24], const uint8_t key[32])
1301 {
1302 return crypto_stream_xsalsa20(out, out_len, nonce, key);
1303 }
1304
1305 inline int crypto_stream_xor(uint8_t out[], const uint8_t in[], size_t in_len,
1306 const uint8_t nonce[24], const uint8_t key[32])
1307 {
1308 return crypto_stream_xsalsa20_xor(out, in, in_len, nonce, key);
1309 }
1310
1311 inline void crypto_stream_keygen(uint8_t key[32])
1312 {
1313 return randombytes_buf(key, 32);
1314 }
1315
1316 // sodium/crypto_shorthash_siphash24.h
1317
1318 inline size_t crypto_shorthash_siphash24_bytes() { return crypto_shorthash_siphash24_BYTES; }
1319
1320 inline size_t crypto_shorthash_siphash24_keybytes() { return crypto_shorthash_siphash24_KEYBYTES; }
1321
1322 BOTAN_PUBLIC_API(2,11)
1323 int crypto_shorthash_siphash24(uint8_t out[8], const uint8_t in[], size_t in_len, const uint8_t key[16]);
1324
1325 // sodium/crypto_shorthash.h
1326
1327 inline size_t crypto_shorthash_bytes() { return crypto_shorthash_siphash24_bytes(); }
1328
1329 inline size_t crypto_shorthash_keybytes() { return crypto_shorthash_siphash24_keybytes(); }
1330
1331 inline const char* crypto_shorthash_primitive() { return "siphash24"; }
1332
1333 inline int crypto_shorthash(uint8_t out[], const uint8_t in[],
1334 size_t in_len, const uint8_t k[16])
1335 {
1336 return crypto_shorthash_siphash24(out, in, in_len, k);
1337 }
1338
1339 inline void crypto_shorthash_keygen(uint8_t k[16])
1340 {
1341 randombytes_buf(k, crypto_shorthash_siphash24_KEYBYTES);
1342 }
1343
1344 // sodium/crypto_sign_ed25519.h
1345
1346 inline size_t crypto_sign_ed25519_bytes()
1347 {
1348 return crypto_sign_ed25519_BYTES;
1349 }
1350
1351 inline size_t crypto_sign_ed25519_seedbytes()
1352 {
1353 return crypto_sign_ed25519_SEEDBYTES;
1354 }
1355
1356 inline size_t crypto_sign_ed25519_publickeybytes()
1357 {
1358 return crypto_sign_ed25519_PUBLICKEYBYTES;
1359 }
1360
1361 inline size_t crypto_sign_ed25519_secretkeybytes()
1362 {
1363 return crypto_sign_ed25519_SECRETKEYBYTES;
1364 }
1365
1366 inline size_t crypto_sign_ed25519_messagebytes_max()
1367 {
1368 return crypto_sign_ed25519_MESSAGEBYTES_MAX;
1369 }
1370
1371 BOTAN_PUBLIC_API(2,11)
1372 int crypto_sign_ed25519_detached(uint8_t sig[],
1373 unsigned long long* sig_len,
1374 const uint8_t msg[],
1375 size_t msg_len,
1376 const uint8_t sk[32]);
1377
1378 BOTAN_PUBLIC_API(2,11)
1379 int crypto_sign_ed25519_verify_detached(const uint8_t sig[],
1380 const uint8_t msg[],
1381 size_t msg_len,
1382 const uint8_t pk[32]);
1383
1384 BOTAN_PUBLIC_API(2,11)
1385 int crypto_sign_ed25519_keypair(uint8_t pk[32], uint8_t sk[64]);
1386
1387 BOTAN_PUBLIC_API(2,11)
1388 int crypto_sign_ed25519_seed_keypair(uint8_t pk[], uint8_t sk[],
1389 const uint8_t seed[]);
1390
1391 // sodium/crypto_sign.h
1392
1393 inline size_t crypto_sign_bytes()
1394 {
1395 return crypto_sign_BYTES;
1396 }
1397
1398 inline size_t crypto_sign_seedbytes()
1399 {
1400 return crypto_sign_SEEDBYTES;
1401 }
1402
1403 inline size_t crypto_sign_publickeybytes()
1404 {
1405 return crypto_sign_PUBLICKEYBYTES;
1406 }
1407
1408 inline size_t crypto_sign_secretkeybytes()
1409 {
1410 return crypto_sign_SECRETKEYBYTES;
1411 }
1412
1413 inline size_t crypto_sign_messagebytes_max()
1414 {
1415 return crypto_sign_MESSAGEBYTES_MAX;
1416 }
1417
1418 inline const char* crypto_sign_primitive()
1419 {
1420 return "ed25519";
1421 }
1422
1423 inline int crypto_sign_seed_keypair(uint8_t pk[32], uint8_t sk[32],
1424 const uint8_t seed[])
1425 {
1426 return crypto_sign_ed25519_seed_keypair(pk, sk, seed);
1427 }
1428
1429 inline int crypto_sign_keypair(uint8_t pk[32], uint8_t sk[32])
1430 {
1431 return crypto_sign_ed25519_keypair(pk, sk);
1432 }
1433
1434 inline int crypto_sign_detached(uint8_t sig[], unsigned long long* sig_len,
1435 const uint8_t msg[], size_t msg_len,
1436 const uint8_t sk[32])
1437 {
1438 return crypto_sign_ed25519_detached(sig, sig_len, msg, msg_len, sk);
1439 }
1440
1441 inline int crypto_sign_verify_detached(const uint8_t sig[],
1442 const uint8_t in[],
1443 size_t in_len,
1444 const uint8_t pk[32])
1445 {
1446 return crypto_sign_ed25519_verify_detached(sig, in, in_len, pk);
1447 }
1448
1449 }
1450
1451 }
1452
1453 #endif
Botan::Sodium::crypto_core_hsalsa20
int crypto_core_hsalsa20(uint8_t out[], const uint8_t in[], const uint8_t key[], const uint8_t c[])
Definition: sodium_salsa.cpp:13
Botan::Sodium::crypto_box_keypair
int crypto_box_keypair(uint8_t pk[32], uint8_t sk[32])
Definition: sodium.h:739
Botan::Sodium::crypto_hash
int crypto_hash(uint8_t out[], const uint8_t in[], size_t in_len)
Definition: sodium.h:1046
Botan::Sodium::crypto_scalarmult_scalarbytes
size_t crypto_scalarmult_scalarbytes()
Definition: sodium.h:1129
Botan::Sodium::crypto_core_hsalsa20_KEYBYTES
Definition: sodium.h:79
Botan::Sodium::crypto_stream_chacha20_ietf_keygen
void crypto_stream_chacha20_ietf_keygen(uint8_t k[32])
Definition: sodium.h:1210
Botan::Sodium::crypto_core_hsalsa20_outputbytes
size_t crypto_core_hsalsa20_outputbytes()
Definition: sodium.h:1015
Botan::Sodium::crypto_stream_chacha20_keybytes
size_t crypto_stream_chacha20_keybytes()
Definition: sodium.h:1145
Botan::Sodium::crypto_core_hchacha20_INPUTBYTES
Definition: sodium.h:73
Botan::Sodium::crypto_aead_chacha20poly1305_keygen
void crypto_aead_chacha20poly1305_keygen(uint8_t k[32])
Definition: sodium.h:517
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305
int crypto_box_curve25519xsalsa20poly1305(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium_box.cpp:42
Botan::Sodium::crypto_sign_ed25519_SEEDBYTES
Definition: sodium.h:119
Botan::Sodium::crypto_secretbox_noncebytes
size_t crypto_secretbox_noncebytes()
Definition: sodium.h:297
Botan::Sodium::crypto_box_ZEROBYTES
Definition: sodium.h:70
Botan::Sodium::crypto_stream_keygen
void crypto_stream_keygen(uint8_t key[32])
Definition: sodium.h:1311
Botan::Sodium::crypto_sign_ed25519_bytes
size_t crypto_sign_ed25519_bytes()
Definition: sodium.h:1346
Botan::Sodium::crypto_box_BOXZEROBYTES
Definition: sodium.h:63
Botan::Sodium::crypto_box
int crypto_box(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium.h:839
Botan::Sodium::crypto_secretbox
int crypto_secretbox(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:356
Botan::Sodium::crypto_secretbox_ZEROBYTES
Definition: sodium.h:108
Botan::Sodium::crypto_stream_salsa20_xor_ic
int crypto_stream_salsa20_xor_ic(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], uint64_t ic, const uint8_t key[])
Definition: sodium_salsa.cpp:75
Botan::Sodium::crypto_box_open_detached
int crypto_box_open_detached(uint8_t ptext[], const uint8_t ctext[], const uint8_t mac[], size_t ctext_len, const uint8_t nonce[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium_box.cpp:85
Botan::Sodium::sodium_memzero
void sodium_memzero(void *ptr, size_t len)
Definition: sodium_utils.cpp:60
Botan::Sodium::crypto_auth_hmacsha256_keybytes
size_t crypto_auth_hmacsha256_keybytes()
Definition: sodium.h:954
Botan::Sodium::crypto_onetimeauth_poly1305
int crypto_onetimeauth_poly1305(uint8_t out[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium_auth.cpp:39
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_npubbytes
size_t crypto_aead_chacha20poly1305_ietf_npubbytes()
Definition: sodium.h:382
Botan::Sodium::crypto_hash_sha256_BYTES
Definition: sodium.h:82
Botan::Sodium::crypto_hash_sha256
int crypto_hash_sha256(uint8_t out[], const uint8_t in[], size_t in_len)
Definition: sodium_auth.cpp:21
Botan::Sodium::randombytes_random
uint32_t randombytes_random()
Definition: sodium.h:221
Botan::Sodium::crypto_onetimeauth
int crypto_onetimeauth(uint8_t out[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium.h:1090
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_NSECBYTES
Definition: sodium.h:40
Botan::Sodium::crypto_stream_salsa20_keygen
void crypto_stream_salsa20_keygen(uint8_t k[32])
Definition: sodium.h:1284
Botan::Sodium::crypto_box_open_detached_afternm
int crypto_box_open_detached_afternm(uint8_t ptext[], const uint8_t ctext[], const uint8_t mac[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:799
Botan::Sodium::crypto_aead_chacha20poly1305_nsecbytes
size_t crypto_aead_chacha20poly1305_nsecbytes()
Definition: sodium.h:452
Botan::Sodium::crypto_sign_ed25519_SECRETKEYBYTES
Definition: sodium.h:118
Botan::Sodium::sodium_increment
void sodium_increment(uint8_t n[], size_t nlen)
Definition: sodium_utils.cpp:97
Botan::Sodium::crypto_scalarmult_curve25519_SCALARBYTES
Definition: sodium.h:92
Botan::Sodium::crypto_box_easy
int crypto_box_easy(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium.h:758
Botan::Sodium::sodium_allocarray
void * sodium_allocarray(size_t count, size_t size)
Definition: sodium_utils.cpp:140
Botan::Sodium::crypto_stream_chacha20_keygen
void crypto_stream_chacha20_keygen(uint8_t k[32])
Definition: sodium.h:1175
Botan::Sodium::crypto_box_publickeybytes
size_t crypto_box_publickeybytes()
Definition: sodium.h:701
Botan::Sodium::crypto_sign_ed25519_BYTES
Definition: sodium.h:115
Botan::Sodium::crypto_onetimeauth_poly1305_keygen
void crypto_onetimeauth_poly1305_keygen(uint8_t k[32])
Definition: sodium.h:1077
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_messagebytes_max
size_t crypto_aead_chacha20poly1305_ietf_messagebytes_max()
Definition: sodium.h:392
Botan::Sodium::crypto_box_macbytes
size_t crypto_box_macbytes()
Definition: sodium.h:716
Botan::Sodium::crypto_stream
int crypto_stream(uint8_t out[], size_t out_len, const uint8_t nonce[24], const uint8_t key[32])
Definition: sodium.h:1299
Botan::Sodium::crypto_box_zerobytes
size_t crypto_box_zerobytes()
Definition: sodium.h:835
Botan::Sodium::crypto_auth_hmacsha256_KEYBYTES
Definition: sodium.h:43
Botan::Sodium::crypto_shorthash_siphash24_keybytes
size_t crypto_shorthash_siphash24_keybytes()
Definition: sodium.h:1320
Botan::Sodium::sodium_malloc
void * sodium_malloc(size_t size)
Definition: sodium_utils.cpp:117
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_keybytes
size_t crypto_aead_chacha20poly1305_ietf_keybytes()
Definition: sodium.h:372
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_messagebytes_max
size_t crypto_box_curve25519xsalsa20poly1305_messagebytes_max()
Definition: sodium.h:631
Botan::Sodium::randombytes_buf_deterministic
void randombytes_buf_deterministic(void *buf, size_t size, const uint8_t seed[randombytes_SEEDBYTES])
Definition: sodium_utils.cpp:33
Botan::Sodium::crypto_shorthash_BYTES
Definition: sodium.h:112
Botan::Sodium::crypto_sign_PUBLICKEYBYTES
Definition: sodium.h:122
Botan::Sodium::crypto_aead_chacha20poly1305_ABYTES
Definition: sodium.h:24
Botan::Sodium::crypto_aead_chacha20poly1305_decrypt
int crypto_aead_chacha20poly1305_decrypt(uint8_t m[], unsigned long long *ptext_len, uint8_t unused_secret_nonce[], const uint8_t ctext[], size_t ctext_len, const uint8_t ad[], size_t ad_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:236
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_zerobytes
size_t crypto_box_curve25519xsalsa20poly1305_zerobytes()
Definition: sodium.h:641
Botan::Sodium::crypto_sign_MESSAGEBYTES_MAX
Definition: sodium.h:121
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_keypair
int crypto_box_curve25519xsalsa20poly1305_keypair(uint8_t pk[32], uint8_t sk[32])
Definition: sodium_box.cpp:22
Botan::Sodium::crypto_stream_chacha20
int crypto_stream_chacha20(uint8_t out[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_chacha.cpp:12
Botan::Sodium::sodium_add
void sodium_add(uint8_t a[], const uint8_t b[], size_t len)
Definition: sodium_utils.cpp:107
Botan::Sodium::crypto_shorthash
int crypto_shorthash(uint8_t out[], const uint8_t in[], size_t in_len, const uint8_t k[16])
Definition: sodium.h:1333
Botan::Sodium::crypto_core_hsalsa20_INPUTBYTES
Definition: sodium.h:78
Botan::Sodium::crypto_stream_chacha20_KEYBYTES
Definition: sodium.h:126
Botan::Sodium::crypto_aead_chacha20poly1305_abytes
size_t crypto_aead_chacha20poly1305_abytes()
Definition: sodium.h:462
Botan::Sodium::crypto_scalarmult_curve25519_scalarbytes
size_t crypto_scalarmult_curve25519_scalarbytes()
Definition: sodium.h:1114
Botan::Sodium::crypto_secretbox_primitive
const char * crypto_secretbox_primitive()
Definition: sodium.h:303
Botan::Sodium::crypto_secretbox_xsalsa20poly1305
int crypto_secretbox_xsalsa20poly1305(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_secretbox.cpp:14
Botan::Sodium::crypto_stream_salsa20_NONCEBYTES
Definition: sodium.h:134
Botan::Sodium::crypto_shorthash_siphash24_BYTES
Definition: sodium.h:110
Botan::Sodium::crypto_stream_salsa20_noncebytes
size_t crypto_stream_salsa20_noncebytes()
Definition: sodium.h:1259
Botan::Sodium::crypto_aead_chacha20poly1305_NSECBYTES
Definition: sodium.h:28
Botan::Sodium::crypto_secretbox_macbytes
size_t crypto_secretbox_macbytes()
Definition: sodium.h:299
Botan::Sodium::crypto_sign_SECRETKEYBYTES
Definition: sodium.h:123
Botan::Sodium::crypto_sign_primitive
const char * crypto_sign_primitive()
Definition: sodium.h:1418
Botan::Sodium::crypto_hash_sha512
int crypto_hash_sha512(uint8_t out[64], const uint8_t in[], size_t in_len)
Definition: sodium_auth.cpp:13
Botan::Sodium::crypto_shorthash_keygen
void crypto_shorthash_keygen(uint8_t k[16])
Definition: sodium.h:1339
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_NONCEBYTES
Definition: sodium.h:56
Botan::Sodium::crypto_stream_xsalsa20_keybytes
size_t crypto_stream_xsalsa20_keybytes()
Definition: sodium.h:978
Botan::Sodium::crypto_scalarmult_curve25519
int crypto_scalarmult_curve25519(uint8_t out[32], const uint8_t scalar[32], const uint8_t basepoint[32])
Definition: sodium_25519.cpp:13
Botan::Sodium::crypto_onetimeauth_poly1305_keybytes
size_t crypto_onetimeauth_poly1305_keybytes()
Definition: sodium.h:1060
Botan::Sodium::crypto_hash_sha512_bytes
size_t crypto_hash_sha512_bytes()
Definition: sodium.h:855
Botan::Sodium::SODIUM_SIZE_MAX
Definition: sodium.h:22
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::Sodium::crypto_stream_chacha20_NONCEBYTES
Definition: sodium.h:128
Botan::Sodium::crypto_auth_hmacsha512_keygen
void crypto_auth_hmacsha512_keygen(uint8_t k[32])
Definition: sodium.h:878
Botan::Sodium::crypto_verify_16
int crypto_verify_16(const uint8_t x[16], const uint8_t y[16])
Definition: sodium_utils.cpp:45
Botan::Sodium::crypto_stream_chacha20_xor_ic
int crypto_stream_chacha20_xor_ic(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], uint64_t ic, const uint8_t key[])
Definition: sodium_chacha.cpp:29
Botan::Sodium::crypto_stream_chacha20_ietf_keybytes
size_t crypto_stream_chacha20_ietf_keybytes()
Definition: sodium.h:1180
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_keygen
void crypto_aead_xchacha20poly1305_ietf_keygen(uint8_t k[32])
Definition: sodium.h:594
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_boxzerobytes
size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes()
Definition: sodium.h:283
Botan::Sodium::randombytes_stir
void randombytes_stir()
Definition: sodium.h:228
Botan::Sodium::crypto_box_seed_keypair
int crypto_box_seed_keypair(uint8_t pk[32], uint8_t sk[32], const uint8_t seed[])
Definition: sodium.h:733
Botan::Sodium::sodium_mprotect_readwrite
int sodium_mprotect_readwrite(void *ptr)
Definition: sodium_utils.cpp:154
Botan::Sodium::crypto_stream_xsalsa20_xor_ic
int crypto_stream_xsalsa20_xor_ic(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], uint64_t ic, const uint8_t key[])
Definition: sodium_salsa.cpp:108
Botan::Sodium::crypto_auth_hmacsha512256
int crypto_auth_hmacsha512256(uint8_t out[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium_auth.cpp:83
Botan::Sodium::crypto_box_open_easy
int crypto_box_open_easy(uint8_t ptext[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium.h:765
Botan::Sodium::crypto_box_BEFORENMBYTES
Definition: sodium.h:62
Botan::Sodium::crypto_auth_BYTES
Definition: sodium.h:49
Botan::Sodium::crypto_onetimeauth_keygen
void crypto_onetimeauth_keygen(uint8_t k[32])
Definition: sodium.h:1102
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_encrypt_detached
int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(uint8_t ctext[], uint8_t mac[], unsigned long long *mac_len, const uint8_t ptext[], size_t ptext_len, const uint8_t ad[], size_t ad_len, const uint8_t unused_secret_nonce[], const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:323
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_KEYBYTES
Definition: sodium.h:37
Botan::Sodium::crypto_stream_xchacha20
int crypto_stream_xchacha20(uint8_t out[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_chacha.cpp:76
Botan::Sodium::sodium_library_minimal
int sodium_library_minimal()
Definition: sodium.h:158
Botan::Sodium::crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX
Definition: sodium.h:26
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_decrypt_detached
int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(uint8_t ptext[], uint8_t unused_secret_nonce[], const uint8_t ctext[], size_t ctext_len, const uint8_t mac[], const uint8_t ad[], size_t ad_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:343
Botan::Sodium::crypto_auth_hmacsha256_BYTES
Definition: sodium.h:42
Botan::Sodium::sodium_mprotect_noaccess
int sodium_mprotect_noaccess(void *ptr)
Definition: sodium_utils.cpp:148
Botan::Sodium::crypto_scalarmult_primitive
const char * crypto_scalarmult_primitive()
Definition: sodium.h:1131
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_NPUBBYTES
Definition: sodium.h:33
Botan::Sodium::crypto_stream_salsa20_xor
int crypto_stream_salsa20_xor(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_salsa.cpp:68
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_keygen
void crypto_secretbox_xsalsa20poly1305_keygen(uint8_t k[32])
Definition: sodium.h:278
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_encrypt
int crypto_aead_chacha20poly1305_ietf_encrypt(uint8_t ctext[], unsigned long long *ctext_len, const uint8_t ptext[], size_t ptext_len, const uint8_t ad[], size_t ad_len, const uint8_t unused_secret_nonce[], const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:148
Botan::Sodium::crypto_stream_keybytes
size_t crypto_stream_keybytes()
Definition: sodium.h:1291
Botan::Sodium::crypto_sign_publickeybytes
size_t crypto_sign_publickeybytes()
Definition: sodium.h:1403
Botan::Sodium::crypto_onetimeauth_poly1305_KEYBYTES
Definition: sodium.h:87
Botan::Sodium::crypto_secretbox_detached
int crypto_secretbox_detached(uint8_t ctext[], uint8_t mac[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_secretbox.cpp:73
Botan::Sodium::crypto_stream_xsalsa20_keygen
void crypto_stream_xsalsa20_keygen(uint8_t k[32])
Definition: sodium.h:1008
Botan::Sodium::crypto_scalarmult_bytes
size_t crypto_scalarmult_bytes()
Definition: sodium.h:1127
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_macbytes
size_t crypto_box_curve25519xsalsa20poly1305_macbytes()
Definition: sodium.h:626
Botan::Sodium::crypto_shorthash_bytes
size_t crypto_shorthash_bytes()
Definition: sodium.h:1327
Botan::Sodium::crypto_aead_chacha20poly1305_encrypt
int crypto_aead_chacha20poly1305_encrypt(uint8_t ctext[], unsigned long long *ctext_len, const uint8_t ptext[], size_t ptext_len, const uint8_t ad[], size_t ad_len, const uint8_t unused_secret_nonce[], const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:220
Botan::Sodium::sodium_library_version_minor
int sodium_library_version_minor()
Definition: sodium.h:156
Botan::Sodium::crypto_stream_xsalsa20_KEYBYTES
Definition: sodium.h:138
Botan::Sodium::sodium_free
void sodium_free(void *ptr)
Definition: sodium_utils.cpp:129
Botan::Sodium::crypto_core_hsalsa20_CONSTBYTES
Definition: sodium.h:77
Botan::Sodium::crypto_stream_chacha20_ietf
int crypto_stream_chacha20_ietf(uint8_t out[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_chacha.cpp:45
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_abytes
size_t crypto_aead_xchacha20poly1305_ietf_abytes()
Definition: sodium.h:539
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_decrypt_detached
int crypto_aead_chacha20poly1305_ietf_decrypt_detached(uint8_t m[], uint8_t unused_secret_nonce[], const uint8_t ctext[], size_t ctext_len, const uint8_t mac[], const uint8_t ad[], size_t ad_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:203
Botan::Sodium::crypto_scalarmult_curve25519_base
int crypto_scalarmult_curve25519_base(uint8_t out[32], const uint8_t scalar[32])
Definition: sodium_25519.cpp:19
Botan::Sodium::sodium_memcmp
int sodium_memcmp(const void *x, const void *y, size_t len)
Definition: sodium_utils.cpp:65
Botan::Sodium::crypto_stream_xchacha20_NONCEBYTES
Definition: sodium.h:137
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX
Definition: sodium.h:32
Botan::Sodium::randombytes_buf
void randombytes_buf(void *buf, size_t size)
Definition: sodium_utils.cpp:17
Botan::Sodium::crypto_onetimeauth_verify
int crypto_onetimeauth_verify(const uint8_t h[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium.h:1096
Botan::Sodium::crypto_sign_ed25519_seed_keypair
int crypto_sign_ed25519_seed_keypair(uint8_t pk[], uint8_t sk[], const uint8_t seed[])
Definition: sodium_25519.cpp:53
Botan::Sodium::crypto_auth_hmacsha512_bytes
size_t crypto_auth_hmacsha512_bytes()
Definition: sodium.h:862
Botan::Sodium::crypto_stream_xsalsa20_xor
int crypto_stream_xsalsa20_xor(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_salsa.cpp:101
Botan::Sodium::crypto_auth_verify
int crypto_auth_verify(const uint8_t mac[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium.h:926
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES
Definition: sodium.h:53
Botan::Sodium::crypto_stream_chacha20_noncebytes
size_t crypto_stream_chacha20_noncebytes()
Definition: sodium.h:1150
Botan::Sodium::randombytes_seedbytes
size_t randombytes_seedbytes()
Definition: sodium.h:209
Botan::Sodium::crypto_box_open_easy_afternm
int crypto_box_open_easy_afternm(uint8_t ptext[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:807
Botan::Sodium::crypto_auth_hmacsha256_keygen
void crypto_auth_hmacsha256_keygen(uint8_t k[32])
Definition: sodium.h:971
Botan::Sodium::crypto_sign_bytes
size_t crypto_sign_bytes()
Definition: sodium.h:1393
Botan::Sodium::crypto_scalarmult_curve25519_bytes
size_t crypto_scalarmult_curve25519_bytes()
Definition: sodium.h:1109
Botan::Sodium::crypto_aead_chacha20poly1305_decrypt_detached
int crypto_aead_chacha20poly1305_decrypt_detached(uint8_t m[], uint8_t unused_secret_nonce[], const uint8_t ctext[], size_t ctext_len, const uint8_t mac[], const uint8_t ad[], size_t ad_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:272
Botan::Sodium::crypto_auth_hmacsha256_bytes
size_t crypto_auth_hmacsha256_bytes()
Definition: sodium.h:949
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_nsecbytes
size_t crypto_aead_xchacha20poly1305_ietf_nsecbytes()
Definition: sodium.h:529
Botan::Sodium::crypto_box_boxzerobytes
size_t crypto_box_boxzerobytes()
Definition: sodium.h:837
Botan::Sodium::crypto_box_beforenmbytes
size_t crypto_box_beforenmbytes()
Definition: sodium.h:726
Botan::Sodium::crypto_box_secretkeybytes
size_t crypto_box_secretkeybytes()
Definition: sodium.h:706
Botan::Sodium::crypto_auth_hmacsha256_verify
int crypto_auth_hmacsha256_verify(const uint8_t h[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium_auth.cpp:121
Botan::Sodium::crypto_secretbox_boxzerobytes
size_t crypto_secretbox_boxzerobytes()
Definition: sodium.h:351
Botan::Sodium::crypto_core_hsalsa20_keybytes
size_t crypto_core_hsalsa20_keybytes()
Definition: sodium.h:1025
Botan::Sodium::crypto_shorthash_primitive
const char * crypto_shorthash_primitive()
Definition: sodium.h:1331
Botan::Sodium::crypto_onetimeauth_poly1305_verify
int crypto_onetimeauth_poly1305_verify(const uint8_t h[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium_auth.cpp:51
Botan::Sodium::crypto_auth_primitive
const char * crypto_auth_primitive()
Definition: sodium.h:918
Botan::Sodium::crypto_aead_chacha20poly1305_npubbytes
size_t crypto_aead_chacha20poly1305_npubbytes()
Definition: sodium.h:457
Botan::Sodium::crypto_sign_ed25519_MESSAGEBYTES_MAX
Definition: sodium.h:116
Botan::Sodium::crypto_secretbox_MACBYTES
Definition: sodium.h:105
Botan::Sodium::crypto_auth_hmacsha512
int crypto_auth_hmacsha512(uint8_t out[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium_auth.cpp:61
Botan::Sodium::crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX
Definition: sodium.h:130
Botan::Sodium::crypto_sign_messagebytes_max
size_t crypto_sign_messagebytes_max()
Definition: sodium.h:1413
Botan::Sodium::crypto_box_afternm
int crypto_box_afternm(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:785
Botan::Sodium::crypto_stream_xchacha20_messagebytes_max
size_t crypto_stream_xchacha20_messagebytes_max()
Definition: sodium.h:1227
Botan::Sodium::crypto_aead_chacha20poly1305_encrypt_detached
int crypto_aead_chacha20poly1305_encrypt_detached(uint8_t ctext[], uint8_t mac[], unsigned long long *mac_len, const uint8_t ptext[], size_t ptext_len, const uint8_t ad[], size_t ad_len, const uint8_t unused_secret_nonce[], const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:252
Botan::Sodium::crypto_stream_chacha20_xor
int crypto_stream_chacha20_xor(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_chacha.cpp:22
Botan::Sodium::crypto_scalarmult_SCALARBYTES
Definition: sodium.h:94
Botan::Sodium::crypto_auth_KEYBYTES
Definition: sodium.h:50
Botan::Sodium::crypto_secretbox_keybytes
size_t crypto_secretbox_keybytes()
Definition: sodium.h:295
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_encrypt_detached
int crypto_aead_chacha20poly1305_ietf_encrypt_detached(uint8_t ctext[], uint8_t mac[], unsigned long long *mac_len, const uint8_t ptext[], size_t ptext_len, const uint8_t ad[], size_t ad_len, const uint8_t unused_secret_nonce[], const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:182
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_abytes
size_t crypto_aead_chacha20poly1305_ietf_abytes()
Definition: sodium.h:387
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX
Definition: sodium.h:55
Botan::Sodium::crypto_hash_sha512_BYTES
Definition: sodium.h:83
Botan::Sodium::crypto_core_hchacha20_CONSTBYTES
Definition: sodium.h:72
Botan::Sodium::sodium_compare
int sodium_compare(const uint8_t x[], const uint8_t y[], size_t len)
Definition: sodium_utils.cpp:71
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_NPUBBYTES
Definition: sodium.h:39
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_seedbytes
size_t crypto_box_curve25519xsalsa20poly1305_seedbytes()
Definition: sodium.h:601
Botan::Sodium::crypto_auth_keybytes
size_t crypto_auth_keybytes()
Definition: sodium.h:916
Botan::Sodium::crypto_secretbox_MESSAGEBYTES_MAX
Definition: sodium.h:106
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_zerobytes
size_t crypto_secretbox_xsalsa20poly1305_zerobytes()
Definition: sodium.h:288
Botan::Sodium::crypto_auth_hmacsha512256_BYTES
Definition: sodium.h:44
Botan::Sodium::crypto_scalarmult
int crypto_scalarmult(uint8_t out[], const uint8_t scalar[], const uint8_t base[])
Definition: sodium.h:1138
Botan::Sodium::crypto_shorthash_siphash24_KEYBYTES
Definition: sodium.h:111
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_messagebytes_max
size_t crypto_secretbox_xsalsa20poly1305_messagebytes_max()
Definition: sodium.h:259
Botan::Sodium::crypto_sign_secretkeybytes
size_t crypto_sign_secretkeybytes()
Definition: sodium.h:1408
Botan::Sodium::crypto_secretbox_KEYBYTES
Definition: sodium.h:104
Botan::Sodium::crypto_scalarmult_BYTES
Definition: sodium.h:93
Botan::Sodium::crypto_verify_64
int crypto_verify_64(const uint8_t x[64], const uint8_t y[64])
Definition: sodium_utils.cpp:55
Botan::Sodium::crypto_sign_keypair
int crypto_sign_keypair(uint8_t pk[32], uint8_t sk[32])
Definition: sodium.h:1429
Botan::Sodium::crypto_auth_bytes
size_t crypto_auth_bytes()
Definition: sodium.h:914
Botan::Sodium::crypto_sign_ed25519_seedbytes
size_t crypto_sign_ed25519_seedbytes()
Definition: sodium.h:1351
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX
Definition: sodium.h:38
Botan::Sodium::crypto_stream_xchacha20_MESSAGEBYTES_MAX
Definition: sodium.h:136
Botan::Sodium::crypto_secretbox_open
int crypto_secretbox_open(uint8_t ptext[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:363
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_noncebytes
size_t crypto_secretbox_xsalsa20poly1305_noncebytes()
Definition: sodium.h:249
Botan::Sodium::crypto_verify_64_BYTES
Definition: sodium.h:147
Botan::Sodium::crypto_box_detached
int crypto_box_detached(uint8_t ctext[], uint8_t mac[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium_box.cpp:72
Botan::Sodium::crypto_aead_chacha20poly1305_messagebytes_max
size_t crypto_aead_chacha20poly1305_messagebytes_max()
Definition: sodium.h:467
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_MACBYTES
Definition: sodium.h:54
Botan::Sodium::crypto_secretbox_BOXZEROBYTES
Definition: sodium.h:103
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES
Definition: sodium.h:52
Botan::Sodium::crypto_sign_seed_keypair
int crypto_sign_seed_keypair(uint8_t pk[32], uint8_t sk[32], const uint8_t seed[])
Definition: sodium.h:1423
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_messagebytes_max
size_t crypto_aead_xchacha20poly1305_ietf_messagebytes_max()
Definition: sodium.h:544
Botan::Sodium::crypto_stream_xchacha20_keygen
void crypto_stream_xchacha20_keygen(uint8_t k[32])
Definition: sodium.h:1247
Botan::Sodium::crypto_stream_chacha20_ietf_xor
int crypto_stream_chacha20_ietf_xor(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_chacha.cpp:55
Botan::Sodium::crypto_box_beforenm
int crypto_box_beforenm(uint8_t key[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium.h:779
Botan::Sodium::crypto_stream_chacha20_ietf_noncebytes
size_t crypto_stream_chacha20_ietf_noncebytes()
Definition: sodium.h:1185
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES
Definition: sodium.h:58
Botan::Sodium::crypto_onetimeauth_poly1305_bytes
size_t crypto_onetimeauth_poly1305_bytes()
Definition: sodium.h:1055
Botan::Sodium::sodium_version_string
const char * sodium_version_string()
Definition: sodium.h:152
Botan::Sodium::sodium_library_version_major
int sodium_library_version_major()
Definition: sodium.h:154
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_NONCEBYTES
Definition: sodium.h:100
Botan
Definition: alg_id.cpp:13
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_ZEROBYTES
Definition: sodium.h:101
Botan::Sodium::crypto_box_messagebytes_max
size_t crypto_box_messagebytes_max()
Definition: sodium.h:721
Botan::Sodium::crypto_stream_messagebytes_max
size_t crypto_stream_messagebytes_max()
Definition: sodium.h:1295
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_MACBYTES
Definition: sodium.h:98
Botan::Sodium::crypto_sign_ed25519_PUBLICKEYBYTES
Definition: sodium.h:117
Botan::Sodium::Sodium_Constants
Sodium_Constants
Definition: sodium.h:21
Botan::Sodium::crypto_stream_xsalsa20_NONCEBYTES
Definition: sodium.h:140
Botan::Sodium::crypto_secretbox_open_detached
int crypto_secretbox_open_detached(uint8_t ptext[], const uint8_t ctext[], const uint8_t mac[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_secretbox.cpp:96
Botan::Sodium::crypto_stream_salsa20_KEYBYTES
Definition: sodium.h:132
Botan::Sodium::crypto_secretbox_messagebytes_max
size_t crypto_secretbox_messagebytes_max()
Definition: sodium.h:301
Botan::Sodium::crypto_stream_chacha20_messagebytes_max
size_t crypto_stream_chacha20_messagebytes_max()
Definition: sodium.h:1155
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_keygen
void crypto_aead_chacha20poly1305_ietf_keygen(uint8_t k[32])
Definition: sodium.h:442
Botan::Sodium::crypto_stream_salsa20_keybytes
size_t crypto_stream_salsa20_keybytes()
Definition: sodium.h:1254
Botan::Sodium::crypto_onetimeauth_bytes
size_t crypto_onetimeauth_bytes()
Definition: sodium.h:1084
Botan::Sodium::crypto_sign_seedbytes
size_t crypto_sign_seedbytes()
Definition: sodium.h:1398
Botan::Sodium::crypto_box_detached_afternm
int crypto_box_detached_afternm(uint8_t ctext[], uint8_t mac[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:821
Botan::Sodium::crypto_hash_sha256_bytes
size_t crypto_hash_sha256_bytes()
Definition: sodium.h:939
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_decrypt
int crypto_aead_chacha20poly1305_ietf_decrypt(uint8_t ptext[], unsigned long long *ptext_len, uint8_t unused_secret_nonce[], const uint8_t ctext[], size_t ctext_len, const uint8_t ad[], size_t ad_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:165
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES
Definition: sodium.h:96
Botan::Sodium::crypto_sign_detached
int crypto_sign_detached(uint8_t sig[], unsigned long long *sig_len, const uint8_t msg[], size_t msg_len, const uint8_t sk[32])
Definition: sodium.h:1434
Botan::Sodium::crypto_secretbox_keygen
void crypto_secretbox_keygen(uint8_t k[32])
Definition: sodium.h:341
Botan::Sodium::crypto_box_MACBYTES
Definition: sodium.h:64
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_noncebytes
size_t crypto_box_curve25519xsalsa20poly1305_noncebytes()
Definition: sodium.h:621
Botan::Sodium::crypto_stream_xsalsa20_messagebytes_max
size_t crypto_stream_xsalsa20_messagebytes_max()
Definition: sodium.h:988
Botan::Sodium::crypto_auth_hmacsha512256_keygen
void crypto_auth_hmacsha512256_keygen(uint8_t k[32])
Definition: sodium.h:907
Botan::Sodium::crypto_auth_hmacsha512_verify
int crypto_auth_hmacsha512_verify(const uint8_t h[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium_auth.cpp:73
Botan::Sodium::crypto_auth_hmacsha512_keybytes
size_t crypto_auth_hmacsha512_keybytes()
Definition: sodium.h:864
Botan::Sodium::crypto_stream_MESSAGEBYTES_MAX
Definition: sodium.h:142
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_keybytes
size_t crypto_secretbox_xsalsa20poly1305_keybytes()
Definition: sodium.h:244
Botan::Sodium::crypto_sign_ed25519_keypair
int crypto_sign_ed25519_keypair(uint8_t pk[32], uint8_t sk[64])
Definition: sodium_25519.cpp:46
Botan::Sodium::crypto_verify_32_BYTES
Definition: sodium.h:146
Botan::Sodium::randombytes_close
int randombytes_close()
Definition: sodium.h:230
Botan::Sodium::crypto_secretbox_NONCEBYTES
Definition: sodium.h:107
Botan::Sodium::randombytes_implementation_name
const char * randombytes_implementation_name()
Definition: sodium.h:232
Botan::Sodium::crypto_box_SECRETKEYBYTES
Definition: sodium.h:68
Botan::Sodium::crypto_sign_ed25519_secretkeybytes
size_t crypto_sign_ed25519_secretkeybytes()
Definition: sodium.h:1361
Botan::Sodium::crypto_core_hsalsa20_inputbytes
size_t crypto_core_hsalsa20_inputbytes()
Definition: sodium.h:1020
Botan::Sodium::crypto_stream_salsa20_MESSAGEBYTES_MAX
Definition: sodium.h:133
Botan::Sodium::crypto_onetimeauth_poly1305_BYTES
Definition: sodium.h:86
Botan::Sodium::crypto_core_hsalsa20_OUTPUTBYTES
Definition: sodium.h:80
Botan::Sodium::crypto_verify_16_BYTES
Definition: sodium.h:145
Botan::Sodium::crypto_auth_hmacsha512256_KEYBYTES
Definition: sodium.h:45
Botan::Sodium::crypto_secretbox_easy
int crypto_secretbox_easy(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:320
Botan::Sodium::crypto_secretbox_open_easy
int crypto_secretbox_open_easy(uint8_t out[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:328
Botan::Sodium::crypto_scalarmult_curve25519_BYTES
Definition: sodium.h:91
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_secretkeybytes
size_t crypto_box_curve25519xsalsa20poly1305_secretkeybytes()
Definition: sodium.h:611
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_publickeybytes
size_t crypto_box_curve25519xsalsa20poly1305_publickeybytes()
Definition: sodium.h:606
Botan::Sodium::crypto_aead_chacha20poly1305_NPUBBYTES
Definition: sodium.h:27
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_npubbytes
size_t crypto_aead_xchacha20poly1305_ietf_npubbytes()
Definition: sodium.h:534
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES
Definition: sodium.h:57
Botan::Sodium::crypto_onetimeauth_BYTES
Definition: sodium.h:88
Botan::Sodium::randombytes
void randombytes(uint8_t buf[], size_t buf_len)
Definition: sodium.h:237
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_encrypt
int crypto_aead_xchacha20poly1305_ietf_encrypt(uint8_t ctext[], unsigned long long *ctext_len, const uint8_t ptext[], size_t ptext_len, const uint8_t ad[], size_t ad_len, const uint8_t unused_secret_nonce[], const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:289
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_KEYBYTES
Definition: sodium.h:31
Botan::Sodium::crypto_stream_noncebytes
size_t crypto_stream_noncebytes()
Definition: sodium.h:1293
Botan::Sodium::crypto_sign_ed25519_verify_detached
int crypto_sign_ed25519_verify_detached(const uint8_t sig[], const uint8_t msg[], size_t msg_len, const uint8_t pk[32])
Definition: sodium_25519.cpp:37
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX
Definition: sodium.h:99
Botan::Sodium::sodium_is_zero
int sodium_is_zero(const uint8_t nonce[], size_t nlen)
Definition: sodium_utils.cpp:89
Botan::Sodium::crypto_box_SEEDBYTES
Definition: sodium.h:69
Botan::Sodium::crypto_auth_keygen
void crypto_auth_keygen(uint8_t k[])
Definition: sodium.h:932
Botan::Sodium::crypto_sign_ed25519_messagebytes_max
size_t crypto_sign_ed25519_messagebytes_max()
Definition: sodium.h:1366
Botan::Sodium::crypto_stream_KEYBYTES
Definition: sodium.h:141
Botan::Sodium::crypto_sign_SEEDBYTES
Definition: sodium.h:124
Botan::Sodium::crypto_auth
int crypto_auth(uint8_t out[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium.h:920
Botan::Sodium::crypto_stream_chacha20_ietf_KEYBYTES
Definition: sodium.h:129
Botan::Sodium::crypto_hash_BYTES
Definition: sodium.h:84
Botan::Sodium::crypto_box_noncebytes
size_t crypto_box_noncebytes()
Definition: sodium.h:711
Botan::Sodium::crypto_stream_xchacha20_xor_ic
int crypto_stream_xchacha20_xor_ic(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], uint64_t ic, const uint8_t key[])
Definition: sodium_chacha.cpp:93
Botan::Sodium::crypto_box_seedbytes
size_t crypto_box_seedbytes()
Definition: sodium.h:696
Botan::Sodium::crypto_aead_chacha20poly1305_keybytes
size_t crypto_aead_chacha20poly1305_keybytes()
Definition: sodium.h:447
Botan::Sodium::randombytes_uniform
uint32_t randombytes_uniform(uint32_t upper_bound)
Definition: sodium_utils.cpp:22
Botan::Sodium::crypto_stream_salsa20_messagebytes_max
size_t crypto_stream_salsa20_messagebytes_max()
Definition: sodium.h:1264
Botan::Sodium::crypto_hash_primitive
const char * crypto_hash_primitive()
Definition: sodium.h:1051
Botan::Sodium::crypto_core_hchacha20_OUTPUTBYTES
Definition: sodium.h:75
Botan::Sodium::crypto_stream_xchacha20_xor
int crypto_stream_xchacha20_xor(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_chacha.cpp:86
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_decrypt
int crypto_aead_xchacha20poly1305_ietf_decrypt(uint8_t ptext[], unsigned long long *ptext_len, uint8_t unused_secret_nonce[], const uint8_t ctext[], size_t ctext_len, const uint8_t ad[], size_t ad_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_aead.cpp:306
Botan::Sodium::crypto_box_open_afternm
int crypto_box_open_afternm(uint8_t ptext[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:792
Botan::Sodium::crypto_shorthash_KEYBYTES
Definition: sodium.h:113
Botan::Sodium::crypto_stream_chacha20_MESSAGEBYTES_MAX
Definition: sodium.h:127
Botan::Sodium::crypto_onetimeauth_primitive
const char * crypto_onetimeauth_primitive()
Definition: sodium.h:1088
Botan::Sodium::crypto_box_primitive
const char * crypto_box_primitive()
Definition: sodium.h:731
Botan::Sodium::crypto_stream_chacha20_ietf_messagebytes_max
size_t crypto_stream_chacha20_ietf_messagebytes_max()
Definition: sodium.h:1190
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_ABYTES
Definition: sodium.h:30
Botan::Sodium::crypto_auth_hmacsha512256_bytes
size_t crypto_auth_hmacsha512256_bytes()
Definition: sodium.h:885
Botan::Sodium::crypto_verify_32
int crypto_verify_32(const uint8_t x[32], const uint8_t y[32])
Definition: sodium_utils.cpp:50
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_open_afternm
int crypto_box_curve25519xsalsa20poly1305_open_afternm(uint8_t ptext[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:685
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_boxzerobytes
size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes()
Definition: sodium.h:636
Botan::Sodium::crypto_auth_hmacsha512256_keybytes
size_t crypto_auth_hmacsha512256_keybytes()
Definition: sodium.h:890
Botan::Sodium::crypto_sign_verify_detached
int crypto_sign_verify_detached(const uint8_t sig[], const uint8_t in[], size_t in_len, const uint8_t pk[32])
Definition: sodium.h:1441
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_keybytes
size_t crypto_aead_xchacha20poly1305_ietf_keybytes()
Definition: sodium.h:524
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_ZEROBYTES
Definition: sodium.h:60
Botan::Sodium::crypto_box_MESSAGEBYTES_MAX
Definition: sodium.h:65
Botan::Sodium::crypto_box_open
int crypto_box_open(uint8_t ptext[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium.h:846
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_beforenmbytes
size_t crypto_box_curve25519xsalsa20poly1305_beforenmbytes()
Definition: sodium.h:616
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_macbytes
size_t crypto_secretbox_xsalsa20poly1305_macbytes()
Definition: sodium.h:254
Botan::Sodium::crypto_stream_primitive
const char * crypto_stream_primitive()
Definition: sodium.h:1297
Botan::Sodium::crypto_stream_salsa20
int crypto_stream_salsa20(uint8_t out[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_salsa.cpp:58
Botan::Sodium::crypto_box_NONCEBYTES
Definition: sodium.h:66
Botan::Sodium::crypto_stream_xchacha20_KEYBYTES
Definition: sodium.h:135
Botan::Sodium::crypto_auth_hmacsha256
int crypto_auth_hmacsha256(uint8_t out[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium_auth.cpp:109
Botan::Sodium::crypto_shorthash_siphash24_bytes
size_t crypto_shorthash_siphash24_bytes()
Definition: sodium.h:1318
Botan::Sodium::crypto_sign_BYTES
Definition: sodium.h:120
Botan::Sodium::crypto_core_hsalsa20_constbytes
size_t crypto_core_hsalsa20_constbytes()
Definition: sodium.h:1030
Botan::Sodium::crypto_stream_xor
int crypto_stream_xor(uint8_t out[], const uint8_t in[], size_t in_len, const uint8_t nonce[24], const uint8_t key[32])
Definition: sodium.h:1305
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_afternm
int crypto_box_curve25519xsalsa20poly1305_afternm(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:676
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_open
int crypto_box_curve25519xsalsa20poly1305_open(uint8_t ptext[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium_box.cpp:57
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_seed_keypair
int crypto_box_curve25519xsalsa20poly1305_seed_keypair(uint8_t pk[32], uint8_t sk[32], const uint8_t seed[32])
Definition: sodium_box.cpp:12
Botan::Sodium::crypto_shorthash_keybytes
size_t crypto_shorthash_keybytes()
Definition: sodium.h:1329
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_KEYBYTES
Definition: sodium.h:97
Botan::Sodium::crypto_box_easy_afternm
int crypto_box_easy_afternm(uint8_t ctext[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium.h:828
Botan::Sodium::crypto_onetimeauth_keybytes
size_t crypto_onetimeauth_keybytes()
Definition: sodium.h:1086
Botan::Sodium::randombytes_SEEDBYTES
Definition: sodium.h:149
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_NSECBYTES
Definition: sodium.h:34
Botan::Sodium::crypto_stream_NONCEBYTES
Definition: sodium.h:143
Botan::Sodium::crypto_auth_hmacsha512256_verify
int crypto_auth_hmacsha512256_verify(const uint8_t h[], const uint8_t in[], size_t in_len, const uint8_t key[])
Definition: sodium_auth.cpp:99
Botan::Sodium::crypto_secretbox_xsalsa20poly1305_open
int crypto_secretbox_xsalsa20poly1305_open(uint8_t ptext[], const uint8_t ctext[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_secretbox.cpp:41
Botan::Sodium::crypto_auth_hmacsha512_KEYBYTES
Definition: sodium.h:47
Botan::Sodium::crypto_stream_xchacha20_noncebytes
size_t crypto_stream_xchacha20_noncebytes()
Definition: sodium.h:1222
Botan::Sodium::crypto_stream_xsalsa20_MESSAGEBYTES_MAX
Definition: sodium.h:139
Botan::Sodium::crypto_scalarmult_base
int crypto_scalarmult_base(uint8_t out[], const uint8_t scalar[])
Definition: sodium.h:1133
Botan::Sodium::crypto_aead_chacha20poly1305_ietf_nsecbytes
size_t crypto_aead_chacha20poly1305_ietf_nsecbytes()
Definition: sodium.h:377
Botan::Sodium::crypto_stream_chacha20_ietf_xor_ic
int crypto_stream_chacha20_ietf_xor_ic(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], uint32_t ic, const uint8_t key[])
Definition: sodium_chacha.cpp:63
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_SEEDBYTES
Definition: sodium.h:59
Botan::Sodium::crypto_hash_bytes
size_t crypto_hash_bytes()
Definition: sodium.h:1041
Botan::Sodium::crypto_stream_xsalsa20_noncebytes
size_t crypto_stream_xsalsa20_noncebytes()
Definition: sodium.h:983
Botan::Sodium::crypto_aead_xchacha20poly1305_ietf_ABYTES
Definition: sodium.h:36
Botan::Sodium::crypto_stream_xchacha20_keybytes
size_t crypto_stream_xchacha20_keybytes()
Definition: sodium.h:1217
Botan::Sodium::crypto_box_PUBLICKEYBYTES
Definition: sodium.h:67
Botan::Sodium::crypto_stream_chacha20_ietf_NONCEBYTES
Definition: sodium.h:131
Botan::Sodium::crypto_box_curve25519xsalsa20poly1305_beforenm
int crypto_box_curve25519xsalsa20poly1305_beforenm(uint8_t key[], const uint8_t pk[32], const uint8_t sk[32])
Definition: sodium_box.cpp:29
Botan::Sodium::crypto_onetimeauth_KEYBYTES
Definition: sodium.h:89
Botan::Sodium::sodium_init
int sodium_init()
Definition: sodium.h:160
Botan::Sodium::crypto_auth_hmacsha512_BYTES
Definition: sodium.h:46
Botan::Sodium::crypto_shorthash_siphash24
int crypto_shorthash_siphash24(uint8_t out[8], const uint8_t in[], size_t in_len, const uint8_t key[16])
Definition: sodium_auth.cpp:29
Botan::Sodium::crypto_secretbox_zerobytes
size_t crypto_secretbox_zerobytes()
Definition: sodium.h:346
Botan::Sodium::crypto_core_hchacha20_KEYBYTES
Definition: sodium.h:74
Botan::Sodium::crypto_sign_ed25519_detached
int crypto_sign_ed25519_detached(uint8_t sig[], unsigned long long *sig_len, const uint8_t msg[], size_t msg_len, const uint8_t sk[32])
Definition: sodium_25519.cpp:24
Botan::Sodium::crypto_sign_ed25519_publickeybytes
size_t crypto_sign_ed25519_publickeybytes()
Definition: sodium.h:1356
Botan::Sodium::crypto_stream_xsalsa20
int crypto_stream_xsalsa20(uint8_t out[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
Definition: sodium_salsa.cpp:91
Botan::Sodium::crypto_aead_chacha20poly1305_KEYBYTES
Definition: sodium.h:25