module Bindings.Nettle.PRNG.Yarrow 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'YARROW256_SEED_FILE_SIZE = 32
c'YARROW256_SEED_FILE_SIZE :: (Num a) => a
data C'yarrow256_ctx = C'yarrow256_ctx{
} deriving (Eq,Show)
instance Storable C'yarrow256_ctx where
sizeOf _ = 488
alignment _ = 4
peek p = do
return $ C'yarrow256_ctx
poke p (C'yarrow256_ctx) = do
return ()
data C'yarrow_source = C'yarrow_source{
} deriving (Eq,Show)
instance Storable C'yarrow_source where
sizeOf _ = 12
alignment _ = 4
peek p = do
return $ C'yarrow_source
poke p (C'yarrow_source) = do
return ()
foreign import ccall "nettle_yarrow256_init" c'nettle_yarrow256_init
:: Ptr C'yarrow256_ctx -> CUInt -> Ptr C'yarrow_source -> IO ()
foreign import ccall "&nettle_yarrow256_init" p'nettle_yarrow256_init
:: FunPtr (Ptr C'yarrow256_ctx -> CUInt -> Ptr C'yarrow_source -> IO ())
foreign import ccall "nettle_yarrow256_seed" c'nettle_yarrow256_seed
:: Ptr C'yarrow256_ctx -> CUInt -> Ptr CUChar -> IO ()
foreign import ccall "&nettle_yarrow256_seed" p'nettle_yarrow256_seed
:: FunPtr (Ptr C'yarrow256_ctx -> CUInt -> Ptr CUChar -> IO ())
foreign import ccall "nettle_yarrow256_update" c'nettle_yarrow256_update
:: Ptr C'yarrow256_ctx -> CUInt -> CUInt -> CUInt -> Ptr CUChar -> IO CInt
foreign import ccall "&nettle_yarrow256_update" p'nettle_yarrow256_update
:: FunPtr (Ptr C'yarrow256_ctx -> CUInt -> CUInt -> CUInt -> Ptr CUChar -> IO CInt)
foreign import ccall "nettle_yarrow256_random" c'nettle_yarrow256_random
:: Ptr C'yarrow256_ctx -> CUInt -> Ptr CUChar -> IO ()
foreign import ccall "&nettle_yarrow256_random" p'nettle_yarrow256_random
:: FunPtr (Ptr C'yarrow256_ctx -> CUInt -> Ptr CUChar -> IO ())
foreign import ccall "nettle_yarrow256_is_seeded" c'nettle_yarrow256_is_seeded
:: Ptr C'yarrow256_ctx -> IO CInt
foreign import ccall "&nettle_yarrow256_is_seeded" p'nettle_yarrow256_is_seeded
:: FunPtr (Ptr C'yarrow256_ctx -> IO CInt)
foreign import ccall "nettle_yarrow256_needed_sources" c'nettle_yarrow256_needed_sources
:: Ptr C'yarrow256_ctx -> IO CUInt
foreign import ccall "&nettle_yarrow256_needed_sources" p'nettle_yarrow256_needed_sources
:: FunPtr (Ptr C'yarrow256_ctx -> IO CUInt)
foreign import ccall "nettle_yarrow256_fast_reseed" c'nettle_yarrow256_fast_reseed
:: Ptr C'yarrow256_ctx -> IO ()
foreign import ccall "&nettle_yarrow256_fast_reseed" p'nettle_yarrow256_fast_reseed
:: FunPtr (Ptr C'yarrow256_ctx -> IO ())
foreign import ccall "nettle_yarrow256_slow_reseed" c'nettle_yarrow256_slow_reseed
:: Ptr C'yarrow256_ctx -> IO ()
foreign import ccall "&nettle_yarrow256_slow_reseed" p'nettle_yarrow256_slow_reseed
:: FunPtr (Ptr C'yarrow256_ctx -> IO ())
data C'yarrow_key_event_ctx = C'yarrow_key_event_ctx{
} deriving (Eq,Show)
instance Storable C'yarrow_key_event_ctx where
sizeOf _ = 72
alignment _ = 4
peek p = do
return $ C'yarrow_key_event_ctx
poke p (C'yarrow_key_event_ctx) = do
return ()
foreign import ccall "nettle_yarrow_key_event_init" c'nettle_yarrow_key_event_init
:: Ptr C'yarrow_key_event_ctx -> IO ()
foreign import ccall "&nettle_yarrow_key_event_init" p'nettle_yarrow_key_event_init
:: FunPtr (Ptr C'yarrow_key_event_ctx -> IO ())
foreign import ccall "nettle_yarrow_key_event_estimate" c'nettle_yarrow_key_event_estimate
:: Ptr C'yarrow_key_event_ctx -> CUInt -> CUInt -> IO CUInt
foreign import ccall "&nettle_yarrow_key_event_estimate" p'nettle_yarrow_key_event_estimate
:: FunPtr (Ptr C'yarrow_key_event_ctx -> CUInt -> CUInt -> IO CUInt)