1 /* $OpenBSD: crypto_api.h,v 1.5 2019/01/21 10:20:12 djm Exp $ */ 2 3 /* 4 * Assembled from generated headers and source files by Markus Friedl. 5 * Placed in the public domain. 6 */ 7 8 #ifndef crypto_api_h 9 #define crypto_api_h 10 11 #include <stdint.h> 12 #include <stdlib.h> 13 14 typedef int8_t crypto_int8; 15 typedef uint8_t crypto_uint8; 16 typedef int16_t crypto_int16; 17 typedef uint16_t crypto_uint16; 18 typedef int32_t crypto_int32; 19 typedef uint32_t crypto_uint32; 20 21 #define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len)) 22 #define small_random32() arc4random() 23 24 #define crypto_hash_sha512_BYTES 64U 25 26 int crypto_hash_sha512(unsigned char *, const unsigned char *, 27 unsigned long long); 28 29 int crypto_verify_32(const unsigned char *, const unsigned char *); 30 31 #define crypto_sign_ed25519_SECRETKEYBYTES 64U 32 #define crypto_sign_ed25519_PUBLICKEYBYTES 32U 33 #define crypto_sign_ed25519_BYTES 64U 34 35 int crypto_sign_ed25519(unsigned char *, unsigned long long *, 36 const unsigned char *, unsigned long long, const unsigned char *); 37 int crypto_sign_ed25519_open(unsigned char *, unsigned long long *, 38 const unsigned char *, unsigned long long, const unsigned char *); 39 int crypto_sign_ed25519_keypair(unsigned char *, unsigned char *); 40 41 #define crypto_kem_sntrup4591761_PUBLICKEYBYTES 1218 42 #define crypto_kem_sntrup4591761_SECRETKEYBYTES 1600 43 #define crypto_kem_sntrup4591761_CIPHERTEXTBYTES 1047 44 #define crypto_kem_sntrup4591761_BYTES 32 45 46 int crypto_kem_sntrup4591761_enc(unsigned char *cstr, unsigned char *k, 47 const unsigned char *pk); 48 int crypto_kem_sntrup4591761_dec(unsigned char *k, 49 const unsigned char *cstr, const unsigned char *sk); 50 int crypto_kem_sntrup4591761_keypair(unsigned char *pk, unsigned char *sk); 51 52 #endif /* crypto_api_h */ 53