{-# 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MD4] -> ShowS
$cshowList :: [MD4] -> ShowS
show :: MD4 -> String
$cshow :: MD4 -> String
showsPrec :: Int -> MD4 -> ShowS
$cshowsPrec :: Int -> MD4 -> ShowS
Show,Typeable MD4
MD4 -> DataType
MD4 -> Constr
(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)
gmapMo :: 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
gmapMp :: forall (m :: * -> *).
MonadPlus 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
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MD4 -> m MD4
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MD4 -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MD4 -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> MD4 -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MD4 -> [u]
gmapQr :: 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
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MD4 -> r
gmapT :: (forall b. Data b => b -> b) -> MD4 -> MD4
$cgmapT :: (forall b. Data b => b -> b) -> MD4 -> MD4
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD4)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MD4)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MD4)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MD4)
dataTypeOf :: MD4 -> DataType
$cdataTypeOf :: MD4 -> DataType
toConstr :: MD4 -> Constr
$ctoConstr :: MD4 -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MD4
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MD4
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MD4 -> c MD4
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MD4 -> c 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 = forall a. Ptr (Context a) -> IO ()
c_md4_init
hashInternalUpdate :: Ptr (Context MD4) -> Ptr Word8 -> Word32 -> IO ()
hashInternalUpdate = forall a. Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()
c_md4_update
hashInternalFinalize :: Ptr (Context MD4) -> Ptr (Digest MD4) -> IO ()
hashInternalFinalize = 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 ()