]> git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/corecrypto/ccrng.h
xnu-2782.40.9.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / corecrypto / ccrng.h
1 /*
2 * ccrng.h
3 * corecrypto
4 *
5 * Created by Fabrice Gautier on 12/13/10.
6 * Copyright 2010 Apple, Inc. All rights reserved.
7 *
8 */
9
10 #ifndef _CORECRYPTO_CCRNG_H_
11 #define _CORECRYPTO_CCRNG_H_
12
13 #include <stdint.h>
14
15 #define CC_ERR_DEVICE -100
16 #define CC_ERR_INTERUPTS -101
17 #define CC_ERR_CRYPTO_CONFIG -102
18 #define CC_ERR_PERMS -103
19 #define CC_ERR_PARAMETER -104
20 #define CC_ERR_MEMORY -105
21
22 #define CCRNG_STATE_COMMON \
23 int (*generate)(struct ccrng_state *rng, unsigned long outlen, void *out);
24
25 /* default state structure - do not instantiate, instead use the specific one you need */
26 struct ccrng_state {
27 CCRNG_STATE_COMMON
28 };
29
30 #define ccrng_generate(ctx, outlen, out) ((ctx)->generate((ctx), (outlen), (out)))
31
32 #endif /* _CORECRYPTO_CCRNG_H_ */