{-# LANGUAGE ForeignFunctionInterface #-}
module Raaz.Hash.Sha512.Implementation.CPortable
( implementation, cPortable
) where
import Foreign.Ptr ( Ptr )
import Raaz.Core
import Raaz.Hash.Internal
import Raaz.Hash.Sha.Util
import Raaz.Hash.Sha512.Internal
implementation :: Implementation SHA512
implementation :: Implementation SHA512
implementation = HashI SHA512 (HashMemory SHA512) -> SomeHashI SHA512
forall h m. HashM h m => HashI h m -> SomeHashI h
SomeHashI HashI SHA512 (HashMemory SHA512)
cPortable
cPortable :: HashI SHA512 (HashMemory SHA512)
cPortable :: HashI SHA512 (HashMemory SHA512)
cPortable = String
-> String
-> Compressor SHA512
-> LengthWrite SHA512
-> HashI SHA512 (HashMemory SHA512)
forall h.
IsSha h =>
String
-> String
-> Compressor h
-> LengthWrite h
-> HashI h (HashMemory h)
shaImplementation
String
"sha512-cportable"
String
"Sha512 Implementation using portable C and Haskell FFI"
Compressor SHA512
c_sha512_compress LengthWrite SHA512
forall h. LengthWrite h
length128Write
foreign import ccall unsafe
"raaz/hash/sha512/portable.h raazHashSha512PortableCompress"
c_sha512_compress :: Pointer -> Int -> Ptr SHA512 -> IO ()