{-# LINE 1 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} {-# LANGUAGE ForeignFunctionInterface #-} module Bindings.Nettle.Cipher.Blowfish 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/Blowfish.hsc" #-} c'BLOWFISH_BLOCK_SIZE = 8 c'BLOWFISH_BLOCK_SIZE :: (Num a) => a {-# LINE 10 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} c'BLOWFISH_MIN_KEY_SIZE = 8 c'BLOWFISH_MIN_KEY_SIZE :: (Num a) => a {-# LINE 11 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} c'BLOWFISH_MAX_KEY_SIZE = 56 c'BLOWFISH_MAX_KEY_SIZE :: (Num a) => a {-# LINE 12 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} c'BLOWFISH_KEY_SIZE = 16 c'BLOWFISH_KEY_SIZE :: (Num a) => a {-# LINE 13 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} {-# LINE 15 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} data C'blowfish_ctx = C'blowfish_ctx{ } deriving (Eq,Show) instance Storable C'blowfish_ctx where sizeOf _ = 4168 alignment _ = 4 peek _p = do return $ C'blowfish_ctx poke _p (C'blowfish_ctx) = do return () {-# LINE 16 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} foreign import ccall "nettle_blowfish_set_key" c'nettle_blowfish_set_key :: Ptr C'blowfish_ctx -> CUInt -> Ptr CUChar -> IO () foreign import ccall "&nettle_blowfish_set_key" p'nettle_blowfish_set_key :: FunPtr (Ptr C'blowfish_ctx -> CUInt -> Ptr CUChar -> IO ()) {-# LINE 18 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} foreign import ccall "nettle_blowfish_encrypt" c'nettle_blowfish_encrypt :: Ptr C'blowfish_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO () foreign import ccall "&nettle_blowfish_encrypt" p'nettle_blowfish_encrypt :: FunPtr (Ptr C'blowfish_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO ()) {-# LINE 19 "Bindings/Nettle/Cipher/Blowfish.hsc" #-} foreign import ccall "nettle_blowfish_decrypt" c'nettle_blowfish_decrypt :: Ptr C'blowfish_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO () foreign import ccall "&nettle_blowfish_decrypt" p'nettle_blowfish_decrypt :: FunPtr (Ptr C'blowfish_ctx -> CUInt -> Ptr CUChar -> Ptr CUChar -> IO ()) {-# LINE 20 "Bindings/Nettle/Cipher/Blowfish.hsc" #-}