-- |
-- Module      : Crypto.Hash.Skein512
-- License     : BSD-style
-- Maintainer  : Vincent Hanquez <vincent@snarc.org>
-- Stability   : experimental
-- Portability : unknown
--
-- Module containing the binding functions to work with the
-- Skein512 cryptographic hash.
--
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module Crypto.Hash.Skein512
    (  Skein512_224 (..), Skein512_256 (..), Skein512_384 (..), Skein512_512 (..)
    ) where

import           Crypto.Hash.Types
import           Foreign.Ptr (Ptr)
import           Data.Data
import           Data.Word (Word8, Word32)


-- | Skein512 (224 bits) cryptographic hash algorithm
data Skein512_224 = Skein512_224
    deriving (Int -> Skein512_224 -> ShowS
[Skein512_224] -> ShowS
Skein512_224 -> String
(Int -> Skein512_224 -> ShowS)
-> (Skein512_224 -> String)
-> ([Skein512_224] -> ShowS)
-> Show Skein512_224
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Skein512_224 -> ShowS
showsPrec :: Int -> Skein512_224 -> ShowS
$cshow :: Skein512_224 -> String
show :: Skein512_224 -> String
$cshowList :: [Skein512_224] -> ShowS
showList :: [Skein512_224] -> ShowS
Show,Typeable Skein512_224
Typeable Skein512_224 =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Skein512_224 -> c Skein512_224)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Skein512_224)
-> (Skein512_224 -> Constr)
-> (Skein512_224 -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Skein512_224))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Skein512_224))
-> ((forall b. Data b => b -> b) -> Skein512_224 -> Skein512_224)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Skein512_224 -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Skein512_224 -> r)
-> (forall u. (forall d. Data d => d -> u) -> Skein512_224 -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Skein512_224 -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224)
-> Data Skein512_224
Skein512_224 -> Constr
Skein512_224 -> DataType
(forall b. Data b => b -> b) -> Skein512_224 -> Skein512_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) -> Skein512_224 -> u
forall u. (forall d. Data d => d -> u) -> Skein512_224 -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_224 -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_224 -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_224
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_224 -> c Skein512_224
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_224)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_224)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_224 -> c Skein512_224
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_224 -> c Skein512_224
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_224
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_224
$ctoConstr :: Skein512_224 -> Constr
toConstr :: Skein512_224 -> Constr
$cdataTypeOf :: Skein512_224 -> DataType
dataTypeOf :: Skein512_224 -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_224)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_224)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_224)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_224)
$cgmapT :: (forall b. Data b => b -> b) -> Skein512_224 -> Skein512_224
gmapT :: (forall b. Data b => b -> b) -> Skein512_224 -> Skein512_224
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_224 -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_224 -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_224 -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_224 -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Skein512_224 -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Skein512_224 -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Skein512_224 -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Skein512_224 -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_224 -> m Skein512_224
Data)

instance HashAlgorithm Skein512_224 where
    type HashBlockSize           Skein512_224 = 64
    type HashDigestSize          Skein512_224 = 28
    type HashInternalContextSize Skein512_224 = 160
    hashBlockSize :: Skein512_224 -> Int
hashBlockSize  Skein512_224
_          = Int
64
    hashDigestSize :: Skein512_224 -> Int
hashDigestSize Skein512_224
_          = Int
28
    hashInternalContextSize :: Skein512_224 -> Int
hashInternalContextSize Skein512_224
_ = Int
160
    hashInternalInit :: Ptr (Context Skein512_224) -> IO ()
hashInternalInit Ptr (Context Skein512_224)
p        = Ptr (Context Skein512_224) -> Word32 -> IO ()
forall a. Ptr (Context a) -> Word32 -> IO ()
c_skein512_init Ptr (Context Skein512_224)
p Word32
224
    hashInternalUpdate :: Ptr (Context Skein512_224) -> Ptr Word8 -> Word32 -> IO ()
hashInternalUpdate        = Ptr (Context Skein512_224) -> Ptr Word8 -> Word32 -> IO ()
forall a. Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()
c_skein512_update
    hashInternalFinalize :: Ptr (Context Skein512_224) -> Ptr (Digest Skein512_224) -> IO ()
hashInternalFinalize Ptr (Context Skein512_224)
p    = Ptr (Context Skein512_224)
-> Word32 -> Ptr (Digest Skein512_224) -> IO ()
forall a. Ptr (Context a) -> Word32 -> Ptr (Digest a) -> IO ()
c_skein512_finalize Ptr (Context Skein512_224)
p Word32
224

-- | Skein512 (256 bits) cryptographic hash algorithm
data Skein512_256 = Skein512_256
    deriving (Int -> Skein512_256 -> ShowS
[Skein512_256] -> ShowS
Skein512_256 -> String
(Int -> Skein512_256 -> ShowS)
-> (Skein512_256 -> String)
-> ([Skein512_256] -> ShowS)
-> Show Skein512_256
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Skein512_256 -> ShowS
showsPrec :: Int -> Skein512_256 -> ShowS
$cshow :: Skein512_256 -> String
show :: Skein512_256 -> String
$cshowList :: [Skein512_256] -> ShowS
showList :: [Skein512_256] -> ShowS
Show,Typeable Skein512_256
Typeable Skein512_256 =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Skein512_256 -> c Skein512_256)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Skein512_256)
-> (Skein512_256 -> Constr)
-> (Skein512_256 -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Skein512_256))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Skein512_256))
-> ((forall b. Data b => b -> b) -> Skein512_256 -> Skein512_256)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Skein512_256 -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Skein512_256 -> r)
-> (forall u. (forall d. Data d => d -> u) -> Skein512_256 -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Skein512_256 -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256)
-> Data Skein512_256
Skein512_256 -> Constr
Skein512_256 -> DataType
(forall b. Data b => b -> b) -> Skein512_256 -> Skein512_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) -> Skein512_256 -> u
forall u. (forall d. Data d => d -> u) -> Skein512_256 -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_256 -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_256 -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_256
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_256 -> c Skein512_256
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_256)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_256)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_256 -> c Skein512_256
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_256 -> c Skein512_256
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_256
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_256
$ctoConstr :: Skein512_256 -> Constr
toConstr :: Skein512_256 -> Constr
$cdataTypeOf :: Skein512_256 -> DataType
dataTypeOf :: Skein512_256 -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_256)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_256)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_256)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_256)
$cgmapT :: (forall b. Data b => b -> b) -> Skein512_256 -> Skein512_256
gmapT :: (forall b. Data b => b -> b) -> Skein512_256 -> Skein512_256
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_256 -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_256 -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_256 -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_256 -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Skein512_256 -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Skein512_256 -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Skein512_256 -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Skein512_256 -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_256 -> m Skein512_256
Data)

instance HashAlgorithm Skein512_256 where
    type HashBlockSize           Skein512_256 = 64
    type HashDigestSize          Skein512_256 = 32
    type HashInternalContextSize Skein512_256 = 160
    hashBlockSize :: Skein512_256 -> Int
hashBlockSize  Skein512_256
_          = Int
64
    hashDigestSize :: Skein512_256 -> Int
hashDigestSize Skein512_256
_          = Int
32
    hashInternalContextSize :: Skein512_256 -> Int
hashInternalContextSize Skein512_256
_ = Int
160
    hashInternalInit :: Ptr (Context Skein512_256) -> IO ()
hashInternalInit Ptr (Context Skein512_256)
p        = Ptr (Context Skein512_256) -> Word32 -> IO ()
forall a. Ptr (Context a) -> Word32 -> IO ()
c_skein512_init Ptr (Context Skein512_256)
p Word32
256
    hashInternalUpdate :: Ptr (Context Skein512_256) -> Ptr Word8 -> Word32 -> IO ()
hashInternalUpdate        = Ptr (Context Skein512_256) -> Ptr Word8 -> Word32 -> IO ()
forall a. Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()
c_skein512_update
    hashInternalFinalize :: Ptr (Context Skein512_256) -> Ptr (Digest Skein512_256) -> IO ()
hashInternalFinalize Ptr (Context Skein512_256)
p    = Ptr (Context Skein512_256)
-> Word32 -> Ptr (Digest Skein512_256) -> IO ()
forall a. Ptr (Context a) -> Word32 -> Ptr (Digest a) -> IO ()
c_skein512_finalize Ptr (Context Skein512_256)
p Word32
256

-- | Skein512 (384 bits) cryptographic hash algorithm
data Skein512_384 = Skein512_384
    deriving (Int -> Skein512_384 -> ShowS
[Skein512_384] -> ShowS
Skein512_384 -> String
(Int -> Skein512_384 -> ShowS)
-> (Skein512_384 -> String)
-> ([Skein512_384] -> ShowS)
-> Show Skein512_384
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Skein512_384 -> ShowS
showsPrec :: Int -> Skein512_384 -> ShowS
$cshow :: Skein512_384 -> String
show :: Skein512_384 -> String
$cshowList :: [Skein512_384] -> ShowS
showList :: [Skein512_384] -> ShowS
Show,Typeable Skein512_384
Typeable Skein512_384 =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Skein512_384 -> c Skein512_384)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Skein512_384)
-> (Skein512_384 -> Constr)
-> (Skein512_384 -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Skein512_384))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Skein512_384))
-> ((forall b. Data b => b -> b) -> Skein512_384 -> Skein512_384)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Skein512_384 -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Skein512_384 -> r)
-> (forall u. (forall d. Data d => d -> u) -> Skein512_384 -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Skein512_384 -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384)
-> Data Skein512_384
Skein512_384 -> Constr
Skein512_384 -> DataType
(forall b. Data b => b -> b) -> Skein512_384 -> Skein512_384
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) -> Skein512_384 -> u
forall u. (forall d. Data d => d -> u) -> Skein512_384 -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_384 -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_384 -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_384
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_384 -> c Skein512_384
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_384)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_384)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_384 -> c Skein512_384
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_384 -> c Skein512_384
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_384
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_384
$ctoConstr :: Skein512_384 -> Constr
toConstr :: Skein512_384 -> Constr
$cdataTypeOf :: Skein512_384 -> DataType
dataTypeOf :: Skein512_384 -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_384)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_384)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_384)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_384)
$cgmapT :: (forall b. Data b => b -> b) -> Skein512_384 -> Skein512_384
gmapT :: (forall b. Data b => b -> b) -> Skein512_384 -> Skein512_384
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_384 -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_384 -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_384 -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_384 -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Skein512_384 -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Skein512_384 -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Skein512_384 -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Skein512_384 -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_384 -> m Skein512_384
Data)

instance HashAlgorithm Skein512_384 where
    type HashBlockSize           Skein512_384 = 64
    type HashDigestSize          Skein512_384 = 48
    type HashInternalContextSize Skein512_384 = 160
    hashBlockSize :: Skein512_384 -> Int
hashBlockSize  Skein512_384
_          = Int
64
    hashDigestSize :: Skein512_384 -> Int
hashDigestSize Skein512_384
_          = Int
48
    hashInternalContextSize :: Skein512_384 -> Int
hashInternalContextSize Skein512_384
_ = Int
160
    hashInternalInit :: Ptr (Context Skein512_384) -> IO ()
hashInternalInit Ptr (Context Skein512_384)
p        = Ptr (Context Skein512_384) -> Word32 -> IO ()
forall a. Ptr (Context a) -> Word32 -> IO ()
c_skein512_init Ptr (Context Skein512_384)
p Word32
384
    hashInternalUpdate :: Ptr (Context Skein512_384) -> Ptr Word8 -> Word32 -> IO ()
hashInternalUpdate        = Ptr (Context Skein512_384) -> Ptr Word8 -> Word32 -> IO ()
forall a. Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()
c_skein512_update
    hashInternalFinalize :: Ptr (Context Skein512_384) -> Ptr (Digest Skein512_384) -> IO ()
hashInternalFinalize Ptr (Context Skein512_384)
p    = Ptr (Context Skein512_384)
-> Word32 -> Ptr (Digest Skein512_384) -> IO ()
forall a. Ptr (Context a) -> Word32 -> Ptr (Digest a) -> IO ()
c_skein512_finalize Ptr (Context Skein512_384)
p Word32
384

-- | Skein512 (512 bits) cryptographic hash algorithm
data Skein512_512 = Skein512_512
    deriving (Int -> Skein512_512 -> ShowS
[Skein512_512] -> ShowS
Skein512_512 -> String
(Int -> Skein512_512 -> ShowS)
-> (Skein512_512 -> String)
-> ([Skein512_512] -> ShowS)
-> Show Skein512_512
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Skein512_512 -> ShowS
showsPrec :: Int -> Skein512_512 -> ShowS
$cshow :: Skein512_512 -> String
show :: Skein512_512 -> String
$cshowList :: [Skein512_512] -> ShowS
showList :: [Skein512_512] -> ShowS
Show,Typeable Skein512_512
Typeable Skein512_512 =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Skein512_512 -> c Skein512_512)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Skein512_512)
-> (Skein512_512 -> Constr)
-> (Skein512_512 -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Skein512_512))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Skein512_512))
-> ((forall b. Data b => b -> b) -> Skein512_512 -> Skein512_512)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Skein512_512 -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Skein512_512 -> r)
-> (forall u. (forall d. Data d => d -> u) -> Skein512_512 -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Skein512_512 -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512)
-> Data Skein512_512
Skein512_512 -> Constr
Skein512_512 -> DataType
(forall b. Data b => b -> b) -> Skein512_512 -> Skein512_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) -> Skein512_512 -> u
forall u. (forall d. Data d => d -> u) -> Skein512_512 -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_512 -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_512 -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_512
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_512 -> c Skein512_512
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_512)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_512)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_512 -> c Skein512_512
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Skein512_512 -> c Skein512_512
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_512
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Skein512_512
$ctoConstr :: Skein512_512 -> Constr
toConstr :: Skein512_512 -> Constr
$cdataTypeOf :: Skein512_512 -> DataType
dataTypeOf :: Skein512_512 -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_512)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Skein512_512)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_512)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Skein512_512)
$cgmapT :: (forall b. Data b => b -> b) -> Skein512_512 -> Skein512_512
gmapT :: (forall b. Data b => b -> b) -> Skein512_512 -> Skein512_512
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_512 -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_512 -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_512 -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Skein512_512 -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Skein512_512 -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Skein512_512 -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Skein512_512 -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Skein512_512 -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Skein512_512 -> m Skein512_512
Data)

instance HashAlgorithm Skein512_512 where
    type HashBlockSize           Skein512_512 = 64
    type HashDigestSize          Skein512_512 = 64
    type HashInternalContextSize Skein512_512 = 160
    hashBlockSize :: Skein512_512 -> Int
hashBlockSize  Skein512_512
_          = Int
64
    hashDigestSize :: Skein512_512 -> Int
hashDigestSize Skein512_512
_          = Int
64
    hashInternalContextSize :: Skein512_512 -> Int
hashInternalContextSize Skein512_512
_ = Int
160
    hashInternalInit :: Ptr (Context Skein512_512) -> IO ()
hashInternalInit Ptr (Context Skein512_512)
p        = Ptr (Context Skein512_512) -> Word32 -> IO ()
forall a. Ptr (Context a) -> Word32 -> IO ()
c_skein512_init Ptr (Context Skein512_512)
p Word32
512
    hashInternalUpdate :: Ptr (Context Skein512_512) -> Ptr Word8 -> Word32 -> IO ()
hashInternalUpdate        = Ptr (Context Skein512_512) -> Ptr Word8 -> Word32 -> IO ()
forall a. Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()
c_skein512_update
    hashInternalFinalize :: Ptr (Context Skein512_512) -> Ptr (Digest Skein512_512) -> IO ()
hashInternalFinalize Ptr (Context Skein512_512)
p    = Ptr (Context Skein512_512)
-> Word32 -> Ptr (Digest Skein512_512) -> IO ()
forall a. Ptr (Context a) -> Word32 -> Ptr (Digest a) -> IO ()
c_skein512_finalize Ptr (Context Skein512_512)
p Word32
512


foreign import ccall unsafe "crypton_skein512_init"
    c_skein512_init :: Ptr (Context a) -> Word32 -> IO ()

foreign import ccall "crypton_skein512_update"
    c_skein512_update :: Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()

foreign import ccall unsafe "crypton_skein512_finalize"
    c_skein512_finalize :: Ptr (Context a) -> Word32 -> Ptr (Digest a) -> IO ()