Move RND_EXTRACT_{ANY,GOOD} to rndpool.h whose API they are part of.

This commit is contained in:
riastradh 2015-04-14 13:14:20 +00:00
parent c3178eae02
commit 0b9df2ad94
2 changed files with 7 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rnd_private.h,v 1.10 2015/04/14 13:12:33 riastradh Exp $ */
/* $NetBSD: rnd_private.h,v 1.11 2015/04/14 13:14:20 riastradh Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -47,14 +47,6 @@
*/
#define RND_ENTROPY_THRESHOLD 10
/*
* Used by rnd_extract_data() and rndpool_extract_data() to describe how
* "good" the data has to be.
*/
#define RND_EXTRACT_ANY 0 /* extract anything, even if no entropy */
#define RND_EXTRACT_GOOD 1 /* return as many good bytes
(short read ok) */
bool rnd_extract(void *, size_t);
bool rnd_tryextract(void *, size_t);
void rnd_getmore(size_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rndpool.h,v 1.2 2015/04/13 23:21:03 riastradh Exp $ */
/* $NetBSD: rndpool.h,v 1.3 2015/04/14 13:14:20 riastradh Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -56,6 +56,11 @@ typedef struct {
uint32_t pool[RND_POOLWORDS]; /* random pool data */
} rndpool_t;
/* Mode for rnd_extract_data. */
#define RND_EXTRACT_ANY 0 /* extract as many bits as requested */
#define RND_EXTRACT_GOOD 1 /* extract as many bits as we have counted
* entropy */
void rndpool_init(rndpool_t *);
uint32_t rndpool_get_entropy_count(rndpool_t *);
void rndpool_set_entropy_count(rndpool_t *, uint32_t);