1/* $NetBSD: crypto_api.h,v 1.5 2023/07/26 17:58:15 christos Exp $ */ 2/* $OpenBSD: crypto_api.h,v 1.8 2023/01/15 23:05:32 djm Exp $ */ 3 4/* 5 * Assembled from generated headers and source files by Markus Friedl. 6 * Placed in the public domain. 7 */ 8 9#ifndef crypto_api_h 10#define crypto_api_h 11 12#include <stdint.h> 13#include <stdlib.h> 14 15typedef int8_t crypto_int8; 16typedef uint8_t crypto_uint8; 17typedef int16_t crypto_int16; 18typedef uint16_t crypto_uint16; 19typedef int32_t crypto_int32; 20typedef uint32_t crypto_uint32; 21typedef int64_t crypto_int64; 22typedef uint64_t crypto_uint64; 23 24#define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len)) 25#define small_random32() arc4random() 26 27#define crypto_hash_sha512_BYTES 64U 28 29int crypto_hash_sha512(unsigned char *, const unsigned char *, 30 unsigned long long); 31 32#define crypto_sign_ed25519_SECRETKEYBYTES 64U 33#define crypto_sign_ed25519_PUBLICKEYBYTES 32U 34#define crypto_sign_ed25519_BYTES 64U 35 36int crypto_sign_ed25519(unsigned char *, unsigned long long *, 37 const unsigned char *, unsigned long long, const unsigned char *); 38int crypto_sign_ed25519_open(unsigned char *, unsigned long long *, 39 const unsigned char *, unsigned long long, const unsigned char *); 40int crypto_sign_ed25519_keypair(unsigned char *, unsigned char *); 41 42#define crypto_kem_sntrup761_PUBLICKEYBYTES 1158 43#define crypto_kem_sntrup761_SECRETKEYBYTES 1763 44#define crypto_kem_sntrup761_CIPHERTEXTBYTES 1039 45#define crypto_kem_sntrup761_BYTES 32 46 47int crypto_kem_sntrup761_enc(unsigned char *cstr, unsigned char *k, 48 const unsigned char *pk); 49int crypto_kem_sntrup761_dec(unsigned char *k, 50 const unsigned char *cstr, const unsigned char *sk); 51int crypto_kem_sntrup761_keypair(unsigned char *pk, unsigned char *sk); 52 53#endif /* crypto_api_h */ 54