{-# LANGUAGE CApiFFI #-}
module Botan.Bindings.MPI where
import Botan.Bindings.Prelude
import Botan.Bindings.RNG
data {-# CTYPE "botan/ffi.h" "struct botan_mp_struct" #-} BotanMPStruct
newtype {-# CTYPE "botan/ffi.h" "botan_mp_t" #-} BotanMP
= MkBotanMP { BotanMP -> Ptr BotanMPStruct
runBotanMP :: Ptr BotanMPStruct }
deriving newtype (BotanMP -> BotanMP -> Bool
(BotanMP -> BotanMP -> Bool)
-> (BotanMP -> BotanMP -> Bool) -> Eq BotanMP
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BotanMP -> BotanMP -> Bool
== :: BotanMP -> BotanMP -> Bool
$c/= :: BotanMP -> BotanMP -> Bool
/= :: BotanMP -> BotanMP -> Bool
Eq, Eq BotanMP
Eq BotanMP
-> (BotanMP -> BotanMP -> Ordering)
-> (BotanMP -> BotanMP -> Bool)
-> (BotanMP -> BotanMP -> Bool)
-> (BotanMP -> BotanMP -> Bool)
-> (BotanMP -> BotanMP -> Bool)
-> (BotanMP -> BotanMP -> BotanMP)
-> (BotanMP -> BotanMP -> BotanMP)
-> Ord BotanMP
BotanMP -> BotanMP -> Bool
BotanMP -> BotanMP -> Ordering
BotanMP -> BotanMP -> BotanMP
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: BotanMP -> BotanMP -> Ordering
compare :: BotanMP -> BotanMP -> Ordering
$c< :: BotanMP -> BotanMP -> Bool
< :: BotanMP -> BotanMP -> Bool
$c<= :: BotanMP -> BotanMP -> Bool
<= :: BotanMP -> BotanMP -> Bool
$c> :: BotanMP -> BotanMP -> Bool
> :: BotanMP -> BotanMP -> Bool
$c>= :: BotanMP -> BotanMP -> Bool
>= :: BotanMP -> BotanMP -> Bool
$cmax :: BotanMP -> BotanMP -> BotanMP
max :: BotanMP -> BotanMP -> BotanMP
$cmin :: BotanMP -> BotanMP -> BotanMP
min :: BotanMP -> BotanMP -> BotanMP
Ord, Ptr BotanMP -> IO BotanMP
Ptr BotanMP -> Int -> IO BotanMP
Ptr BotanMP -> Int -> BotanMP -> IO ()
Ptr BotanMP -> BotanMP -> IO ()
BotanMP -> Int
(BotanMP -> Int)
-> (BotanMP -> Int)
-> (Ptr BotanMP -> Int -> IO BotanMP)
-> (Ptr BotanMP -> Int -> BotanMP -> IO ())
-> (forall b. Ptr b -> Int -> IO BotanMP)
-> (forall b. Ptr b -> Int -> BotanMP -> IO ())
-> (Ptr BotanMP -> IO BotanMP)
-> (Ptr BotanMP -> BotanMP -> IO ())
-> Storable BotanMP
forall b. Ptr b -> Int -> IO BotanMP
forall b. Ptr b -> Int -> BotanMP -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: BotanMP -> Int
sizeOf :: BotanMP -> Int
$calignment :: BotanMP -> Int
alignment :: BotanMP -> Int
$cpeekElemOff :: Ptr BotanMP -> Int -> IO BotanMP
peekElemOff :: Ptr BotanMP -> Int -> IO BotanMP
$cpokeElemOff :: Ptr BotanMP -> Int -> BotanMP -> IO ()
pokeElemOff :: Ptr BotanMP -> Int -> BotanMP -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO BotanMP
peekByteOff :: forall b. Ptr b -> Int -> IO BotanMP
$cpokeByteOff :: forall b. Ptr b -> Int -> BotanMP -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> BotanMP -> IO ()
$cpeek :: Ptr BotanMP -> IO BotanMP
peek :: Ptr BotanMP -> IO BotanMP
$cpoke :: Ptr BotanMP -> BotanMP -> IO ()
poke :: Ptr BotanMP -> BotanMP -> IO ()
Storable)
foreign import capi safe "botan/ffi.h &botan_mp_destroy"
botan_mp_destroy
:: FinalizerPtr BotanMPStruct
foreign import capi safe "botan/ffi.h botan_mp_init"
botan_mp_init
:: Ptr BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_to_hex"
botan_mp_to_hex
:: BotanMP
-> Ptr CChar
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_to_str"
botan_mp_to_str
:: BotanMP
-> Word8
-> Ptr CChar
-> Ptr CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_clear"
botan_mp_clear
:: BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_set_from_int"
botan_mp_set_from_int
:: BotanMP
-> CInt
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_set_from_mp"
botan_mp_set_from_mp
:: BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_set_from_str"
botan_mp_set_from_str
:: BotanMP
-> ConstPtr CChar
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_set_from_radix_str"
botan_mp_set_from_radix_str
:: BotanMP
-> ConstPtr CChar
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_num_bits"
botan_mp_num_bits
:: BotanMP
-> Ptr CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_num_bytes"
botan_mp_num_bytes
:: BotanMP
-> Ptr CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_to_bin"
botan_mp_to_bin
:: BotanMP
-> Ptr Word8
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_from_bin"
botan_mp_from_bin
:: BotanMP
-> ConstPtr Word8
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_to_uint32"
botan_mp_to_uint32
:: BotanMP
-> Ptr Word32
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_is_positive"
botan_mp_is_positive
:: BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_is_negative"
botan_mp_is_negative
:: BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_flip_sign"
botan_mp_flip_sign
:: BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_is_zero"
botan_mp_is_zero
:: BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_add_u32"
botan_mp_add_u32
:: BotanMP
-> BotanMP
-> Word32
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_sub_u32"
botan_mp_sub_u32
:: BotanMP
-> BotanMP
-> Word32
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_add"
botan_mp_add
:: BotanMP
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_sub"
botan_mp_sub
:: BotanMP
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_mul"
botan_mp_mul
:: BotanMP
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_div"
botan_mp_div
:: BotanMP
-> BotanMP
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_mod_mul"
botan_mp_mod_mul
:: BotanMP
-> BotanMP
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_equal"
botan_mp_equal
:: BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_cmp"
botan_mp_cmp
:: Ptr CInt
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_swap"
botan_mp_swap
:: BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_powmod"
botan_mp_powmod
:: BotanMP
-> BotanMP
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_lshift"
botan_mp_lshift
:: BotanMP
-> BotanMP
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_rshift"
botan_mp_rshift
:: BotanMP
-> BotanMP
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_mod_inverse"
botan_mp_mod_inverse
:: BotanMP
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_rand_bits"
botan_mp_rand_bits
:: BotanMP
-> BotanRNG
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_rand_range"
botan_mp_rand_range
:: BotanMP
-> BotanRNG
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_gcd"
botan_mp_gcd
:: BotanMP
-> BotanMP
-> BotanMP
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_is_prime"
botan_mp_is_prime
:: BotanMP
-> BotanRNG
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_get_bit"
botan_mp_get_bit
:: BotanMP
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_set_bit"
botan_mp_set_bit
:: BotanMP
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mp_clear_bit"
botan_mp_clear_bit
:: BotanMP
-> CSize
-> IO CInt