Deleted Added
full compact
yarrow.c (153575) yarrow.c (170025)
1/*-
2 * Copyright (c) 2000-2004 Mark R V Murray
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000-2004 Mark R V Murray
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/random/yarrow.c 153575 2005-12-20 21:41:52Z ps $");
29__FBSDID("$FreeBSD: head/sys/dev/random/yarrow.c 170025 2007-05-27 18:54:58Z rwatson $");
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/lock.h>
34#include <sys/malloc.h>
35#include <sys/mutex.h>
36#include <sys/random.h>
37#include <sys/sysctl.h>

--- 61 unchanged lines hidden (view full) ---

99 /* Invert the fast/slow pool selector bit */
100 random_state.which = !random_state.which;
101}
102
103void
104random_yarrow_init_alg(struct sysctl_ctx_list *clist, struct sysctl_oid *in_o)
105{
106 int i;
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/lock.h>
34#include <sys/malloc.h>
35#include <sys/mutex.h>
36#include <sys/random.h>
37#include <sys/sysctl.h>

--- 61 unchanged lines hidden (view full) ---

99 /* Invert the fast/slow pool selector bit */
100 random_state.which = !random_state.which;
101}
102
103void
104random_yarrow_init_alg(struct sysctl_ctx_list *clist, struct sysctl_oid *in_o)
105{
106 int i;
107 struct sysctl_oid *o, *random_yarrow_o;
107 struct sysctl_oid *random_yarrow_o;
108
109 /* Yarrow parameters. Do not adjust these unless you have
110 * have a very good clue about what they do!
111 */
108
109 /* Yarrow parameters. Do not adjust these unless you have
110 * have a very good clue about what they do!
111 */
112 o = SYSCTL_ADD_NODE(clist,
112 random_yarrow_o = SYSCTL_ADD_NODE(clist,
113 SYSCTL_CHILDREN(in_o),
114 OID_AUTO, "yarrow", CTLFLAG_RW, 0,
115 "Yarrow Parameters");
116
113 SYSCTL_CHILDREN(in_o),
114 OID_AUTO, "yarrow", CTLFLAG_RW, 0,
115 "Yarrow Parameters");
116
117 random_yarrow_o = o;
118
119 o = SYSCTL_ADD_PROC(clist,
117 SYSCTL_ADD_PROC(clist,
120 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
121 "gengateinterval", CTLTYPE_INT|CTLFLAG_RW,
122 &random_state.gengateinterval, 10,
123 random_check_uint_gengateinterval, "I",
124 "Generation gate interval");
125
118 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
119 "gengateinterval", CTLTYPE_INT|CTLFLAG_RW,
120 &random_state.gengateinterval, 10,
121 random_check_uint_gengateinterval, "I",
122 "Generation gate interval");
123
126 o = SYSCTL_ADD_PROC(clist,
124 SYSCTL_ADD_PROC(clist,
127 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
128 "bins", CTLTYPE_INT|CTLFLAG_RW,
129 &random_state.bins, 10,
130 random_check_uint_bins, "I",
131 "Execution time tuner");
132
125 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
126 "bins", CTLTYPE_INT|CTLFLAG_RW,
127 &random_state.bins, 10,
128 random_check_uint_bins, "I",
129 "Execution time tuner");
130
133 o = SYSCTL_ADD_PROC(clist,
131 SYSCTL_ADD_PROC(clist,
134 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
135 "fastthresh", CTLTYPE_INT|CTLFLAG_RW,
136 &random_state.pool[0].thresh, (3*BLOCKSIZE)/4,
137 random_check_uint_fastthresh, "I",
138 "Fast reseed threshold");
139
132 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
133 "fastthresh", CTLTYPE_INT|CTLFLAG_RW,
134 &random_state.pool[0].thresh, (3*BLOCKSIZE)/4,
135 random_check_uint_fastthresh, "I",
136 "Fast reseed threshold");
137
140 o = SYSCTL_ADD_PROC(clist,
138 SYSCTL_ADD_PROC(clist,
141 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
142 "slowthresh", CTLTYPE_INT|CTLFLAG_RW,
143 &random_state.pool[1].thresh, BLOCKSIZE,
144 random_check_uint_slowthresh, "I",
145 "Slow reseed threshold");
146
139 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
140 "slowthresh", CTLTYPE_INT|CTLFLAG_RW,
141 &random_state.pool[1].thresh, BLOCKSIZE,
142 random_check_uint_slowthresh, "I",
143 "Slow reseed threshold");
144
147 o = SYSCTL_ADD_PROC(clist,
145 SYSCTL_ADD_PROC(clist,
148 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
149 "slowoverthresh", CTLTYPE_INT|CTLFLAG_RW,
150 &random_state.slowoverthresh, 2,
151 random_check_uint_slowoverthresh, "I",
152 "Slow over-threshold reseed");
153
154 random_state.gengateinterval = 10;
155 random_state.bins = 10;

--- 196 unchanged lines hidden ---
146 SYSCTL_CHILDREN(random_yarrow_o), OID_AUTO,
147 "slowoverthresh", CTLTYPE_INT|CTLFLAG_RW,
148 &random_state.slowoverthresh, 2,
149 random_check_uint_slowoverthresh, "I",
150 "Slow over-threshold reseed");
151
152 random_state.gengateinterval = 10;
153 random_state.bins = 10;

--- 196 unchanged lines hidden ---