]> git.ipfire.org Git - thirdparty/rng-tools.git/blob - rngd_entsource.h
s/list_add/src_list_add/
[thirdparty/rng-tools.git] / rngd_entsource.h
1 /*
2 * rngd_source.h -- Entropy source and conditioning
3 *
4 * Copyright (C) 2001 Philipp Rumpf
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef RNGD_ENTSOURCE__H
22 #define RNGD_ENTSOURCE__H
23
24 #include "rng-tools-config.h"
25
26 #include <unistd.h>
27 #include <stdint.h>
28
29 /* Logic and contexts */
30 extern fips_ctx_t fipsctx; /* Context for the FIPS tests */
31 extern fips_ctx_t tpm_fipsctx; /* Context for the tpm FIPS tests */
32
33 /*
34 * Initialize entropy source and entropy conditioning
35 *
36 * sourcedev is the path to the entropy source
37 */
38 extern int init_entropy_source(struct rng *);
39 extern int init_tpm_entropy_source(struct rng *);
40
41 /* Read data from the entropy source */
42 extern int xread(void *buf, size_t size, struct rng *ent_src);
43 extern int xread_tpm(void *buf, size_t size, struct rng *ent_src);
44
45 #endif /* RNGD_ENTSOURCE__H */