blob: 88668451fa40be62221b7213b8b30d615ba6a7a5 [file] [log] [blame]
Damien Miller155b5a52013-12-18 17:48:32 +11001/* $OpenBSD: crypto_api.h,v 1.2 2013/12/09 11:08:17 markus Exp $ */
Damien Miller5be9d9e2013-12-07 11:24:01 +11002
3/* Placed in the public domain. */
4
5#ifndef crypto_api_h
6#define crypto_api_h
7
8#include <stdint.h>
9#include <stdlib.h>
10
11typedef int32_t crypto_int32;
12typedef uint32_t crypto_uint32;
13
14#define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len))
15
16#define crypto_hashblocks_sha512_STATEBYTES 64U
17#define crypto_hashblocks_sha512_BLOCKBYTES 128U
18
19int crypto_hashblocks_sha512(unsigned char *, const unsigned char *,
20 unsigned long long);
21
22#define crypto_hash_sha512_BYTES 64U
23
24int crypto_hash_sha512(unsigned char *, const unsigned char *,
25 unsigned long long);
26
27int crypto_verify_32(const unsigned char *, const unsigned char *);
28
Damien Miller5be9d9e2013-12-07 11:24:01 +110029#define crypto_sign_ed25519_SECRETKEYBYTES 64U
30#define crypto_sign_ed25519_PUBLICKEYBYTES 32U
31#define crypto_sign_ed25519_BYTES 64U
32
33int crypto_sign_ed25519(unsigned char *, unsigned long long *,
34 const unsigned char *, unsigned long long, const unsigned char *);
35int crypto_sign_ed25519_open(unsigned char *, unsigned long long *,
36 const unsigned char *, unsigned long long, const unsigned char *);
37int crypto_sign_ed25519_keypair(unsigned char *, unsigned char *);
38
39#endif /* crypto_api_h */