{-# LINE 1 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LINE 2 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}


{-# LINE 4 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}

{-# LINE 5 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}

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

{-# LINE 8 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}

c'YARROW256_SEED_FILE_SIZE = 32
c'YARROW256_SEED_FILE_SIZE :: (Num a) => a

{-# LINE 10 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}


{-# LINE 12 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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 ()

{-# LINE 13 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}


{-# LINE 15 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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 ()

{-# LINE 16 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}

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 ())

{-# LINE 18 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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 ())

{-# LINE 19 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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)

{-# LINE 20 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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 ())

{-# LINE 21 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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)

{-# LINE 22 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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)

{-# LINE 23 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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 ())

{-# LINE 24 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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 ())

{-# LINE 25 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}


{-# LINE 27 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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 ()

{-# LINE 28 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}

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 ())

{-# LINE 30 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}
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)

{-# LINE 31 "Bindings/Nettle/PRNG/Yarrow.hsc" #-}