{-# LINE 1 "Bindings/Nettle/Hash/SHA2.hsc" #-} {-# LANGUAGE ForeignFunctionInterface #-} module Bindings.Nettle.Hash.SHA2 where import Foreign.Ptr (Ptr,FunPtr,plusPtr) import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr) import Foreign.Storable import Foreign.C.Types import Foreign.C.String (CString,CStringLen,CWString,CWStringLen) import Foreign.Marshal.Alloc (alloca) import Foreign.Marshal.Array (peekArray,pokeArray) import Data.Int import Data.Word {-# LINE 8 "Bindings/Nettle/Hash/SHA2.hsc" #-} c'SHA256_DIGEST_SIZE = 32 c'SHA256_DIGEST_SIZE :: (Num a) => a {-# LINE 10 "Bindings/Nettle/Hash/SHA2.hsc" #-} c'SHA256_DATA_SIZE = 64 c'SHA256_DATA_SIZE :: (Num a) => a {-# LINE 11 "Bindings/Nettle/Hash/SHA2.hsc" #-} {-# LINE 13 "Bindings/Nettle/Hash/SHA2.hsc" #-} data C'sha256_ctx = C'sha256_ctx{ } deriving (Eq,Show) instance Storable C'sha256_ctx where sizeOf _ = 112 alignment _ = 8 peek _p = do return $ C'sha256_ctx poke _p (C'sha256_ctx) = do return () {-# LINE 14 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha256_init" c'nettle_sha256_init :: Ptr C'sha256_ctx -> IO () foreign import ccall "&nettle_sha256_init" p'nettle_sha256_init :: FunPtr (Ptr C'sha256_ctx -> IO ()) {-# LINE 16 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha256_update" c'nettle_sha256_update :: Ptr C'sha256_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha256_update" p'nettle_sha256_update :: FunPtr (Ptr C'sha256_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 17 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha256_digest" c'nettle_sha256_digest :: Ptr C'sha256_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha256_digest" p'nettle_sha256_digest :: FunPtr (Ptr C'sha256_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 18 "Bindings/Nettle/Hash/SHA2.hsc" #-} c'SHA224_DIGEST_SIZE = 28 c'SHA224_DIGEST_SIZE :: (Num a) => a {-# LINE 21 "Bindings/Nettle/Hash/SHA2.hsc" #-} c'SHA224_DATA_SIZE = 64 c'SHA224_DATA_SIZE :: (Num a) => a {-# LINE 22 "Bindings/Nettle/Hash/SHA2.hsc" #-} {-# LINE 24 "Bindings/Nettle/Hash/SHA2.hsc" #-} data C'sha224_ctx = C'sha224_ctx{ } deriving (Eq,Show) instance Storable C'sha224_ctx where sizeOf _ = 112 alignment _ = 8 peek _p = do return $ C'sha224_ctx poke _p (C'sha224_ctx) = do return () {-# LINE 25 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha224_init" c'nettle_sha224_init :: Ptr C'sha256_ctx -> IO () foreign import ccall "&nettle_sha224_init" p'nettle_sha224_init :: FunPtr (Ptr C'sha256_ctx -> IO ()) {-# LINE 27 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha224_digest" c'nettle_sha224_digest :: Ptr C'sha256_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha224_digest" p'nettle_sha224_digest :: FunPtr (Ptr C'sha256_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 28 "Bindings/Nettle/Hash/SHA2.hsc" #-} c'SHA512_DIGEST_SIZE = 64 c'SHA512_DIGEST_SIZE :: (Num a) => a {-# LINE 31 "Bindings/Nettle/Hash/SHA2.hsc" #-} c'SHA512_DATA_SIZE = 128 c'SHA512_DATA_SIZE :: (Num a) => a {-# LINE 32 "Bindings/Nettle/Hash/SHA2.hsc" #-} {-# LINE 34 "Bindings/Nettle/Hash/SHA2.hsc" #-} data C'sha512_ctx = C'sha512_ctx{ } deriving (Eq,Show) instance Storable C'sha512_ctx where sizeOf _ = 216 alignment _ = 8 peek _p = do return $ C'sha512_ctx poke _p (C'sha512_ctx) = do return () {-# LINE 35 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha512_init" c'nettle_sha512_init :: Ptr C'sha512_ctx -> IO () foreign import ccall "&nettle_sha512_init" p'nettle_sha512_init :: FunPtr (Ptr C'sha512_ctx -> IO ()) {-# LINE 37 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha512_update" c'nettle_sha512_update :: Ptr C'sha512_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha512_update" p'nettle_sha512_update :: FunPtr (Ptr C'sha512_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 38 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha512_digest" c'nettle_sha512_digest :: Ptr C'sha512_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha512_digest" p'nettle_sha512_digest :: FunPtr (Ptr C'sha512_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 39 "Bindings/Nettle/Hash/SHA2.hsc" #-} c'SHA384_DIGEST_SIZE = 48 c'SHA384_DIGEST_SIZE :: (Num a) => a {-# LINE 42 "Bindings/Nettle/Hash/SHA2.hsc" #-} c'SHA384_DATA_SIZE = 128 c'SHA384_DATA_SIZE :: (Num a) => a {-# LINE 43 "Bindings/Nettle/Hash/SHA2.hsc" #-} {-# LINE 45 "Bindings/Nettle/Hash/SHA2.hsc" #-} data C'sha384_ctx = C'sha384_ctx{ } deriving (Eq,Show) instance Storable C'sha384_ctx where sizeOf _ = 216 alignment _ = 8 peek _p = do return $ C'sha384_ctx poke _p (C'sha384_ctx) = do return () {-# LINE 46 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha384_init" c'nettle_sha384_init :: Ptr C'sha512_ctx -> IO () foreign import ccall "&nettle_sha384_init" p'nettle_sha384_init :: FunPtr (Ptr C'sha512_ctx -> IO ()) {-# LINE 48 "Bindings/Nettle/Hash/SHA2.hsc" #-} foreign import ccall "nettle_sha384_digest" c'nettle_sha384_digest :: Ptr C'sha512_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha384_digest" p'nettle_sha384_digest :: FunPtr (Ptr C'sha512_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 49 "Bindings/Nettle/Hash/SHA2.hsc" #-}