From 0b9df2ad945842caa8628cda5cea2f35353e661e Mon Sep 17 00:00:00 2001 From: riastradh Date: Tue, 14 Apr 2015 13:14:20 +0000 Subject: [PATCH] Move RND_EXTRACT_{ANY,GOOD} to rndpool.h whose API they are part of. --- sys/dev/rnd_private.h | 10 +--------- sys/sys/rndpool.h | 7 ++++++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/sys/dev/rnd_private.h b/sys/dev/rnd_private.h index cf45846beed1..7ff58dce7c4b 100644 --- a/sys/dev/rnd_private.h +++ b/sys/dev/rnd_private.h @@ -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); diff --git a/sys/sys/rndpool.h b/sys/sys/rndpool.h index ce62347882d6..87674451b4d5 100644 --- a/sys/sys/rndpool.h +++ b/sys/sys/rndpool.h @@ -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);