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
c'BLOWFISH_BLOCK_SIZE = 8
c'BLOWFISH_BLOCK_SIZE :: (Num a) => a
c'BLOWFISH_MIN_KEY_SIZE = 8
c'BLOWFISH_MIN_KEY_SIZE :: (Num a) => a
c'BLOWFISH_MAX_KEY_SIZE = 56
c'BLOWFISH_MAX_KEY_SIZE :: (Num a) => a
c'BLOWFISH_KEY_SIZE = 16
c'BLOWFISH_KEY_SIZE :: (Num a) => a
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 ()
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 ())
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 ())
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 ())