From fc39ddb96af70c14c5de739408b03a14ef2053bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 3 Mar 2017 15:44:01 -0400 Subject: Updated to use raaz-0.1.1. This commit was sponsored by John Peloquin on Patreon. --- ByteStrings.hs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'ByteStrings.hs') diff --git a/ByteStrings.hs b/ByteStrings.hs index cecf617..90b42f0 100644 --- a/ByteStrings.hs +++ b/ByteStrings.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-orphans #-} - {- Copyright 2016 Joey Hess - - Licensed under the GNU AGPL version 3 or higher. @@ -9,8 +7,6 @@ module ByteStrings where import qualified Data.ByteString as B import qualified Raaz -import Control.Monad -import Data.Word allByteStringsOfLength :: Int -> [B.ByteString] allByteStringsOfLength = go [] @@ -34,9 +30,8 @@ chunkByteString n = go [] let (h, t) = B.splitAt n b in go (h:cs) t -instance Raaz.Random Word8 - -randomByteStringOfLength :: Int -> Raaz.SystemPRG -> IO B.ByteString -randomByteStringOfLength n prg = B.pack <$> replicateM n randbyte +randomByteStringOfLength :: Int -> IO B.ByteString +randomByteStringOfLength n = Raaz.securely gen where - randbyte = Raaz.random prg :: IO Word8 + gen :: Raaz.RandM B.ByteString + gen = Raaz.randomByteString (Raaz.BYTES n) -- cgit v1.2.3