{-# LINE 1 "Bindings/Nettle/Hash/SHA3.hsc" #-} {-# LANGUAGE ForeignFunctionInterface #-} module Bindings.Nettle.Hash.SHA3 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/SHA3.hsc" #-} c'SHA3_256_DIGEST_SIZE = 32 c'SHA3_256_DIGEST_SIZE :: (Num a) => a {-# LINE 10 "Bindings/Nettle/Hash/SHA3.hsc" #-} c'SHA3_256_DATA_SIZE = 136 c'SHA3_256_DATA_SIZE :: (Num a) => a {-# LINE 11 "Bindings/Nettle/Hash/SHA3.hsc" #-} {-# LINE 13 "Bindings/Nettle/Hash/SHA3.hsc" #-} data C'sha3_256_ctx = C'sha3_256_ctx{ } deriving (Eq,Show) instance Storable C'sha3_256_ctx where sizeOf _ = 344 alignment _ = 8 peek _p = do return $ C'sha3_256_ctx poke _p (C'sha3_256_ctx) = do return () {-# LINE 14 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_256_init" c'nettle_sha3_256_init :: Ptr C'sha3_256_ctx -> IO () foreign import ccall "&nettle_sha3_256_init" p'nettle_sha3_256_init :: FunPtr (Ptr C'sha3_256_ctx -> IO ()) {-# LINE 16 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_256_update" c'nettle_sha3_256_update :: Ptr C'sha3_256_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha3_256_update" p'nettle_sha3_256_update :: FunPtr (Ptr C'sha3_256_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 17 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_256_digest" c'nettle_sha3_256_digest :: Ptr C'sha3_256_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha3_256_digest" p'nettle_sha3_256_digest :: FunPtr (Ptr C'sha3_256_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 18 "Bindings/Nettle/Hash/SHA3.hsc" #-} c'SHA3_224_DIGEST_SIZE = 28 c'SHA3_224_DIGEST_SIZE :: (Num a) => a {-# LINE 21 "Bindings/Nettle/Hash/SHA3.hsc" #-} c'SHA3_224_DATA_SIZE = 144 c'SHA3_224_DATA_SIZE :: (Num a) => a {-# LINE 22 "Bindings/Nettle/Hash/SHA3.hsc" #-} {-# LINE 24 "Bindings/Nettle/Hash/SHA3.hsc" #-} data C'sha3_224_ctx = C'sha3_224_ctx{ } deriving (Eq,Show) instance Storable C'sha3_224_ctx where sizeOf _ = 352 alignment _ = 8 peek _p = do return $ C'sha3_224_ctx poke _p (C'sha3_224_ctx) = do return () {-# LINE 25 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_224_init" c'nettle_sha3_224_init :: Ptr C'sha3_224_ctx -> IO () foreign import ccall "&nettle_sha3_224_init" p'nettle_sha3_224_init :: FunPtr (Ptr C'sha3_224_ctx -> IO ()) {-# LINE 27 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_224_update" c'nettle_sha3_224_update :: Ptr C'sha3_224_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha3_224_update" p'nettle_sha3_224_update :: FunPtr (Ptr C'sha3_224_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 28 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_224_digest" c'nettle_sha3_224_digest :: Ptr C'sha3_224_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha3_224_digest" p'nettle_sha3_224_digest :: FunPtr (Ptr C'sha3_224_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 29 "Bindings/Nettle/Hash/SHA3.hsc" #-} c'SHA3_512_DIGEST_SIZE = 64 c'SHA3_512_DIGEST_SIZE :: (Num a) => a {-# LINE 32 "Bindings/Nettle/Hash/SHA3.hsc" #-} c'SHA3_512_DATA_SIZE = 72 c'SHA3_512_DATA_SIZE :: (Num a) => a {-# LINE 33 "Bindings/Nettle/Hash/SHA3.hsc" #-} {-# LINE 35 "Bindings/Nettle/Hash/SHA3.hsc" #-} data C'sha3_512_ctx = C'sha3_512_ctx{ } deriving (Eq,Show) instance Storable C'sha3_512_ctx where sizeOf _ = 280 alignment _ = 8 peek _p = do return $ C'sha3_512_ctx poke _p (C'sha3_512_ctx) = do return () {-# LINE 36 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_512_init" c'nettle_sha3_512_init :: Ptr C'sha3_512_ctx -> IO () foreign import ccall "&nettle_sha3_512_init" p'nettle_sha3_512_init :: FunPtr (Ptr C'sha3_512_ctx -> IO ()) {-# LINE 38 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_512_update" c'nettle_sha3_512_update :: Ptr C'sha3_512_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha3_512_update" p'nettle_sha3_512_update :: FunPtr (Ptr C'sha3_512_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 39 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_512_digest" c'nettle_sha3_512_digest :: Ptr C'sha3_512_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha3_512_digest" p'nettle_sha3_512_digest :: FunPtr (Ptr C'sha3_512_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 40 "Bindings/Nettle/Hash/SHA3.hsc" #-} c'SHA3_384_DIGEST_SIZE = 48 c'SHA3_384_DIGEST_SIZE :: (Num a) => a {-# LINE 43 "Bindings/Nettle/Hash/SHA3.hsc" #-} c'SHA3_384_DATA_SIZE = 104 c'SHA3_384_DATA_SIZE :: (Num a) => a {-# LINE 44 "Bindings/Nettle/Hash/SHA3.hsc" #-} {-# LINE 46 "Bindings/Nettle/Hash/SHA3.hsc" #-} data C'sha3_384_ctx = C'sha3_384_ctx{ } deriving (Eq,Show) instance Storable C'sha3_384_ctx where sizeOf _ = 312 alignment _ = 8 peek _p = do return $ C'sha3_384_ctx poke _p (C'sha3_384_ctx) = do return () {-# LINE 47 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_384_init" c'nettle_sha3_384_init :: Ptr C'sha3_384_ctx -> IO () foreign import ccall "&nettle_sha3_384_init" p'nettle_sha3_384_init :: FunPtr (Ptr C'sha3_384_ctx -> IO ()) {-# LINE 49 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_384_update" c'nettle_sha3_384_update :: Ptr C'sha3_384_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha3_384_update" p'nettle_sha3_384_update :: FunPtr (Ptr C'sha3_384_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 50 "Bindings/Nettle/Hash/SHA3.hsc" #-} foreign import ccall "nettle_sha3_384_digest" c'nettle_sha3_384_digest :: Ptr C'sha3_384_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_sha3_384_digest" p'nettle_sha3_384_digest :: FunPtr (Ptr C'sha3_384_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 51 "Bindings/Nettle/Hash/SHA3.hsc" #-}