blob: 580ba79bd20a47dcc82c6c239ede90ba72ee812f [file] [log] [blame]
Damien Miller6674eb92013-12-18 17:50:39 +11001/* $OpenBSD: crypto_api.h,v 1.3 2013/12/17 10:36:38 markus Exp $ */
Damien Miller5be9d9e2013-12-07 11:24:01 +11002
Damien Miller6674eb92013-12-18 17:50:39 +11003/*
4 * Assembled from generated headers and source files by Markus Friedl.
5 * Placed in the public domain.
6 */
Damien Miller5be9d9e2013-12-07 11:24:01 +11007
8#ifndef crypto_api_h
9#define crypto_api_h
10
11#include <stdint.h>
12#include <stdlib.h>
13
14typedef int32_t crypto_int32;
15typedef uint32_t crypto_uint32;
16
17#define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len))
18
19#define crypto_hashblocks_sha512_STATEBYTES 64U
20#define crypto_hashblocks_sha512_BLOCKBYTES 128U
21
22int crypto_hashblocks_sha512(unsigned char *, const unsigned char *,
23 unsigned long long);
24
25#define crypto_hash_sha512_BYTES 64U
26
27int crypto_hash_sha512(unsigned char *, const unsigned char *,
28 unsigned long long);
29
30int crypto_verify_32(const unsigned char *, const unsigned char *);
31
Damien Miller5be9d9e2013-12-07 11:24:01 +110032#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#endif /* crypto_api_h */