summaryrefslogtreecommitdiff
path: root/src/crypto/reflibs/Crypto/Random.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/reflibs/Crypto/Random.hs')
-rw-r--r--src/crypto/reflibs/Crypto/Random.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/crypto/reflibs/Crypto/Random.hs b/src/crypto/reflibs/Crypto/Random.hs
new file mode 100644
index 0000000..6297155
--- /dev/null
+++ b/src/crypto/reflibs/Crypto/Random.hs
@@ -0,0 +1,13 @@
+module Crypto.Random (
+ MonadRandom(..),
+) where
+
+import Crypto.Random.Entropy
+
+import Data.ByteArray
+
+class Monad m => MonadRandom m where
+ getRandomBytes :: ByteArray byteArray => Int -> m byteArray
+
+instance MonadRandom IO where
+ getRandomBytes = fmap convert . getEntropy