{-# LINE 1 "Bindings/Nettle/Cipher/Twofish.hsc" #-} {-# LANGUAGE ForeignFunctionInterface #-} module Bindings.Nettle.Cipher.Twofish 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/Twofish.hsc" #-} c'TWOFISH_BLOCK_SIZE = 16 c'TWOFISH_BLOCK_SIZE :: (Num a) => a {-# LINE 10 "Bindings/Nettle/Cipher/Twofish.hsc" #-} c'TWOFISH_MIN_KEY_SIZE = 16 c'TWOFISH_MIN_KEY_SIZE :: (Num a) => a {-# LINE 11 "Bindings/Nettle/Cipher/Twofish.hsc" #-} c'TWOFISH_MAX_KEY_SIZE = 32 c'TWOFISH_MAX_KEY_SIZE :: (Num a) => a {-# LINE 12 "Bindings/Nettle/Cipher/Twofish.hsc" #-} c'TWOFISH_KEY_SIZE = 32 c'TWOFISH_KEY_SIZE :: (Num a) => a {-# LINE 13 "Bindings/Nettle/Cipher/Twofish.hsc" #-} {-# LINE 15 "Bindings/Nettle/Cipher/Twofish.hsc" #-} data C'twofish_ctx = C'twofish_ctx{ } deriving (Eq,Show) instance Storable C'twofish_ctx where sizeOf _ = 4256 alignment _ = 4 peek _p = do return $ C'twofish_ctx poke _p (C'twofish_ctx) = do return () {-# LINE 16 "Bindings/Nettle/Cipher/Twofish.hsc" #-} foreign import ccall "nettle_twofish_set_key" c'nettle_twofish_set_key :: Ptr C'twofish_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_twofish_set_key" p'nettle_twofish_set_key :: FunPtr (Ptr C'twofish_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 18 "Bindings/Nettle/Cipher/Twofish.hsc" #-} foreign import ccall "nettle_twofish_encrypt" c'nettle_twofish_encrypt :: Ptr C'twofish_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO () foreign import ccall "&nettle_twofish_encrypt" p'nettle_twofish_encrypt :: FunPtr (Ptr C'twofish_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO ()) {-# LINE 19 "Bindings/Nettle/Cipher/Twofish.hsc" #-} foreign import ccall "nettle_twofish_decrypt" c'nettle_twofish_decrypt :: Ptr C'twofish_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO () foreign import ccall "&nettle_twofish_decrypt" p'nettle_twofish_decrypt :: FunPtr (Ptr C'twofish_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO ()) {-# LINE 20 "Bindings/Nettle/Cipher/Twofish.hsc" #-}