{-# LINE 1 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} {-# LANGUAGE ForeignFunctionInterface #-} module Bindings.Nettle.Cipher.ChaChaPoly1305 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/Cipher/ChaChaPoly1305.hsc" #-} c'CHACHA_POLY1305_BLOCK_SIZE = 64 c'CHACHA_POLY1305_BLOCK_SIZE :: (Num a) => a {-# LINE 10 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} c'CHACHA_POLY1305_KEY_SIZE = 32 c'CHACHA_POLY1305_KEY_SIZE :: (Num a) => a {-# LINE 11 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} c'CHACHA_POLY1305_NONCE_SIZE = 12 c'CHACHA_POLY1305_NONCE_SIZE :: (Num a) => a {-# LINE 12 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} c'CHACHA_POLY1305_DIGEST_SIZE = 16 c'CHACHA_POLY1305_DIGEST_SIZE :: (Num a) => a {-# LINE 13 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} {-# LINE 15 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} data C'chacha_poly1305_ctx = C'chacha_poly1305_ctx{ } deriving (Eq,Show) instance Storable C'chacha_poly1305_ctx where sizeOf _ = 176 alignment _ = 8 peek _p = do return $ C'chacha_poly1305_ctx poke _p (C'chacha_poly1305_ctx) = do return () {-# LINE 16 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} foreign import ccall "nettle_chacha_poly1305_set_key" c'nettle_chacha_poly1305_set_key :: Ptr C'chacha_poly1305_ctx -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_poly1305_set_key" p'nettle_chacha_poly1305_set_key :: FunPtr (Ptr C'chacha_poly1305_ctx -> Ptr CUChar -> IO ()) {-# LINE 18 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} foreign import ccall "nettle_chacha_poly1305_set_nonce" c'nettle_chacha_poly1305_set_nonce :: Ptr C'chacha_poly1305_ctx -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_poly1305_set_nonce" p'nettle_chacha_poly1305_set_nonce :: FunPtr (Ptr C'chacha_poly1305_ctx -> Ptr CUChar -> IO ()) {-# LINE 19 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} foreign import ccall "nettle_chacha_poly1305_update" c'nettle_chacha_poly1305_update :: Ptr C'chacha_poly1305_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_poly1305_update" p'nettle_chacha_poly1305_update :: FunPtr (Ptr C'chacha_poly1305_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 20 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} foreign import ccall "nettle_chacha_poly1305_encrypt" c'nettle_chacha_poly1305_encrypt :: Ptr C'chacha_poly1305_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_poly1305_encrypt" p'nettle_chacha_poly1305_encrypt :: FunPtr (Ptr C'chacha_poly1305_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO ()) {-# LINE 21 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} foreign import ccall "nettle_chacha_poly1305_decrypt" c'nettle_chacha_poly1305_decrypt :: Ptr C'chacha_poly1305_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_poly1305_decrypt" p'nettle_chacha_poly1305_decrypt :: FunPtr (Ptr C'chacha_poly1305_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO ()) {-# LINE 22 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-} foreign import ccall "nettle_chacha_poly1305_digest" c'nettle_chacha_poly1305_digest :: Ptr C'chacha_poly1305_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_poly1305_digest" p'nettle_chacha_poly1305_digest :: FunPtr (Ptr C'chacha_poly1305_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 23 "Bindings/Nettle/Cipher/ChaChaPoly1305.hsc" #-}