xref: /openbsd/usr.bin/signify/crypto_api.h (revision 771fbea0)
1 /* $OpenBSD: crypto_api.h,v 1.2 2018/01/16 21:42:40 naddy 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 int32_t crypto_int32;
15 typedef uint32_t crypto_uint32;
16 
17 #define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len))
18 
19 int	crypto_hashblocks_sha512(unsigned char *, const unsigned char *,
20      unsigned long long);
21 
22 #define crypto_hash_sha512_BYTES 64U
23 
24 int	crypto_hash_sha512(unsigned char *, const unsigned char *,
25     unsigned long long);
26 
27 int	crypto_verify_32(const unsigned char *, const unsigned char *);
28 
29 #define crypto_sign_ed25519_SECRETKEYBYTES 64U
30 #define crypto_sign_ed25519_PUBLICKEYBYTES 32U
31 #define crypto_sign_ed25519_BYTES 64U
32 
33 int	crypto_sign_ed25519(unsigned char *, unsigned long long *,
34     const unsigned char *, unsigned long long, const unsigned char *);
35 int	crypto_sign_ed25519_open(unsigned char *, unsigned long long *,
36     const unsigned char *, unsigned long long, const unsigned char *);
37 int	crypto_sign_ed25519_keypair(unsigned char *, unsigned char *);
38 
39 #endif /* crypto_api_h */
40