{-# LANGUAGE CApiFFI #-}
module Botan.Bindings.MAC where
import Botan.Bindings.Prelude
data {-# CTYPE "botan/ffi.h" "struct botan_mac_struct" #-} BotanMACStruct
newtype {-# CTYPE "botan/ffi.h" "botan_mac_t" #-} BotanMAC
= MkBotanMAC { BotanMAC -> Ptr BotanMACStruct
runBotanMAC :: Ptr BotanMACStruct }
deriving newtype (BotanMAC -> BotanMAC -> Bool
(BotanMAC -> BotanMAC -> Bool)
-> (BotanMAC -> BotanMAC -> Bool) -> Eq BotanMAC
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BotanMAC -> BotanMAC -> Bool
== :: BotanMAC -> BotanMAC -> Bool
$c/= :: BotanMAC -> BotanMAC -> Bool
/= :: BotanMAC -> BotanMAC -> Bool
Eq, Eq BotanMAC
Eq BotanMAC
-> (BotanMAC -> BotanMAC -> Ordering)
-> (BotanMAC -> BotanMAC -> Bool)
-> (BotanMAC -> BotanMAC -> Bool)
-> (BotanMAC -> BotanMAC -> Bool)
-> (BotanMAC -> BotanMAC -> Bool)
-> (BotanMAC -> BotanMAC -> BotanMAC)
-> (BotanMAC -> BotanMAC -> BotanMAC)
-> Ord BotanMAC
BotanMAC -> BotanMAC -> Bool
BotanMAC -> BotanMAC -> Ordering
BotanMAC -> BotanMAC -> BotanMAC
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 :: BotanMAC -> BotanMAC -> Ordering
compare :: BotanMAC -> BotanMAC -> Ordering
$c< :: BotanMAC -> BotanMAC -> Bool
< :: BotanMAC -> BotanMAC -> Bool
$c<= :: BotanMAC -> BotanMAC -> Bool
<= :: BotanMAC -> BotanMAC -> Bool
$c> :: BotanMAC -> BotanMAC -> Bool
> :: BotanMAC -> BotanMAC -> Bool
$c>= :: BotanMAC -> BotanMAC -> Bool
>= :: BotanMAC -> BotanMAC -> Bool
$cmax :: BotanMAC -> BotanMAC -> BotanMAC
max :: BotanMAC -> BotanMAC -> BotanMAC
$cmin :: BotanMAC -> BotanMAC -> BotanMAC
min :: BotanMAC -> BotanMAC -> BotanMAC
Ord, Ptr BotanMAC -> IO BotanMAC
Ptr BotanMAC -> Int -> IO BotanMAC
Ptr BotanMAC -> Int -> BotanMAC -> IO ()
Ptr BotanMAC -> BotanMAC -> IO ()
BotanMAC -> Int
(BotanMAC -> Int)
-> (BotanMAC -> Int)
-> (Ptr BotanMAC -> Int -> IO BotanMAC)
-> (Ptr BotanMAC -> Int -> BotanMAC -> IO ())
-> (forall b. Ptr b -> Int -> IO BotanMAC)
-> (forall b. Ptr b -> Int -> BotanMAC -> IO ())
-> (Ptr BotanMAC -> IO BotanMAC)
-> (Ptr BotanMAC -> BotanMAC -> IO ())
-> Storable BotanMAC
forall b. Ptr b -> Int -> IO BotanMAC
forall b. Ptr b -> Int -> BotanMAC -> 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 :: BotanMAC -> Int
sizeOf :: BotanMAC -> Int
$calignment :: BotanMAC -> Int
alignment :: BotanMAC -> Int
$cpeekElemOff :: Ptr BotanMAC -> Int -> IO BotanMAC
peekElemOff :: Ptr BotanMAC -> Int -> IO BotanMAC
$cpokeElemOff :: Ptr BotanMAC -> Int -> BotanMAC -> IO ()
pokeElemOff :: Ptr BotanMAC -> Int -> BotanMAC -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO BotanMAC
peekByteOff :: forall b. Ptr b -> Int -> IO BotanMAC
$cpokeByteOff :: forall b. Ptr b -> Int -> BotanMAC -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> BotanMAC -> IO ()
$cpeek :: Ptr BotanMAC -> IO BotanMAC
peek :: Ptr BotanMAC -> IO BotanMAC
$cpoke :: Ptr BotanMAC -> BotanMAC -> IO ()
poke :: Ptr BotanMAC -> BotanMAC -> IO ()
Storable)
foreign import capi safe "botan/ffi.h &botan_mac_destroy"
botan_mac_destroy
:: FinalizerPtr BotanMACStruct
pattern BOTAN_MAC_CMAC
, BOTAN_MAC_GMAC
, BOTAN_MAC_HMAC
, BOTAN_MAC_Poly1305
, BOTAN_MAC_SipHash
, BOTAN_MAC_X9_19_MAC
:: (Eq a, IsString a) => a
pattern $mBOTAN_MAC_CMAC :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_MAC_CMAC :: forall a. (Eq a, IsString a) => a
BOTAN_MAC_CMAC = "CMAC"
pattern $mBOTAN_MAC_GMAC :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_MAC_GMAC :: forall a. (Eq a, IsString a) => a
BOTAN_MAC_GMAC = "GMAC"
pattern $mBOTAN_MAC_HMAC :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_MAC_HMAC :: forall a. (Eq a, IsString a) => a
BOTAN_MAC_HMAC = "HMAC"
pattern $mBOTAN_MAC_Poly1305 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_MAC_Poly1305 :: forall a. (Eq a, IsString a) => a
BOTAN_MAC_Poly1305 = "Poly1305"
pattern $mBOTAN_MAC_SipHash :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_MAC_SipHash :: forall a. (Eq a, IsString a) => a
BOTAN_MAC_SipHash = "SipHash"
pattern $mBOTAN_MAC_X9_19_MAC :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_MAC_X9_19_MAC :: forall a. (Eq a, IsString a) => a
BOTAN_MAC_X9_19_MAC = "X9.19-MAC"
foreign import capi safe "botan/ffi.h botan_mac_init"
botan_mac_init
:: Ptr BotanMAC
-> ConstPtr CChar
-> Word32
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mac_output_length"
botan_mac_output_length
:: BotanMAC
-> Ptr CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mac_set_key"
botan_mac_set_key
:: BotanMAC
-> ConstPtr Word8
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mac_set_nonce"
botan_mac_set_nonce
:: BotanMAC
-> ConstPtr Word8
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mac_update"
botan_mac_update
:: BotanMAC
-> ConstPtr Word8
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mac_final"
botan_mac_final
:: BotanMAC
-> Ptr Word8
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mac_clear"
botan_mac_clear
:: BotanMAC
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mac_name"
botan_mac_name
:: BotanMAC
-> Ptr CChar
-> Ptr CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_mac_get_keyspec"
botan_mac_get_keyspec
:: BotanMAC
-> Ptr CSize
-> Ptr CSize
-> Ptr CSize
-> IO CInt