Deleted Added
full compact
yarrow.h (71037) yarrow.h (72364)
1/*-
2 * Copyright (c) 2000 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

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

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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 *
1/*-
2 * Copyright (c) 2000 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

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

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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 * $FreeBSD: head/sys/dev/random/yarrow.h 71037 2001-01-14 17:50:15Z markm $
26 * $FreeBSD: head/sys/dev/random/yarrow.h 72364 2001-02-11 16:21:35Z markm $
27 */
28
29/* #define ENTROPYSOURCE nn entropy sources (actually classes)
30 * This is properly defined in
31 * an enum in sys/random.h
32 */
33
27 */
28
29/* #define ENTROPYSOURCE nn entropy sources (actually classes)
30 * This is properly defined in
31 * an enum in sys/random.h
32 */
33
34/* The ring size _MUST_ be a power of 2 */
34#define HARVEST_RING_SIZE 1024 /* harvest ring buffer size */
35#define HARVEST_RING_SIZE 1024 /* harvest ring buffer size */
36#define HARVEST_RING_MASK (HARVEST_RING_SIZE - 1)
37
35#define TIMEBIN 16 /* max value for Pt/t */
36
37#define HARVESTSIZE 16 /* max size of each harvested entropy unit */
38
39#define FAST 0
40#define SLOW 1
41
42int random_init(void);

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

67 (given as 1024/n) */
68 } source[ENTROPYSOURCE];
69 u_int thresh; /* pool reseed threshhold */
70 struct yarrowhash hash; /* accumulated entropy */
71 } pool[2]; /* pool[0] is fast, pool[1] is slow */
72 int which; /* toggle - shows the current insertion pool */
73 int seeded; /* 0 causes blocking 1 allows normal output */
74 struct selinfo rsel; /* For poll(2) */
38#define TIMEBIN 16 /* max value for Pt/t */
39
40#define HARVESTSIZE 16 /* max size of each harvested entropy unit */
41
42#define FAST 0
43#define SLOW 1
44
45int random_init(void);

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

70 (given as 1024/n) */
71 } source[ENTROPYSOURCE];
72 u_int thresh; /* pool reseed threshhold */
73 struct yarrowhash hash; /* accumulated entropy */
74 } pool[2]; /* pool[0] is fast, pool[1] is slow */
75 int which; /* toggle - shows the current insertion pool */
76 int seeded; /* 0 causes blocking 1 allows normal output */
77 struct selinfo rsel; /* For poll(2) */
78 u_char raw[HARVESTSIZE];/* Raw buffer for checking */
75};
76
77extern struct random_state random_state;
79};
80
81extern struct random_state random_state;