{-# LANGUAGE CApiFFI #-}
module Botan.Bindings.BlockCipher where
import Botan.Bindings.Prelude
data {-# CTYPE "botan/ffi.h" "struct botan_block_cipher_struct" #-} BotanBlockCipherStruct
newtype {-# CTYPE "botan/ffi.h" "botan_block_cipher_t" #-} BotanBlockCipher
= MkBotanBlockCipher { BotanBlockCipher -> Ptr BotanBlockCipherStruct
runBotanBlockCipher :: Ptr BotanBlockCipherStruct }
deriving newtype (BotanBlockCipher -> BotanBlockCipher -> Bool
(BotanBlockCipher -> BotanBlockCipher -> Bool)
-> (BotanBlockCipher -> BotanBlockCipher -> Bool)
-> Eq BotanBlockCipher
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BotanBlockCipher -> BotanBlockCipher -> Bool
== :: BotanBlockCipher -> BotanBlockCipher -> Bool
$c/= :: BotanBlockCipher -> BotanBlockCipher -> Bool
/= :: BotanBlockCipher -> BotanBlockCipher -> Bool
Eq, Eq BotanBlockCipher
Eq BotanBlockCipher
-> (BotanBlockCipher -> BotanBlockCipher -> Ordering)
-> (BotanBlockCipher -> BotanBlockCipher -> Bool)
-> (BotanBlockCipher -> BotanBlockCipher -> Bool)
-> (BotanBlockCipher -> BotanBlockCipher -> Bool)
-> (BotanBlockCipher -> BotanBlockCipher -> Bool)
-> (BotanBlockCipher -> BotanBlockCipher -> BotanBlockCipher)
-> (BotanBlockCipher -> BotanBlockCipher -> BotanBlockCipher)
-> Ord BotanBlockCipher
BotanBlockCipher -> BotanBlockCipher -> Bool
BotanBlockCipher -> BotanBlockCipher -> Ordering
BotanBlockCipher -> BotanBlockCipher -> BotanBlockCipher
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 :: BotanBlockCipher -> BotanBlockCipher -> Ordering
compare :: BotanBlockCipher -> BotanBlockCipher -> Ordering
$c< :: BotanBlockCipher -> BotanBlockCipher -> Bool
< :: BotanBlockCipher -> BotanBlockCipher -> Bool
$c<= :: BotanBlockCipher -> BotanBlockCipher -> Bool
<= :: BotanBlockCipher -> BotanBlockCipher -> Bool
$c> :: BotanBlockCipher -> BotanBlockCipher -> Bool
> :: BotanBlockCipher -> BotanBlockCipher -> Bool
$c>= :: BotanBlockCipher -> BotanBlockCipher -> Bool
>= :: BotanBlockCipher -> BotanBlockCipher -> Bool
$cmax :: BotanBlockCipher -> BotanBlockCipher -> BotanBlockCipher
max :: BotanBlockCipher -> BotanBlockCipher -> BotanBlockCipher
$cmin :: BotanBlockCipher -> BotanBlockCipher -> BotanBlockCipher
min :: BotanBlockCipher -> BotanBlockCipher -> BotanBlockCipher
Ord, Ptr BotanBlockCipher -> IO BotanBlockCipher
Ptr BotanBlockCipher -> Int -> IO BotanBlockCipher
Ptr BotanBlockCipher -> Int -> BotanBlockCipher -> IO ()
Ptr BotanBlockCipher -> BotanBlockCipher -> IO ()
BotanBlockCipher -> Int
(BotanBlockCipher -> Int)
-> (BotanBlockCipher -> Int)
-> (Ptr BotanBlockCipher -> Int -> IO BotanBlockCipher)
-> (Ptr BotanBlockCipher -> Int -> BotanBlockCipher -> IO ())
-> (forall b. Ptr b -> Int -> IO BotanBlockCipher)
-> (forall b. Ptr b -> Int -> BotanBlockCipher -> IO ())
-> (Ptr BotanBlockCipher -> IO BotanBlockCipher)
-> (Ptr BotanBlockCipher -> BotanBlockCipher -> IO ())
-> Storable BotanBlockCipher
forall b. Ptr b -> Int -> IO BotanBlockCipher
forall b. Ptr b -> Int -> BotanBlockCipher -> 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 :: BotanBlockCipher -> Int
sizeOf :: BotanBlockCipher -> Int
$calignment :: BotanBlockCipher -> Int
alignment :: BotanBlockCipher -> Int
$cpeekElemOff :: Ptr BotanBlockCipher -> Int -> IO BotanBlockCipher
peekElemOff :: Ptr BotanBlockCipher -> Int -> IO BotanBlockCipher
$cpokeElemOff :: Ptr BotanBlockCipher -> Int -> BotanBlockCipher -> IO ()
pokeElemOff :: Ptr BotanBlockCipher -> Int -> BotanBlockCipher -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO BotanBlockCipher
peekByteOff :: forall b. Ptr b -> Int -> IO BotanBlockCipher
$cpokeByteOff :: forall b. Ptr b -> Int -> BotanBlockCipher -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> BotanBlockCipher -> IO ()
$cpeek :: Ptr BotanBlockCipher -> IO BotanBlockCipher
peek :: Ptr BotanBlockCipher -> IO BotanBlockCipher
$cpoke :: Ptr BotanBlockCipher -> BotanBlockCipher -> IO ()
poke :: Ptr BotanBlockCipher -> BotanBlockCipher -> IO ()
Storable)
foreign import capi safe "botan/ffi.h &botan_block_cipher_destroy"
botan_block_cipher_destroy
:: FinalizerPtr BotanBlockCipherStruct
pattern BOTAN_BLOCK_CIPHER_128_AES_128
, BOTAN_BLOCK_CIPHER_128_AES_192
, BOTAN_BLOCK_CIPHER_128_AES_256
, BOTAN_BLOCK_CIPHER_128_ARIA_128
, BOTAN_BLOCK_CIPHER_128_ARIA_192
, BOTAN_BLOCK_CIPHER_128_ARIA_256
, BOTAN_BLOCK_CIPHER_128_CAMELLIA_128
, BOTAN_BLOCK_CIPHER_128_CAMELLIA_192
, BOTAN_BLOCK_CIPHER_128_CAMELLIA_256
, BOTAN_BLOCK_CIPHER_128_NOEKEON
, BOTAN_BLOCK_CIPHER_128_SEED
, BOTAN_BLOCK_CIPHER_128_SM4
, BOTAN_BLOCK_CIPHER_128_SERPENT
, BOTAN_BLOCK_CIPHER_128_TWOFISH
:: (Eq a, IsString a) => a
pattern $mBOTAN_BLOCK_CIPHER_128_AES_128 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_AES_128 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_AES_128 = "AES-128"
pattern $mBOTAN_BLOCK_CIPHER_128_AES_192 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_AES_192 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_AES_192 = "AES-192"
pattern $mBOTAN_BLOCK_CIPHER_128_AES_256 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_AES_256 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_AES_256 = "AES-256"
pattern $mBOTAN_BLOCK_CIPHER_128_ARIA_128 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_ARIA_128 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_ARIA_128 = "ARIA-128"
pattern $mBOTAN_BLOCK_CIPHER_128_ARIA_192 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_ARIA_192 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_ARIA_192 = "ARIA-192"
pattern $mBOTAN_BLOCK_CIPHER_128_ARIA_256 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_ARIA_256 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_ARIA_256 = "ARIA-256"
pattern $mBOTAN_BLOCK_CIPHER_128_CAMELLIA_128 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_CAMELLIA_128 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_CAMELLIA_128 = "Camellia-128"
pattern $mBOTAN_BLOCK_CIPHER_128_CAMELLIA_192 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_CAMELLIA_192 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_CAMELLIA_192 = "Camellia-192"
pattern $mBOTAN_BLOCK_CIPHER_128_CAMELLIA_256 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_CAMELLIA_256 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_CAMELLIA_256 = "Camellia-256"
pattern $mBOTAN_BLOCK_CIPHER_128_NOEKEON :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_NOEKEON :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_NOEKEON = "Noekeon"
pattern $mBOTAN_BLOCK_CIPHER_128_SEED :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_SEED :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_SEED = "SEED"
pattern $mBOTAN_BLOCK_CIPHER_128_SM4 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_SM4 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_SM4 = "SM4"
pattern $mBOTAN_BLOCK_CIPHER_128_SERPENT :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_SERPENT :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_SERPENT = "Serpent"
pattern $mBOTAN_BLOCK_CIPHER_128_TWOFISH :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_128_TWOFISH :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_128_TWOFISH = "Twofish"
pattern BOTAN_BLOCK_CIPHER_BLOWFISH
, BOTAN_BLOCK_CIPHER_CAST_128
, BOTAN_BLOCK_CIPHER_DES
, BOTAN_BLOCK_CIPHER_TRIPLEDES
, BOTAN_BLOCK_CIPHER_GOST_28147_89
, BOTAN_BLOCK_CIPHER_IDEA
, BOTAN_BLOCK_CIPHER_SHACAL2
, BOTAN_BLOCK_CIPHER_THREEFISH_512
:: (Eq a, IsString a) => a
pattern $mBOTAN_BLOCK_CIPHER_BLOWFISH :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_BLOWFISH :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_BLOWFISH = "Blowfish"
pattern $mBOTAN_BLOCK_CIPHER_CAST_128 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_CAST_128 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_CAST_128 = "CAST-128"
pattern $mBOTAN_BLOCK_CIPHER_DES :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_DES :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_DES = "DES"
pattern $mBOTAN_BLOCK_CIPHER_TRIPLEDES :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_TRIPLEDES :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_TRIPLEDES = "TripleDES"
pattern $mBOTAN_BLOCK_CIPHER_GOST_28147_89 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_GOST_28147_89 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_GOST_28147_89 = "GOST-28147-89"
pattern $mBOTAN_BLOCK_CIPHER_IDEA :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_IDEA :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_IDEA = "IDEA"
pattern $mBOTAN_BLOCK_CIPHER_SHACAL2 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_SHACAL2 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_SHACAL2 = "SHACAL2"
pattern $mBOTAN_BLOCK_CIPHER_THREEFISH_512 :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bBOTAN_BLOCK_CIPHER_THREEFISH_512 :: forall a. (Eq a, IsString a) => a
BOTAN_BLOCK_CIPHER_THREEFISH_512 = "Threefish-512"
foreign import capi safe "botan/ffi.h botan_block_cipher_init"
botan_block_cipher_init
:: Ptr BotanBlockCipher
-> ConstPtr CChar
-> IO CInt
foreign import capi safe "botan/ffi.h botan_block_cipher_clear"
botan_block_cipher_clear
:: BotanBlockCipher
-> IO CInt
foreign import capi safe "botan/ffi.h botan_block_cipher_set_key"
botan_block_cipher_set_key
:: BotanBlockCipher
-> ConstPtr Word8
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_block_cipher_block_size"
botan_block_cipher_block_size
:: BotanBlockCipher
-> IO CInt
foreign import capi safe "botan/ffi.h botan_block_cipher_encrypt_blocks"
botan_block_cipher_encrypt_blocks
:: BotanBlockCipher
-> ConstPtr Word8
-> Ptr Word8
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_block_cipher_decrypt_blocks"
botan_block_cipher_decrypt_blocks
:: BotanBlockCipher
-> ConstPtr Word8
-> Ptr Word8
-> CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_block_cipher_name"
botan_block_cipher_name
:: BotanBlockCipher
-> Ptr CChar
-> Ptr CSize
-> IO CInt
foreign import capi safe "botan/ffi.h botan_block_cipher_get_keyspec"
botan_block_cipher_get_keyspec
:: BotanBlockCipher
-> Ptr CSize
-> Ptr CSize
-> Ptr CSize
-> IO CInt