]>
git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/corecrypto/ccrng.h
5 * Created on 12/13/2010
7 * Copyright (c) 2010,2011,2013,2014,2015 Apple Inc. All rights reserved.
11 #ifndef _CORECRYPTO_CCRNG_H_
12 #define _CORECRYPTO_CCRNG_H_
16 #include <corecrypto/cc.h>
18 #define CC_ERR_DEVICE -100
19 #define CC_ERR_INTERUPTS -101
20 #define CC_ERR_CRYPTO_CONFIG -102
21 #define CC_ERR_PERMS -103
22 #define CC_ERR_PARAMETER -104
23 #define CC_ERR_MEMORY -105
24 #define CC_ERR_FILEDESC -106
25 #define CC_ERR_OUT_OF_ENTROPY -107
26 #define CC_ERR_INTERNAL -108
27 #define CC_ERR_ATFORK -109
28 #define CC_ERR_OVERFLOW -110
30 #define CCRNG_STATE_COMMON \
31 int (*generate)(struct ccrng_state *rng, size_t outlen, void *out);
33 /* Get a pointer to a ccrng has never been simpler! Just call this */
34 struct ccrng_state
*ccrng(int *error
);
36 /* default state structure - do not instantiate, instead use the specific one you need */
41 #define ccrng_generate(ctx, outlen, out) ((ctx)->generate((ctx), (outlen), (out)))
43 #endif /* _CORECRYPTO_CCRNG_H_ */