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