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