{-# LINE 1 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} {-# LANGUAGE ForeignFunctionInterface #-} module Bindings.Nettle.Cipher.ChaCha 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/ChaCha.hsc" #-} c'CHACHA_KEY_SIZE = 32 c'CHACHA_KEY_SIZE :: (Num a) => a {-# LINE 10 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} c'CHACHA_BLOCK_SIZE = 64 c'CHACHA_BLOCK_SIZE :: (Num a) => a {-# LINE 11 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} c'CHACHA_NONCE_SIZE = 8 c'CHACHA_NONCE_SIZE :: (Num a) => a {-# LINE 12 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} c'CHACHA_NONCE96_SIZE = 12 c'CHACHA_NONCE96_SIZE :: (Num a) => a {-# LINE 13 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} {-# LINE 15 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} data C'chacha_ctx = C'chacha_ctx{ } deriving (Eq,Show) instance Storable C'chacha_ctx where sizeOf _ = 64 alignment _ = 4 peek _p = do return $ C'chacha_ctx poke _p (C'chacha_ctx) = do return () {-# LINE 16 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} foreign import ccall "nettle_chacha_set_key" c'nettle_chacha_set_key :: Ptr C'chacha_ctx -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_set_key" p'nettle_chacha_set_key :: FunPtr (Ptr C'chacha_ctx -> Ptr CUChar -> IO ()) {-# LINE 18 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} foreign import ccall "nettle_chacha_set_nonce" c'nettle_chacha_set_nonce :: Ptr C'chacha_ctx -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_set_nonce" p'nettle_chacha_set_nonce :: FunPtr (Ptr C'chacha_ctx -> Ptr CUChar -> IO ()) {-# LINE 19 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} foreign import ccall "nettle_chacha_set_nonce96" c'nettle_chacha_set_nonce96 :: Ptr C'chacha_ctx -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_set_nonce96" p'nettle_chacha_set_nonce96 :: FunPtr (Ptr C'chacha_ctx -> Ptr CUChar -> IO ()) {-# LINE 20 "Bindings/Nettle/Cipher/ChaCha.hsc" #-} foreign import ccall "nettle_chacha_crypt" c'nettle_chacha_crypt :: Ptr C'chacha_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO () foreign import ccall "&nettle_chacha_crypt" p'nettle_chacha_crypt :: FunPtr (Ptr C'chacha_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO ()) {-# LINE 21 "Bindings/Nettle/Cipher/ChaCha.hsc" #-}