summaryrefslogtreecommitdiff
path: root/libsec/port/fastrand.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsec/port/fastrand.c')
-rw-r--r--libsec/port/fastrand.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libsec/port/fastrand.c b/libsec/port/fastrand.c
new file mode 100644
index 00000000..b65ba683
--- /dev/null
+++ b/libsec/port/fastrand.c
@@ -0,0 +1,15 @@
+#include "os.h"
+#include <libsec.h>
+
+/*
+ * use the X917 random number generator to create random
+ * numbers (faster than truerand() but not as random).
+ */
+ulong
+fastrand(void)
+{
+ ulong x;
+
+ genrandom((uchar*)&x, sizeof x);
+ return x;
+}