remove Byteable and unnecessary SecureMem

This commit is contained in:
Vincent Hanquez 2015-04-08 20:42:43 +01:00
parent 8d9f493fe2
commit 9d0cf74713

View File

@ -8,6 +8,7 @@
-- symmetric cipher basic types -- symmetric cipher basic types
-- --
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Crypto.Cipher.Types.Base module Crypto.Cipher.Types.Base
( KeySizeSpecifier(..) ( KeySizeSpecifier(..)
, Cipher(..) , Cipher(..)
@ -16,8 +17,6 @@ module Crypto.Cipher.Types.Base
, DataUnitOffset , DataUnitOffset
) where ) where
import Data.Byteable
import Data.SecureMem
import Data.Word import Data.Word
import Data.ByteString (ByteString) import Data.ByteString (ByteString)
@ -35,13 +34,11 @@ data KeySizeSpecifier =
type DataUnitOffset = Word32 type DataUnitOffset = Word32
-- | Authentification Tag for AE cipher mode -- | Authentification Tag for AE cipher mode
newtype AuthTag = AuthTag ByteString newtype AuthTag = AuthTag { unAuthTag :: ByteString }
deriving (Show) deriving (Show, ByteArrayAccess)
instance Eq AuthTag where instance Eq AuthTag where
(AuthTag a) == (AuthTag b) = constEqBytes a b (AuthTag a) == (AuthTag b) = byteArrayConstEq a b
instance Byteable AuthTag where
toBytes (AuthTag bs) = bs
-- | AEAD Mode -- | AEAD Mode
data AEADMode = data AEADMode =