naddy@openbsd.org | 4cdc595 | 2017-12-14 21:07:39 +0000 | [diff] [blame] | 1 | /* $OpenBSD: crypto_api.h,v 1.4 2017/12/14 21:07:39 naddy Exp $ */ |
Damien Miller | 5be9d9e | 2013-12-07 11:24:01 +1100 | [diff] [blame] | 2 | |
Damien Miller | 6674eb9 | 2013-12-18 17:50:39 +1100 | [diff] [blame] | 3 | /* |
| 4 | * Assembled from generated headers and source files by Markus Friedl. |
| 5 | * Placed in the public domain. |
| 6 | */ |
Damien Miller | 5be9d9e | 2013-12-07 11:24:01 +1100 | [diff] [blame] | 7 | |
| 8 | #ifndef crypto_api_h |
| 9 | #define crypto_api_h |
| 10 | |
Damien Miller | 89f09ee | 2018-01-24 12:20:44 +1100 | [diff] [blame] | 11 | #include "includes.h" |
| 12 | |
Darren Tucker | ac413b6 | 2014-01-17 12:31:33 +1100 | [diff] [blame] | 13 | #ifdef HAVE_STDINT_H |
| 14 | # include <stdint.h> |
| 15 | #endif |
Damien Miller | 5be9d9e | 2013-12-07 11:24:01 +1100 | [diff] [blame] | 16 | #include <stdlib.h> |
| 17 | |
| 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 | |
Damien Miller | 5be9d9e | 2013-12-07 11:24:01 +1100 | [diff] [blame] | 23 | #define crypto_hash_sha512_BYTES 64U |
| 24 | |
| 25 | int crypto_hash_sha512(unsigned char *, const unsigned char *, |
| 26 | unsigned long long); |
| 27 | |
| 28 | int crypto_verify_32(const unsigned char *, const unsigned char *); |
| 29 | |
Damien Miller | 5be9d9e | 2013-12-07 11:24:01 +1100 | [diff] [blame] | 30 | #define crypto_sign_ed25519_SECRETKEYBYTES 64U |
| 31 | #define crypto_sign_ed25519_PUBLICKEYBYTES 32U |
| 32 | #define crypto_sign_ed25519_BYTES 64U |
| 33 | |
| 34 | int crypto_sign_ed25519(unsigned char *, unsigned long long *, |
| 35 | const unsigned char *, unsigned long long, const unsigned char *); |
| 36 | int crypto_sign_ed25519_open(unsigned char *, unsigned long long *, |
| 37 | const unsigned char *, unsigned long long, const unsigned char *); |
| 38 | int crypto_sign_ed25519_keypair(unsigned char *, unsigned char *); |
| 39 | |
| 40 | #endif /* crypto_api_h */ |