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