{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module Crypto.Hash.MD4 ( MD4 (..) ) where
import Crypto.Hash.Types
import Foreign.Ptr (Ptr)
import Data.Data
import Data.Word (Word8, Word32)
data MD4 = MD4
deriving (Int -> MD4 -> ShowS
[MD4] -> ShowS
MD4 -> String
(Int -> MD4 -> ShowS)
-> (MD4 -> String) -> ([MD4] -> ShowS) -> Show MD4
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MD4 -> ShowS
showsPrec :: Int -> MD4 -> ShowS
$cshow :: MD4 -> String
show :: MD4 -> String
$cshowList :: [MD4] -> ShowS
showList :: [MD4] -> ShowS
Show,Typeable MD4
Typeable MD4 =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MD4 -> c MD4)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MD4)
-> (MD4 -> Constr)
-> (MD4 -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MD4))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD4))
-> ((forall b. Data b => b -> b) -> MD4 -> MD4)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r)
-> (forall u. (forall d. Data d => d -> u) -> MD4 -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> MD4 -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4)
-> Data MD4
MD4 -> Constr
MD4 -> DataType
(forall b. Data b => b -> b) -> MD4 -> MD4
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> MD4 -> u
forall u. (forall d. Data d => d -> u) -> MD4 -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MD4
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MD4 -> c MD4
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MD4)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD4)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MD4 -> c MD4
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MD4 -> c MD4
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MD4
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MD4
$ctoConstr :: MD4 -> Constr
toConstr :: MD4 -> Constr
$cdataTypeOf :: MD4 -> DataType
dataTypeOf :: MD4 -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MD4)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MD4)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD4)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD4)
$cgmapT :: (forall b. Data b => b -> b) -> MD4 -> MD4
gmapT :: (forall b. Data b => b -> b) -> MD4 -> MD4
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MD4 -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> MD4 -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MD4 -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MD4 -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
Data)
instance HashAlgorithm MD4 where
type HashBlockSize MD4 = 64
type HashDigestSize MD4 = 16
type HashInternalContextSize MD4 = 96
hashBlockSize :: MD4 -> Int
hashBlockSize MD4
_ = Int
64
hashDigestSize :: MD4 -> Int
hashDigestSize MD4
_ = Int
16
hashInternalContextSize :: MD4 -> Int
hashInternalContextSize MD4
_ = Int
96
hashInternalInit :: Ptr (Context MD4) -> IO ()
hashInternalInit = Ptr (Context MD4) -> IO ()
forall a. Ptr (Context a) -> IO ()
c_md4_init
hashInternalUpdate :: Ptr (Context MD4) -> Ptr Word8 -> Word32 -> IO ()
hashInternalUpdate = Ptr (Context MD4) -> Ptr Word8 -> Word32 -> IO ()
forall a. Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()
c_md4_update
hashInternalFinalize :: Ptr (Context MD4) -> Ptr (Digest MD4) -> IO ()
hashInternalFinalize = Ptr (Context MD4) -> Ptr (Digest MD4) -> IO ()
forall a. Ptr (Context a) -> Ptr (Digest a) -> IO ()
c_md4_finalize
foreign import ccall unsafe "crypton_md4_init"
c_md4_init :: Ptr (Context a)-> IO ()
foreign import ccall "crypton_md4_update"
c_md4_update :: Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()
foreign import ccall unsafe "crypton_md4_finalize"
c_md4_finalize :: Ptr (Context a) -> Ptr (Digest a) -> IO ()