summaryrefslogtreecommitdiffstats
path: root/sys/dev/rndvar.h
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>1996-03-29 12:09:55 +0000
committermickey <mickey@openbsd.org>1996-03-29 12:09:55 +0000
commite36ba47640d749bcec4fc974d6078fa74e40a4b6 (patch)
treece2abda663a201f9a27641ea2352bae84b9e9046 /sys/dev/rndvar.h
parentInitial commit of random source driver. (diff)
downloadwireguard-openbsd-e36ba47640d749bcec4fc974d6078fa74e40a4b6.tar.xz
wireguard-openbsd-e36ba47640d749bcec4fc974d6078fa74e40a4b6.zip
The random data source driver itself.
Initial commit.
Diffstat (limited to 'sys/dev/rndvar.h')
-rw-r--r--sys/dev/rndvar.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/sys/dev/rndvar.h b/sys/dev/rndvar.h
new file mode 100644
index 00000000000..44b37d98f0d
--- /dev/null
+++ b/sys/dev/rndvar.h
@@ -0,0 +1,58 @@
+/* $OpenBSD: rndvar.h,v 1.1 1996/03/29 12:09:58 mickey Exp $ */
+
+/*
+ * Copyright (c) 1996 Michael Shalayeff.
+ *
+ * This software derived from one contributed by Theodore Ts'o.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Theodore Ts'o.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __RNDVAR_H__
+#define __RNDVAR_H__
+
+#define POOLWORDS 128 /* Power of 2 - note that this is 32-bit words */
+
+#define RND_RND 0 /* real randomness like nuclear chips */
+#define RND_SRND 1 /* strong random source */
+#define RND_URND 2 /* less strong random source */
+#define RND_PRND 3 /* pseudo random source */
+
+#ifdef _KERNEL
+
+extern void add_keyboard_randomness __P((u_char));
+extern void add_mouse_randomness __P((u_int32_t));
+extern void add_net_randomness __P((int));
+extern void add_blkdev_randomness __P((dev_t));
+
+extern void get_random_bytes __P((void *, size_t));
+
+#endif /* _KERNEL */
+
+#endif /* __RNDVAR_H__ */