diff --git a/Crypto/Cipher/AES/Internal.hs b/Crypto/Cipher/AES/Internal.hs index 6057530..d75bbe6 100644 --- a/Crypto/Cipher/AES/Internal.hs +++ b/Crypto/Cipher/AES/Internal.hs @@ -21,7 +21,6 @@ import Foreign.C.String data AES data AESOCB data AESGCM - ------------------------------------------------------------------------ foreign import ccall "cryptonite_aes.h cryptonite_aes_initkey" c_aes_init :: Ptr AES -> CString -> CUInt -> IO () diff --git a/Crypto/Cipher/Types/Block.hs b/Crypto/Cipher/Types/Block.hs index c9bd869..fed5303 100644 --- a/Crypto/Cipher/Types/Block.hs +++ b/Crypto/Cipher/Types/Block.hs @@ -34,11 +34,10 @@ module Crypto.Cipher.Types.Block import Data.ByteString (ByteString) import qualified Data.ByteString as B -import qualified Data.ByteString.Internal as B (unsafeCreate) import Data.Byteable import Data.Word import Crypto.Cipher.Types.Base -import Crypto.Cipher.Types.GF +--import Crypto.Cipher.Types.GF import Crypto.Cipher.Types.Utils import Crypto.Internal.ByteArray diff --git a/Crypto/Error/Types.hs b/Crypto/Error/Types.hs index cb206ed..43366d9 100644 --- a/Crypto/Error/Types.hs +++ b/Crypto/Error/Types.hs @@ -40,9 +40,14 @@ instance Functor CryptoFailable where fmap _ (CryptoFailed r) = CryptoFailed r instance Applicative CryptoFailable where - pure a = CryptoPassed a + pure a = CryptoPassed a + (<*>) fm m = fm >>= \p -> m >>= \r2 -> return (p r2) instance Monad CryptoFailable where return a = CryptoPassed a + (>>=) m1 m2 = do + case m1 of + CryptoPassed a -> m2 a + CryptoFailed e -> CryptoFailed e throwCryptoError :: CryptoFailable a -> IO a throwCryptoError = undefined diff --git a/tests/KAT_Blowfish.hs b/tests/KAT_Blowfish.hs index 8819df5..a6f59a8 100644 --- a/tests/KAT_Blowfish.hs +++ b/tests/KAT_Blowfish.hs @@ -2,7 +2,7 @@ module KAT_Blowfish where import Crypto.Cipher.Blowfish -import Imports +import Imports () import BlockCipher vectors_ecb = -- key plaintext cipher