aboutsummaryrefslogtreecommitdiff
path: root/src/base/rng/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/rng/internal.h')
-rw-r--r--src/base/rng/internal.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/base/rng/internal.h b/src/base/rng/internal.h
new file mode 100644
index 0000000..9cf5f41
--- /dev/null
+++ b/src/base/rng/internal.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <u.h>
+#include <base.h>
+
+#define rol64(x, k) ((x) << (k) | ((x) >> (64-(k))))
+
+typedef struct Rng
+{
+ uint64 s[4];
+} Rng;
+
+typedef struct Mix
+{
+ uint64 s;
+} Mix;
+
+
+extern Rng rng·RNG;