diff options
author | Patrick McCarty <patrick.mccarty@linux.intel.com> | 2013-04-12 10:41:14 -0700 |
---|---|---|
committer | Patrick McCarty <patrick.mccarty@linux.intel.com> | 2013-04-12 10:41:14 -0700 |
commit | ab15de43a1110820e448940c479c7d988072b072 (patch) | |
tree | c8fc43d7384fe98be92deace3189354221b0574b /rngd_entsource.h | |
download | rng-tools-ab15de43a1110820e448940c479c7d988072b072.tar.gz rng-tools-ab15de43a1110820e448940c479c7d988072b072.tar.bz2 rng-tools-ab15de43a1110820e448940c479c7d988072b072.zip |
Imported Upstream version 4upstream/4
Diffstat (limited to 'rngd_entsource.h')
-rw-r--r-- | rngd_entsource.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/rngd_entsource.h b/rngd_entsource.h new file mode 100644 index 0000000..79b8b86 --- /dev/null +++ b/rngd_entsource.h @@ -0,0 +1,47 @@ +/* + * rngd_source.h -- Entropy source and conditioning + * + * Copyright (C) 2001 Philipp Rumpf + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef RNGD_ENTSOURCE__H +#define RNGD_ENTSOURCE__H + +#include "rng-tools-config.h" + +#include <unistd.h> +#include <stdint.h> + +/* Logic and contexts */ +extern fips_ctx_t fipsctx; /* Context for the FIPS tests */ +extern fips_ctx_t tpm_fipsctx; /* Context for the tpm FIPS tests */ + +/* + * Initialize entropy source and entropy conditioning + * + * sourcedev is the path to the entropy source + */ +extern int init_entropy_source(struct rng *); +extern int init_drng_entropy_source(struct rng *); +extern int init_tpm_entropy_source(struct rng *); + +/* Read data from the entropy source */ +extern int xread(void *buf, size_t size, struct rng *ent_src); +extern int xread_drng(void *buf, size_t size, struct rng *ent_src); +extern int xread_tpm(void *buf, size_t size, struct rng *ent_src); + +#endif /* RNGD_ENTSOURCE__H */ |