xref: /freebsd/sys/dev/random/fortuna.h (revision 10cb24248a6f13974e11c255c8014cfefe6420a7)
1*10cb2424SMark Murray /*-
2*10cb2424SMark Murray  * Copyright (c) 2013 Mark R V Murray
3*10cb2424SMark Murray  * All rights reserved.
4*10cb2424SMark Murray  *
5*10cb2424SMark Murray  * Redistribution and use in source and binary forms, with or without
6*10cb2424SMark Murray  * modification, are permitted provided that the following conditions
7*10cb2424SMark Murray  * are met:
8*10cb2424SMark Murray  * 1. Redistributions of source code must retain the above copyright
9*10cb2424SMark Murray  *    notice, this list of conditions and the following disclaimer
10*10cb2424SMark Murray  *    in this position and unchanged.
11*10cb2424SMark Murray  * 2. Redistributions in binary form must reproduce the above copyright
12*10cb2424SMark Murray  *    notice, this list of conditions and the following disclaimer in the
13*10cb2424SMark Murray  *    documentation and/or other materials provided with the distribution.
14*10cb2424SMark Murray  *
15*10cb2424SMark Murray  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*10cb2424SMark Murray  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*10cb2424SMark Murray  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*10cb2424SMark Murray  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19*10cb2424SMark Murray  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*10cb2424SMark Murray  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*10cb2424SMark Murray  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*10cb2424SMark Murray  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*10cb2424SMark Murray  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*10cb2424SMark Murray  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*10cb2424SMark Murray  *
26*10cb2424SMark Murray  * $FreeBSD$
27*10cb2424SMark Murray  */
28*10cb2424SMark Murray 
29*10cb2424SMark Murray #ifndef SYS_DEV_RANDOM_FORTUNA_H_INCLUDED
30*10cb2424SMark Murray #define SYS_DEV_RANDOM_FORTUNA_H_INCLUDED
31*10cb2424SMark Murray 
32*10cb2424SMark Murray #ifdef _KERNEL
33*10cb2424SMark Murray typedef struct mtx mtx_t;
34*10cb2424SMark Murray #endif
35*10cb2424SMark Murray 
36*10cb2424SMark Murray void random_fortuna_init_alg(void);
37*10cb2424SMark Murray void random_fortuna_deinit_alg(void);
38*10cb2424SMark Murray void random_fortuna_read(uint8_t *, u_int);
39*10cb2424SMark Murray void random_fortuna_write(uint8_t *, u_int);
40*10cb2424SMark Murray void random_fortuna_reseed(void);
41*10cb2424SMark Murray int random_fortuna_seeded(void);
42*10cb2424SMark Murray void random_fortuna_process_event(struct harvest_event *event);
43*10cb2424SMark Murray 
44*10cb2424SMark Murray #endif
45