summaryrefslogtreecommitdiffhomepage
path: root/Encryption.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Encryption.hs')
-rw-r--r--Encryption.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/Encryption.hs b/Encryption.hs
index 12edbc6..880095d 100644
--- a/Encryption.hs
+++ b/Encryption.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE OverloadedStrings, MultiParamTypeClasses, DataKinds #-}
-{-# OPTIONS_GHC -fno-warn-orphans #-}
{- Copyright 2016 Joey Hess <id@joeyh.name>
-
@@ -15,8 +14,6 @@ import ExpensiveHash
import ByteStrings
import Data.Monoid
import Data.Maybe
-import Data.Word
-import Control.Monad
import qualified Raaz
import qualified Raaz.Cipher.AES as Raaz
import qualified Raaz.Cipher.Internal as Raaz
@@ -152,12 +149,9 @@ genIV (Name name) =
type SaltPrefix = B.ByteString
genRandomSaltPrefix :: Raaz.SystemPRG -> Tunables -> IO SaltPrefix
-genRandomSaltPrefix prg tunables = B.pack <$> replicateM n randbyte
+genRandomSaltPrefix prg tunables = randomByteStringOfLength n prg
where
n = randomSaltBytes $ keyEncryptionKeyTunable tunables
- randbyte = Raaz.random prg :: IO Word8
-
-instance Raaz.Random Word8
-- | Make an AES key out of a hash value.
--