Damien Miller | 6674eb9 | 2013-12-18 17:50:39 +1100 | [diff] [blame] | 1 | /* $OpenBSD: crypto_api.h,v 1.3 2013/12/17 10:36:38 markus 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 | |
Darren Tucker | ac413b6 | 2014-01-17 12:31:33 +1100 | [diff] [blame] | 11 | #ifdef HAVE_STDINT_H |
| 12 | # include <stdint.h> |
| 13 | #endif |
Damien Miller | 5be9d9e | 2013-12-07 11:24:01 +1100 | [diff] [blame] | 14 | #include <stdlib.h> |
| 15 | |
| 16 | typedef int32_t crypto_int32; |
| 17 | typedef uint32_t crypto_uint32; |
| 18 | |
| 19 | #define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len)) |
| 20 | |
| 21 | #define crypto_hashblocks_sha512_STATEBYTES 64U |
| 22 | #define crypto_hashblocks_sha512_BLOCKBYTES 128U |
| 23 | |
| 24 | int crypto_hashblocks_sha512(unsigned char *, const unsigned char *, |
| 25 | unsigned long long); |
| 26 | |
| 27 | #define crypto_hash_sha512_BYTES 64U |
| 28 | |
| 29 | int crypto_hash_sha512(unsigned char *, const unsigned char *, |
| 30 | unsigned long long); |
| 31 | |
| 32 | int crypto_verify_32(const unsigned char *, const unsigned char *); |
| 33 | |
Damien Miller | 5be9d9e | 2013-12-07 11:24:01 +1100 | [diff] [blame] | 34 | #define crypto_sign_ed25519_SECRETKEYBYTES 64U |
| 35 | #define crypto_sign_ed25519_PUBLICKEYBYTES 32U |
| 36 | #define crypto_sign_ed25519_BYTES 64U |
| 37 | |
| 38 | int crypto_sign_ed25519(unsigned char *, unsigned long long *, |
| 39 | const unsigned char *, unsigned long long, const unsigned char *); |
| 40 | int crypto_sign_ed25519_open(unsigned char *, unsigned long long *, |
| 41 | const unsigned char *, unsigned long long, const unsigned char *); |
| 42 | int crypto_sign_ed25519_keypair(unsigned char *, unsigned char *); |
| 43 | |
| 44 | #endif /* crypto_api_h */ |