]> git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/corecrypto/ccrng_system.h
xnu-3247.10.11.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / corecrypto / ccrng_system.h
1 /*
2 * ccrng_system.h
3 * corecrypto
4 *
5 * Created on 12/13/2010
6 *
7 * Copyright (c) 2010,2013,2014,2015 Apple Inc. All rights reserved.
8 *
9 */
10
11 #ifndef _CORECRYPTO_CCRNG_SYSTEM_H_
12 #define _CORECRYPTO_CCRNG_SYSTEM_H_
13
14 #include <corecrypto/ccrng.h>
15
16 struct ccrng_system_state {
17 CCRNG_STATE_COMMON
18 int fd;
19 };
20
21 // Setup the system RNG (open descriptor on file /dev/random)
22 int ccrng_system_init(struct ccrng_system_state *rng);
23
24 // Close the system RNG
25 // Mandatory step to avoid leaking file descriptor
26 void ccrng_system_done(struct ccrng_system_state *rng);
27
28 #endif /* _CORECRYPTO_CCRNG_SYSTEM_H_ */