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