]>
Commit | Line | Data |
---|---|---|
316670eb A |
1 | /* |
2 | * ccrng.h | |
3 | * corecrypto | |
4 | * | |
3e170ce0 A |
5 | * Created on 12/13/2010 |
6 | * | |
7 | * Copyright (c) 2010,2011,2013,2014,2015 Apple Inc. All rights reserved. | |
316670eb A |
8 | * |
9 | */ | |
10 | ||
316670eb A |
11 | #ifndef _CORECRYPTO_CCRNG_H_ |
12 | #define _CORECRYPTO_CCRNG_H_ | |
13 | ||
14 | #include <stdint.h> | |
15 | ||
3e170ce0 A |
16 | #define CC_ERR_DEVICE -100 |
17 | #define CC_ERR_INTERUPTS -101 | |
18 | #define CC_ERR_CRYPTO_CONFIG -102 | |
19 | #define CC_ERR_PERMS -103 | |
20 | #define CC_ERR_PARAMETER -104 | |
21 | #define CC_ERR_MEMORY -105 | |
22 | #define CC_ERR_FILEDESC -106 | |
23 | #define CC_ERR_OUT_OF_ENTROPY -107 | |
fe8ab488 | 24 | |
316670eb A |
25 | #define CCRNG_STATE_COMMON \ |
26 | int (*generate)(struct ccrng_state *rng, unsigned long outlen, void *out); | |
27 | ||
28 | /* default state structure - do not instantiate, instead use the specific one you need */ | |
29 | struct ccrng_state { | |
30 | CCRNG_STATE_COMMON | |
31 | }; | |
32 | ||
33 | #define ccrng_generate(ctx, outlen, out) ((ctx)->generate((ctx), (outlen), (out))) | |
34 | ||
35 | #endif /* _CORECRYPTO_CCRNG_H_ */ |