module Botan.BlockCipher.Camellia
( Camellia128(..)
, Camellia128SecretKey(..)
, pattern Camellia128SecretKey
, getCamellia128SecretKey
, Camellia128Ciphertext(..)
, camellia128Encrypt
, camellia128Decrypt
, camellia128EncryptLazy
, camellia128DecryptLazy
, Camellia192(..)
, Camellia192SecretKey(..)
, pattern Camellia192SecretKey
, getCamellia192SecretKey
, Camellia192Ciphertext(..)
, camellia192Encrypt
, camellia192Decrypt
, camellia192EncryptLazy
, camellia192DecryptLazy
, Camellia256(..)
, Camellia256SecretKey(..)
, pattern Camellia256SecretKey
, getCamellia256SecretKey
, Camellia256Ciphertext(..)
, camellia256Encrypt
, camellia256Decrypt
, camellia256EncryptLazy
, camellia256DecryptLazy
) where

import qualified Data.ByteString as ByteString
import qualified Data.ByteString.Lazy as Lazy
import qualified Data.Text as Text

import qualified Botan.BlockCipher as Botan
import qualified Botan.Utility as Botan

import Botan.Prelude hiding (Ciphertext, LazyCiphertext)

import Botan.BlockCipher.Class
import Botan.Types.Class
import Botan.RNG

-- Camellia128 type

data Camellia128

newtype instance SecretKey Camellia128 = MkCamellia128SecretKey GSecretKey
    deriving newtype (SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
(SecretKey Camellia128 -> SecretKey Camellia128 -> Bool)
-> (SecretKey Camellia128 -> SecretKey Camellia128 -> Bool)
-> Eq (SecretKey Camellia128)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
== :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
$c/= :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
/= :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
Eq, Eq (SecretKey Camellia128)
Eq (SecretKey Camellia128) =>
(SecretKey Camellia128 -> SecretKey Camellia128 -> Ordering)
-> (SecretKey Camellia128 -> SecretKey Camellia128 -> Bool)
-> (SecretKey Camellia128 -> SecretKey Camellia128 -> Bool)
-> (SecretKey Camellia128 -> SecretKey Camellia128 -> Bool)
-> (SecretKey Camellia128 -> SecretKey Camellia128 -> Bool)
-> (SecretKey Camellia128
    -> SecretKey Camellia128 -> SecretKey Camellia128)
-> (SecretKey Camellia128
    -> SecretKey Camellia128 -> SecretKey Camellia128)
-> Ord (SecretKey Camellia128)
SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
SecretKey Camellia128 -> SecretKey Camellia128 -> Ordering
SecretKey Camellia128
-> SecretKey Camellia128 -> SecretKey Camellia128
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 :: SecretKey Camellia128 -> SecretKey Camellia128 -> Ordering
compare :: SecretKey Camellia128 -> SecretKey Camellia128 -> Ordering
$c< :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
< :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
$c<= :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
<= :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
$c> :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
> :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
$c>= :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
>= :: SecretKey Camellia128 -> SecretKey Camellia128 -> Bool
$cmax :: SecretKey Camellia128
-> SecretKey Camellia128 -> SecretKey Camellia128
max :: SecretKey Camellia128
-> SecretKey Camellia128 -> SecretKey Camellia128
$cmin :: SecretKey Camellia128
-> SecretKey Camellia128 -> SecretKey Camellia128
min :: SecretKey Camellia128
-> SecretKey Camellia128 -> SecretKey Camellia128
Ord, Int -> SecretKey Camellia128 -> ShowS
[SecretKey Camellia128] -> ShowS
SecretKey Camellia128 -> String
(Int -> SecretKey Camellia128 -> ShowS)
-> (SecretKey Camellia128 -> String)
-> ([SecretKey Camellia128] -> ShowS)
-> Show (SecretKey Camellia128)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SecretKey Camellia128 -> ShowS
showsPrec :: Int -> SecretKey Camellia128 -> ShowS
$cshow :: SecretKey Camellia128 -> String
show :: SecretKey Camellia128 -> String
$cshowList :: [SecretKey Camellia128] -> ShowS
showList :: [SecretKey Camellia128] -> ShowS
Show, ByteString -> Maybe (SecretKey Camellia128)
SecretKey Camellia128 -> ByteString
(SecretKey Camellia128 -> ByteString)
-> (ByteString -> Maybe (SecretKey Camellia128))
-> Encodable (SecretKey Camellia128)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: SecretKey Camellia128 -> ByteString
encode :: SecretKey Camellia128 -> ByteString
$cdecode :: ByteString -> Maybe (SecretKey Camellia128)
decode :: ByteString -> Maybe (SecretKey Camellia128)
Encodable)

pattern Camellia128SecretKey :: ByteString -> SecretKey Camellia128
pattern $mCamellia128SecretKey :: forall {r}.
SecretKey Camellia128 -> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia128SecretKey :: ByteString -> SecretKey Camellia128
Camellia128SecretKey bytes = MkCamellia128SecretKey (MkGSecretKey bytes)

getCamellia128SecretKey :: SecretKey Camellia128 -> ByteString
getCamellia128SecretKey :: SecretKey Camellia128 -> ByteString
getCamellia128SecretKey (Camellia128SecretKey ByteString
bs) = ByteString
bs

type Camellia128SecretKey = SecretKey Camellia128

newtype instance Ciphertext Camellia128 = MkCamellia128Ciphertext GCiphertext
    deriving newtype (Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
(Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool)
-> (Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool)
-> Eq (Ciphertext Camellia128)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
== :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
$c/= :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
/= :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
Eq, Eq (Ciphertext Camellia128)
Eq (Ciphertext Camellia128) =>
(Ciphertext Camellia128 -> Ciphertext Camellia128 -> Ordering)
-> (Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool)
-> (Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool)
-> (Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool)
-> (Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool)
-> (Ciphertext Camellia128
    -> Ciphertext Camellia128 -> Ciphertext Camellia128)
-> (Ciphertext Camellia128
    -> Ciphertext Camellia128 -> Ciphertext Camellia128)
-> Ord (Ciphertext Camellia128)
Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
Ciphertext Camellia128 -> Ciphertext Camellia128 -> Ordering
Ciphertext Camellia128
-> Ciphertext Camellia128 -> Ciphertext Camellia128
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 :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Ordering
compare :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Ordering
$c< :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
< :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
$c<= :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
<= :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
$c> :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
> :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
$c>= :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
>= :: Ciphertext Camellia128 -> Ciphertext Camellia128 -> Bool
$cmax :: Ciphertext Camellia128
-> Ciphertext Camellia128 -> Ciphertext Camellia128
max :: Ciphertext Camellia128
-> Ciphertext Camellia128 -> Ciphertext Camellia128
$cmin :: Ciphertext Camellia128
-> Ciphertext Camellia128 -> Ciphertext Camellia128
min :: Ciphertext Camellia128
-> Ciphertext Camellia128 -> Ciphertext Camellia128
Ord, Int -> Ciphertext Camellia128 -> ShowS
[Ciphertext Camellia128] -> ShowS
Ciphertext Camellia128 -> String
(Int -> Ciphertext Camellia128 -> ShowS)
-> (Ciphertext Camellia128 -> String)
-> ([Ciphertext Camellia128] -> ShowS)
-> Show (Ciphertext Camellia128)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Ciphertext Camellia128 -> ShowS
showsPrec :: Int -> Ciphertext Camellia128 -> ShowS
$cshow :: Ciphertext Camellia128 -> String
show :: Ciphertext Camellia128 -> String
$cshowList :: [Ciphertext Camellia128] -> ShowS
showList :: [Ciphertext Camellia128] -> ShowS
Show, ByteString -> Maybe (Ciphertext Camellia128)
Ciphertext Camellia128 -> ByteString
(Ciphertext Camellia128 -> ByteString)
-> (ByteString -> Maybe (Ciphertext Camellia128))
-> Encodable (Ciphertext Camellia128)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: Ciphertext Camellia128 -> ByteString
encode :: Ciphertext Camellia128 -> ByteString
$cdecode :: ByteString -> Maybe (Ciphertext Camellia128)
decode :: ByteString -> Maybe (Ciphertext Camellia128)
Encodable)

pattern Camellia128Ciphertext :: ByteString -> Ciphertext Camellia128
pattern $mCamellia128Ciphertext :: forall {r}.
Ciphertext Camellia128 -> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia128Ciphertext :: ByteString -> Ciphertext Camellia128
Camellia128Ciphertext bs = MkCamellia128Ciphertext (MkGCiphertext bs)

getCamellia128Ciphertext :: Ciphertext Camellia128 -> ByteString
getCamellia128Ciphertext :: Ciphertext Camellia128 -> ByteString
getCamellia128Ciphertext (Camellia128Ciphertext ByteString
bs) = ByteString
bs

type Camellia128Ciphertext = Ciphertext Camellia128

newtype instance LazyCiphertext Camellia128 = MkCamellia128LazyCiphertext GLazyCiphertext
    deriving newtype (LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
(LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool)
-> (LazyCiphertext Camellia128
    -> LazyCiphertext Camellia128 -> Bool)
-> Eq (LazyCiphertext Camellia128)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
== :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
$c/= :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
/= :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
Eq, Eq (LazyCiphertext Camellia128)
Eq (LazyCiphertext Camellia128) =>
(LazyCiphertext Camellia128
 -> LazyCiphertext Camellia128 -> Ordering)
-> (LazyCiphertext Camellia128
    -> LazyCiphertext Camellia128 -> Bool)
-> (LazyCiphertext Camellia128
    -> LazyCiphertext Camellia128 -> Bool)
-> (LazyCiphertext Camellia128
    -> LazyCiphertext Camellia128 -> Bool)
-> (LazyCiphertext Camellia128
    -> LazyCiphertext Camellia128 -> Bool)
-> (LazyCiphertext Camellia128
    -> LazyCiphertext Camellia128 -> LazyCiphertext Camellia128)
-> (LazyCiphertext Camellia128
    -> LazyCiphertext Camellia128 -> LazyCiphertext Camellia128)
-> Ord (LazyCiphertext Camellia128)
LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
LazyCiphertext Camellia128
-> LazyCiphertext Camellia128 -> Ordering
LazyCiphertext Camellia128
-> LazyCiphertext Camellia128 -> LazyCiphertext Camellia128
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 :: LazyCiphertext Camellia128
-> LazyCiphertext Camellia128 -> Ordering
compare :: LazyCiphertext Camellia128
-> LazyCiphertext Camellia128 -> Ordering
$c< :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
< :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
$c<= :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
<= :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
$c> :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
> :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
$c>= :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
>= :: LazyCiphertext Camellia128 -> LazyCiphertext Camellia128 -> Bool
$cmax :: LazyCiphertext Camellia128
-> LazyCiphertext Camellia128 -> LazyCiphertext Camellia128
max :: LazyCiphertext Camellia128
-> LazyCiphertext Camellia128 -> LazyCiphertext Camellia128
$cmin :: LazyCiphertext Camellia128
-> LazyCiphertext Camellia128 -> LazyCiphertext Camellia128
min :: LazyCiphertext Camellia128
-> LazyCiphertext Camellia128 -> LazyCiphertext Camellia128
Ord, Int -> LazyCiphertext Camellia128 -> ShowS
[LazyCiphertext Camellia128] -> ShowS
LazyCiphertext Camellia128 -> String
(Int -> LazyCiphertext Camellia128 -> ShowS)
-> (LazyCiphertext Camellia128 -> String)
-> ([LazyCiphertext Camellia128] -> ShowS)
-> Show (LazyCiphertext Camellia128)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LazyCiphertext Camellia128 -> ShowS
showsPrec :: Int -> LazyCiphertext Camellia128 -> ShowS
$cshow :: LazyCiphertext Camellia128 -> String
show :: LazyCiphertext Camellia128 -> String
$cshowList :: [LazyCiphertext Camellia128] -> ShowS
showList :: [LazyCiphertext Camellia128] -> ShowS
Show, ByteString -> Maybe (LazyCiphertext Camellia128)
LazyCiphertext Camellia128 -> ByteString
(LazyCiphertext Camellia128 -> ByteString)
-> (ByteString -> Maybe (LazyCiphertext Camellia128))
-> Encodable (LazyCiphertext Camellia128)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: LazyCiphertext Camellia128 -> ByteString
encode :: LazyCiphertext Camellia128 -> ByteString
$cdecode :: ByteString -> Maybe (LazyCiphertext Camellia128)
decode :: ByteString -> Maybe (LazyCiphertext Camellia128)
Encodable, Encodable (LazyCiphertext Camellia128)
ByteString -> Maybe (LazyCiphertext Camellia128)
LazyCiphertext Camellia128 -> ByteString
Encodable (LazyCiphertext Camellia128) =>
(LazyCiphertext Camellia128 -> ByteString)
-> (ByteString -> Maybe (LazyCiphertext Camellia128))
-> LazyEncodable (LazyCiphertext Camellia128)
forall a.
Encodable a =>
(a -> ByteString) -> (ByteString -> Maybe a) -> LazyEncodable a
$cencodeLazy :: LazyCiphertext Camellia128 -> ByteString
encodeLazy :: LazyCiphertext Camellia128 -> ByteString
$cdecodeLazy :: ByteString -> Maybe (LazyCiphertext Camellia128)
decodeLazy :: ByteString -> Maybe (LazyCiphertext Camellia128)
LazyEncodable)

pattern Camellia128LazyCiphertext :: Lazy.ByteString -> LazyCiphertext Camellia128
pattern $mCamellia128LazyCiphertext :: forall {r}.
LazyCiphertext Camellia128
-> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia128LazyCiphertext :: ByteString -> LazyCiphertext Camellia128
Camellia128LazyCiphertext lbs = MkCamellia128LazyCiphertext (MkGLazyCiphertext lbs)

getCamellia128LazyCiphertext :: LazyCiphertext Camellia128 -> Lazy.ByteString
getCamellia128LazyCiphertext :: LazyCiphertext Camellia128 -> ByteString
getCamellia128LazyCiphertext (Camellia128LazyCiphertext ByteString
bs) = ByteString
bs

type Camellia128LazyCiphertext = LazyCiphertext Camellia128

instance HasSecretKey Camellia128 where
    
    secretKeySpec :: SizeSpecifier (SecretKey Camellia128)
    secretKeySpec :: SizeSpecifier (SecretKey Camellia128)
secretKeySpec = SizeSpecifier () -> SizeSpecifier (SecretKey Camellia128)
forall a b. SizeSpecifier a -> SizeSpecifier b
coerceSizeSpec (SizeSpecifier () -> SizeSpecifier (SecretKey Camellia128))
-> SizeSpecifier () -> SizeSpecifier (SecretKey Camellia128)
forall a b. (a -> b) -> a -> b
$ BlockCipher -> SizeSpecifier ()
Botan.blockCipherKeySpec BlockCipher
Botan.camellia128

instance (MonadRandomIO m )=> SecretKeyGen Camellia128 m where

    newSecretKey :: MonadRandomIO m => m (SecretKey Camellia128)
    newSecretKey :: MonadRandomIO m => m (SecretKey Camellia128)
newSecretKey = ByteString -> SecretKey Camellia128
Camellia128SecretKey (ByteString -> SecretKey Camellia128)
-> m ByteString -> m (SecretKey Camellia128)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SizeSpecifier (SecretKey Camellia128) -> m ByteString
forall (m :: * -> *) a.
MonadRandomIO m =>
SizeSpecifier a -> m ByteString
newSized (forall alg. HasSecretKey alg => SizeSpecifier (SecretKey alg)
secretKeySpec @Camellia128)
    
    newSecretKeyMaybe :: MonadRandomIO m => Int -> m (Maybe (SecretKey Camellia128))
    newSecretKeyMaybe :: MonadRandomIO m => Int -> m (Maybe (SecretKey Camellia128))
newSecretKeyMaybe Int
i = (ByteString -> SecretKey Camellia128)
-> Maybe ByteString -> Maybe (SecretKey Camellia128)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> SecretKey Camellia128
Camellia128SecretKey (Maybe ByteString -> Maybe (SecretKey Camellia128))
-> m (Maybe ByteString) -> m (Maybe (SecretKey Camellia128))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SizeSpecifier (SecretKey Camellia128)
-> Int -> m (Maybe ByteString)
forall (m :: * -> *) a.
MonadRandomIO m =>
SizeSpecifier a -> Int -> m (Maybe ByteString)
newSizedMaybe (forall alg. HasSecretKey alg => SizeSpecifier (SecretKey alg)
secretKeySpec @Camellia128) Int
i

instance HasCiphertext Camellia128 where

instance BlockCipher Camellia128 where

    blockCipherEncrypt :: SecretKey Camellia128 -> ByteString -> Maybe (Ciphertext Camellia128)
    blockCipherEncrypt :: SecretKey Camellia128
-> ByteString -> Maybe (Ciphertext Camellia128)
blockCipherEncrypt (Camellia128SecretKey ByteString
k) = (ByteString -> Ciphertext Camellia128)
-> Maybe ByteString -> Maybe (Ciphertext Camellia128)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext Camellia128
Camellia128Ciphertext (Maybe ByteString -> Maybe (Ciphertext Camellia128))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext Camellia128)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.camellia128 ByteString
k

    blockCipherDecrypt :: SecretKey Camellia128 -> Ciphertext Camellia128 -> Maybe ByteString
    blockCipherDecrypt :: SecretKey Camellia128 -> Ciphertext Camellia128 -> Maybe ByteString
blockCipherDecrypt (Camellia128SecretKey ByteString
k) (Camellia128Ciphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.camellia128 ByteString
k ByteString
ct

instance HasLazyCiphertext Camellia128 where

instance IncrementalBlockCipher Camellia128 where

    blockCipherEncryptLazy :: SecretKey Camellia128 -> Lazy.ByteString -> Maybe (LazyCiphertext Camellia128)
    blockCipherEncryptLazy :: SecretKey Camellia128
-> ByteString -> Maybe (LazyCiphertext Camellia128)
blockCipherEncryptLazy (Camellia128SecretKey ByteString
k) = (ByteString -> LazyCiphertext Camellia128)
-> Maybe ByteString -> Maybe (LazyCiphertext Camellia128)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext Camellia128
Camellia128LazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext Camellia128))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext Camellia128)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.camellia128 ByteString
k

    blockCipherDecryptLazy :: SecretKey Camellia128 -> LazyCiphertext Camellia128 -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey Camellia128
-> LazyCiphertext Camellia128 -> Maybe ByteString
blockCipherDecryptLazy (Camellia128SecretKey ByteString
k) (Camellia128LazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.camellia128 ByteString
k ByteString
ct

-- Camellia blockCipher

camellia128Encrypt :: SecretKey Camellia128 -> ByteString -> Maybe Camellia128Ciphertext
camellia128Encrypt :: SecretKey Camellia128
-> ByteString -> Maybe (Ciphertext Camellia128)
camellia128Encrypt = SecretKey Camellia128
-> ByteString -> Maybe (Ciphertext Camellia128)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

camellia128Decrypt :: SecretKey Camellia128 -> Camellia128Ciphertext -> Maybe ByteString
camellia128Decrypt :: SecretKey Camellia128 -> Ciphertext Camellia128 -> Maybe ByteString
camellia128Decrypt = SecretKey Camellia128 -> Ciphertext Camellia128 -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

camellia128EncryptLazy :: SecretKey Camellia128 -> Lazy.ByteString -> Maybe Camellia128LazyCiphertext
camellia128EncryptLazy :: SecretKey Camellia128
-> ByteString -> Maybe (LazyCiphertext Camellia128)
camellia128EncryptLazy = SecretKey Camellia128
-> ByteString -> Maybe (LazyCiphertext Camellia128)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

camellia128DecryptLazy :: SecretKey Camellia128 -> Camellia128LazyCiphertext -> Maybe Lazy.ByteString
camellia128DecryptLazy :: SecretKey Camellia128
-> LazyCiphertext Camellia128 -> Maybe ByteString
camellia128DecryptLazy = SecretKey Camellia128
-> LazyCiphertext Camellia128 -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy

-- Camellia192 type

data Camellia192

newtype instance SecretKey Camellia192 = MkCamellia192SecretKey GSecretKey
    deriving newtype (SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
(SecretKey Camellia192 -> SecretKey Camellia192 -> Bool)
-> (SecretKey Camellia192 -> SecretKey Camellia192 -> Bool)
-> Eq (SecretKey Camellia192)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
== :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
$c/= :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
/= :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
Eq, Eq (SecretKey Camellia192)
Eq (SecretKey Camellia192) =>
(SecretKey Camellia192 -> SecretKey Camellia192 -> Ordering)
-> (SecretKey Camellia192 -> SecretKey Camellia192 -> Bool)
-> (SecretKey Camellia192 -> SecretKey Camellia192 -> Bool)
-> (SecretKey Camellia192 -> SecretKey Camellia192 -> Bool)
-> (SecretKey Camellia192 -> SecretKey Camellia192 -> Bool)
-> (SecretKey Camellia192
    -> SecretKey Camellia192 -> SecretKey Camellia192)
-> (SecretKey Camellia192
    -> SecretKey Camellia192 -> SecretKey Camellia192)
-> Ord (SecretKey Camellia192)
SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
SecretKey Camellia192 -> SecretKey Camellia192 -> Ordering
SecretKey Camellia192
-> SecretKey Camellia192 -> SecretKey Camellia192
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 :: SecretKey Camellia192 -> SecretKey Camellia192 -> Ordering
compare :: SecretKey Camellia192 -> SecretKey Camellia192 -> Ordering
$c< :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
< :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
$c<= :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
<= :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
$c> :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
> :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
$c>= :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
>= :: SecretKey Camellia192 -> SecretKey Camellia192 -> Bool
$cmax :: SecretKey Camellia192
-> SecretKey Camellia192 -> SecretKey Camellia192
max :: SecretKey Camellia192
-> SecretKey Camellia192 -> SecretKey Camellia192
$cmin :: SecretKey Camellia192
-> SecretKey Camellia192 -> SecretKey Camellia192
min :: SecretKey Camellia192
-> SecretKey Camellia192 -> SecretKey Camellia192
Ord, Int -> SecretKey Camellia192 -> ShowS
[SecretKey Camellia192] -> ShowS
SecretKey Camellia192 -> String
(Int -> SecretKey Camellia192 -> ShowS)
-> (SecretKey Camellia192 -> String)
-> ([SecretKey Camellia192] -> ShowS)
-> Show (SecretKey Camellia192)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SecretKey Camellia192 -> ShowS
showsPrec :: Int -> SecretKey Camellia192 -> ShowS
$cshow :: SecretKey Camellia192 -> String
show :: SecretKey Camellia192 -> String
$cshowList :: [SecretKey Camellia192] -> ShowS
showList :: [SecretKey Camellia192] -> ShowS
Show, ByteString -> Maybe (SecretKey Camellia192)
SecretKey Camellia192 -> ByteString
(SecretKey Camellia192 -> ByteString)
-> (ByteString -> Maybe (SecretKey Camellia192))
-> Encodable (SecretKey Camellia192)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: SecretKey Camellia192 -> ByteString
encode :: SecretKey Camellia192 -> ByteString
$cdecode :: ByteString -> Maybe (SecretKey Camellia192)
decode :: ByteString -> Maybe (SecretKey Camellia192)
Encodable)

pattern Camellia192SecretKey :: ByteString -> SecretKey Camellia192
pattern $mCamellia192SecretKey :: forall {r}.
SecretKey Camellia192 -> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia192SecretKey :: ByteString -> SecretKey Camellia192
Camellia192SecretKey bytes = MkCamellia192SecretKey (MkGSecretKey bytes)

getCamellia192SecretKey :: SecretKey Camellia192 -> ByteString
getCamellia192SecretKey :: SecretKey Camellia192 -> ByteString
getCamellia192SecretKey (Camellia192SecretKey ByteString
bs) = ByteString
bs

type Camellia192SecretKey = SecretKey Camellia192

newtype instance Ciphertext Camellia192 = MkCamellia192Ciphertext GCiphertext
    deriving newtype (Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
(Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool)
-> (Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool)
-> Eq (Ciphertext Camellia192)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
== :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
$c/= :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
/= :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
Eq, Eq (Ciphertext Camellia192)
Eq (Ciphertext Camellia192) =>
(Ciphertext Camellia192 -> Ciphertext Camellia192 -> Ordering)
-> (Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool)
-> (Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool)
-> (Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool)
-> (Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool)
-> (Ciphertext Camellia192
    -> Ciphertext Camellia192 -> Ciphertext Camellia192)
-> (Ciphertext Camellia192
    -> Ciphertext Camellia192 -> Ciphertext Camellia192)
-> Ord (Ciphertext Camellia192)
Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
Ciphertext Camellia192 -> Ciphertext Camellia192 -> Ordering
Ciphertext Camellia192
-> Ciphertext Camellia192 -> Ciphertext Camellia192
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 :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Ordering
compare :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Ordering
$c< :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
< :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
$c<= :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
<= :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
$c> :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
> :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
$c>= :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
>= :: Ciphertext Camellia192 -> Ciphertext Camellia192 -> Bool
$cmax :: Ciphertext Camellia192
-> Ciphertext Camellia192 -> Ciphertext Camellia192
max :: Ciphertext Camellia192
-> Ciphertext Camellia192 -> Ciphertext Camellia192
$cmin :: Ciphertext Camellia192
-> Ciphertext Camellia192 -> Ciphertext Camellia192
min :: Ciphertext Camellia192
-> Ciphertext Camellia192 -> Ciphertext Camellia192
Ord, Int -> Ciphertext Camellia192 -> ShowS
[Ciphertext Camellia192] -> ShowS
Ciphertext Camellia192 -> String
(Int -> Ciphertext Camellia192 -> ShowS)
-> (Ciphertext Camellia192 -> String)
-> ([Ciphertext Camellia192] -> ShowS)
-> Show (Ciphertext Camellia192)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Ciphertext Camellia192 -> ShowS
showsPrec :: Int -> Ciphertext Camellia192 -> ShowS
$cshow :: Ciphertext Camellia192 -> String
show :: Ciphertext Camellia192 -> String
$cshowList :: [Ciphertext Camellia192] -> ShowS
showList :: [Ciphertext Camellia192] -> ShowS
Show, ByteString -> Maybe (Ciphertext Camellia192)
Ciphertext Camellia192 -> ByteString
(Ciphertext Camellia192 -> ByteString)
-> (ByteString -> Maybe (Ciphertext Camellia192))
-> Encodable (Ciphertext Camellia192)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: Ciphertext Camellia192 -> ByteString
encode :: Ciphertext Camellia192 -> ByteString
$cdecode :: ByteString -> Maybe (Ciphertext Camellia192)
decode :: ByteString -> Maybe (Ciphertext Camellia192)
Encodable)

pattern Camellia192Ciphertext :: ByteString -> Ciphertext Camellia192
pattern $mCamellia192Ciphertext :: forall {r}.
Ciphertext Camellia192 -> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia192Ciphertext :: ByteString -> Ciphertext Camellia192
Camellia192Ciphertext bs = MkCamellia192Ciphertext (MkGCiphertext bs)

getCamellia192Ciphertext :: Ciphertext Camellia192 -> ByteString
getCamellia192Ciphertext :: Ciphertext Camellia192 -> ByteString
getCamellia192Ciphertext (Camellia192Ciphertext ByteString
bs) = ByteString
bs

type Camellia192Ciphertext = Ciphertext Camellia192

newtype instance LazyCiphertext Camellia192 = MkCamellia192LazyCiphertext GLazyCiphertext
    deriving newtype (LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
(LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool)
-> (LazyCiphertext Camellia192
    -> LazyCiphertext Camellia192 -> Bool)
-> Eq (LazyCiphertext Camellia192)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
== :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
$c/= :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
/= :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
Eq, Eq (LazyCiphertext Camellia192)
Eq (LazyCiphertext Camellia192) =>
(LazyCiphertext Camellia192
 -> LazyCiphertext Camellia192 -> Ordering)
-> (LazyCiphertext Camellia192
    -> LazyCiphertext Camellia192 -> Bool)
-> (LazyCiphertext Camellia192
    -> LazyCiphertext Camellia192 -> Bool)
-> (LazyCiphertext Camellia192
    -> LazyCiphertext Camellia192 -> Bool)
-> (LazyCiphertext Camellia192
    -> LazyCiphertext Camellia192 -> Bool)
-> (LazyCiphertext Camellia192
    -> LazyCiphertext Camellia192 -> LazyCiphertext Camellia192)
-> (LazyCiphertext Camellia192
    -> LazyCiphertext Camellia192 -> LazyCiphertext Camellia192)
-> Ord (LazyCiphertext Camellia192)
LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
LazyCiphertext Camellia192
-> LazyCiphertext Camellia192 -> Ordering
LazyCiphertext Camellia192
-> LazyCiphertext Camellia192 -> LazyCiphertext Camellia192
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 :: LazyCiphertext Camellia192
-> LazyCiphertext Camellia192 -> Ordering
compare :: LazyCiphertext Camellia192
-> LazyCiphertext Camellia192 -> Ordering
$c< :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
< :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
$c<= :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
<= :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
$c> :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
> :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
$c>= :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
>= :: LazyCiphertext Camellia192 -> LazyCiphertext Camellia192 -> Bool
$cmax :: LazyCiphertext Camellia192
-> LazyCiphertext Camellia192 -> LazyCiphertext Camellia192
max :: LazyCiphertext Camellia192
-> LazyCiphertext Camellia192 -> LazyCiphertext Camellia192
$cmin :: LazyCiphertext Camellia192
-> LazyCiphertext Camellia192 -> LazyCiphertext Camellia192
min :: LazyCiphertext Camellia192
-> LazyCiphertext Camellia192 -> LazyCiphertext Camellia192
Ord, Int -> LazyCiphertext Camellia192 -> ShowS
[LazyCiphertext Camellia192] -> ShowS
LazyCiphertext Camellia192 -> String
(Int -> LazyCiphertext Camellia192 -> ShowS)
-> (LazyCiphertext Camellia192 -> String)
-> ([LazyCiphertext Camellia192] -> ShowS)
-> Show (LazyCiphertext Camellia192)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LazyCiphertext Camellia192 -> ShowS
showsPrec :: Int -> LazyCiphertext Camellia192 -> ShowS
$cshow :: LazyCiphertext Camellia192 -> String
show :: LazyCiphertext Camellia192 -> String
$cshowList :: [LazyCiphertext Camellia192] -> ShowS
showList :: [LazyCiphertext Camellia192] -> ShowS
Show, ByteString -> Maybe (LazyCiphertext Camellia192)
LazyCiphertext Camellia192 -> ByteString
(LazyCiphertext Camellia192 -> ByteString)
-> (ByteString -> Maybe (LazyCiphertext Camellia192))
-> Encodable (LazyCiphertext Camellia192)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: LazyCiphertext Camellia192 -> ByteString
encode :: LazyCiphertext Camellia192 -> ByteString
$cdecode :: ByteString -> Maybe (LazyCiphertext Camellia192)
decode :: ByteString -> Maybe (LazyCiphertext Camellia192)
Encodable, Encodable (LazyCiphertext Camellia192)
ByteString -> Maybe (LazyCiphertext Camellia192)
LazyCiphertext Camellia192 -> ByteString
Encodable (LazyCiphertext Camellia192) =>
(LazyCiphertext Camellia192 -> ByteString)
-> (ByteString -> Maybe (LazyCiphertext Camellia192))
-> LazyEncodable (LazyCiphertext Camellia192)
forall a.
Encodable a =>
(a -> ByteString) -> (ByteString -> Maybe a) -> LazyEncodable a
$cencodeLazy :: LazyCiphertext Camellia192 -> ByteString
encodeLazy :: LazyCiphertext Camellia192 -> ByteString
$cdecodeLazy :: ByteString -> Maybe (LazyCiphertext Camellia192)
decodeLazy :: ByteString -> Maybe (LazyCiphertext Camellia192)
LazyEncodable)

pattern Camellia192LazyCiphertext :: Lazy.ByteString -> LazyCiphertext Camellia192
pattern $mCamellia192LazyCiphertext :: forall {r}.
LazyCiphertext Camellia192
-> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia192LazyCiphertext :: ByteString -> LazyCiphertext Camellia192
Camellia192LazyCiphertext lbs = MkCamellia192LazyCiphertext (MkGLazyCiphertext lbs)

getCamellia192LazyCiphertext :: LazyCiphertext Camellia192 -> Lazy.ByteString
getCamellia192LazyCiphertext :: LazyCiphertext Camellia192 -> ByteString
getCamellia192LazyCiphertext (Camellia192LazyCiphertext ByteString
bs) = ByteString
bs

type Camellia192LazyCiphertext = LazyCiphertext Camellia192

instance HasSecretKey Camellia192 where
    
    secretKeySpec :: SizeSpecifier (SecretKey Camellia192)
    secretKeySpec :: SizeSpecifier (SecretKey Camellia192)
secretKeySpec = SizeSpecifier () -> SizeSpecifier (SecretKey Camellia192)
forall a b. SizeSpecifier a -> SizeSpecifier b
coerceSizeSpec (SizeSpecifier () -> SizeSpecifier (SecretKey Camellia192))
-> SizeSpecifier () -> SizeSpecifier (SecretKey Camellia192)
forall a b. (a -> b) -> a -> b
$ BlockCipher -> SizeSpecifier ()
Botan.blockCipherKeySpec BlockCipher
Botan.camellia192

instance (MonadRandomIO m )=> SecretKeyGen Camellia192 m where

    newSecretKey :: MonadRandomIO m => m (SecretKey Camellia192)
    newSecretKey :: MonadRandomIO m => m (SecretKey Camellia192)
newSecretKey = ByteString -> SecretKey Camellia192
Camellia192SecretKey (ByteString -> SecretKey Camellia192)
-> m ByteString -> m (SecretKey Camellia192)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SizeSpecifier (SecretKey Camellia192) -> m ByteString
forall (m :: * -> *) a.
MonadRandomIO m =>
SizeSpecifier a -> m ByteString
newSized (forall alg. HasSecretKey alg => SizeSpecifier (SecretKey alg)
secretKeySpec @Camellia192)
    
    newSecretKeyMaybe :: MonadRandomIO m => Int -> m (Maybe (SecretKey Camellia192))
    newSecretKeyMaybe :: MonadRandomIO m => Int -> m (Maybe (SecretKey Camellia192))
newSecretKeyMaybe Int
i = (ByteString -> SecretKey Camellia192)
-> Maybe ByteString -> Maybe (SecretKey Camellia192)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> SecretKey Camellia192
Camellia192SecretKey (Maybe ByteString -> Maybe (SecretKey Camellia192))
-> m (Maybe ByteString) -> m (Maybe (SecretKey Camellia192))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SizeSpecifier (SecretKey Camellia192)
-> Int -> m (Maybe ByteString)
forall (m :: * -> *) a.
MonadRandomIO m =>
SizeSpecifier a -> Int -> m (Maybe ByteString)
newSizedMaybe (forall alg. HasSecretKey alg => SizeSpecifier (SecretKey alg)
secretKeySpec @Camellia192) Int
i

instance HasCiphertext Camellia192 where

instance BlockCipher Camellia192 where

    blockCipherEncrypt :: SecretKey Camellia192 -> ByteString -> Maybe (Ciphertext Camellia192)
    blockCipherEncrypt :: SecretKey Camellia192
-> ByteString -> Maybe (Ciphertext Camellia192)
blockCipherEncrypt (Camellia192SecretKey ByteString
k) = (ByteString -> Ciphertext Camellia192)
-> Maybe ByteString -> Maybe (Ciphertext Camellia192)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext Camellia192
Camellia192Ciphertext (Maybe ByteString -> Maybe (Ciphertext Camellia192))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext Camellia192)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.camellia192 ByteString
k

    blockCipherDecrypt :: SecretKey Camellia192 -> Ciphertext Camellia192 -> Maybe ByteString
    blockCipherDecrypt :: SecretKey Camellia192 -> Ciphertext Camellia192 -> Maybe ByteString
blockCipherDecrypt (Camellia192SecretKey ByteString
k) (Camellia192Ciphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.camellia192 ByteString
k ByteString
ct

instance HasLazyCiphertext Camellia192 where

instance IncrementalBlockCipher Camellia192 where

    blockCipherEncryptLazy :: SecretKey Camellia192 -> Lazy.ByteString -> Maybe (LazyCiphertext Camellia192)
    blockCipherEncryptLazy :: SecretKey Camellia192
-> ByteString -> Maybe (LazyCiphertext Camellia192)
blockCipherEncryptLazy (Camellia192SecretKey ByteString
k) = (ByteString -> LazyCiphertext Camellia192)
-> Maybe ByteString -> Maybe (LazyCiphertext Camellia192)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext Camellia192
Camellia192LazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext Camellia192))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext Camellia192)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.camellia192 ByteString
k

    blockCipherDecryptLazy :: SecretKey Camellia192 -> LazyCiphertext Camellia192 -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey Camellia192
-> LazyCiphertext Camellia192 -> Maybe ByteString
blockCipherDecryptLazy (Camellia192SecretKey ByteString
k) (Camellia192LazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.camellia192 ByteString
k ByteString
ct

-- Camellia blockCipher

camellia192Encrypt :: SecretKey Camellia192 -> ByteString -> Maybe Camellia192Ciphertext
camellia192Encrypt :: SecretKey Camellia192
-> ByteString -> Maybe (Ciphertext Camellia192)
camellia192Encrypt = SecretKey Camellia192
-> ByteString -> Maybe (Ciphertext Camellia192)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

camellia192Decrypt :: SecretKey Camellia192 -> Camellia192Ciphertext -> Maybe ByteString
camellia192Decrypt :: SecretKey Camellia192 -> Ciphertext Camellia192 -> Maybe ByteString
camellia192Decrypt = SecretKey Camellia192 -> Ciphertext Camellia192 -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

camellia192EncryptLazy :: SecretKey Camellia192 -> Lazy.ByteString -> Maybe Camellia192LazyCiphertext
camellia192EncryptLazy :: SecretKey Camellia192
-> ByteString -> Maybe (LazyCiphertext Camellia192)
camellia192EncryptLazy = SecretKey Camellia192
-> ByteString -> Maybe (LazyCiphertext Camellia192)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

camellia192DecryptLazy :: SecretKey Camellia192 -> Camellia192LazyCiphertext -> Maybe Lazy.ByteString
camellia192DecryptLazy :: SecretKey Camellia192
-> LazyCiphertext Camellia192 -> Maybe ByteString
camellia192DecryptLazy = SecretKey Camellia192
-> LazyCiphertext Camellia192 -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy

-- Camellia256 type

data Camellia256

newtype instance SecretKey Camellia256 = MkCamellia256SecretKey GSecretKey
    deriving newtype (SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
(SecretKey Camellia256 -> SecretKey Camellia256 -> Bool)
-> (SecretKey Camellia256 -> SecretKey Camellia256 -> Bool)
-> Eq (SecretKey Camellia256)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
== :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
$c/= :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
/= :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
Eq, Eq (SecretKey Camellia256)
Eq (SecretKey Camellia256) =>
(SecretKey Camellia256 -> SecretKey Camellia256 -> Ordering)
-> (SecretKey Camellia256 -> SecretKey Camellia256 -> Bool)
-> (SecretKey Camellia256 -> SecretKey Camellia256 -> Bool)
-> (SecretKey Camellia256 -> SecretKey Camellia256 -> Bool)
-> (SecretKey Camellia256 -> SecretKey Camellia256 -> Bool)
-> (SecretKey Camellia256
    -> SecretKey Camellia256 -> SecretKey Camellia256)
-> (SecretKey Camellia256
    -> SecretKey Camellia256 -> SecretKey Camellia256)
-> Ord (SecretKey Camellia256)
SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
SecretKey Camellia256 -> SecretKey Camellia256 -> Ordering
SecretKey Camellia256
-> SecretKey Camellia256 -> SecretKey Camellia256
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 :: SecretKey Camellia256 -> SecretKey Camellia256 -> Ordering
compare :: SecretKey Camellia256 -> SecretKey Camellia256 -> Ordering
$c< :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
< :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
$c<= :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
<= :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
$c> :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
> :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
$c>= :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
>= :: SecretKey Camellia256 -> SecretKey Camellia256 -> Bool
$cmax :: SecretKey Camellia256
-> SecretKey Camellia256 -> SecretKey Camellia256
max :: SecretKey Camellia256
-> SecretKey Camellia256 -> SecretKey Camellia256
$cmin :: SecretKey Camellia256
-> SecretKey Camellia256 -> SecretKey Camellia256
min :: SecretKey Camellia256
-> SecretKey Camellia256 -> SecretKey Camellia256
Ord, Int -> SecretKey Camellia256 -> ShowS
[SecretKey Camellia256] -> ShowS
SecretKey Camellia256 -> String
(Int -> SecretKey Camellia256 -> ShowS)
-> (SecretKey Camellia256 -> String)
-> ([SecretKey Camellia256] -> ShowS)
-> Show (SecretKey Camellia256)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SecretKey Camellia256 -> ShowS
showsPrec :: Int -> SecretKey Camellia256 -> ShowS
$cshow :: SecretKey Camellia256 -> String
show :: SecretKey Camellia256 -> String
$cshowList :: [SecretKey Camellia256] -> ShowS
showList :: [SecretKey Camellia256] -> ShowS
Show, ByteString -> Maybe (SecretKey Camellia256)
SecretKey Camellia256 -> ByteString
(SecretKey Camellia256 -> ByteString)
-> (ByteString -> Maybe (SecretKey Camellia256))
-> Encodable (SecretKey Camellia256)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: SecretKey Camellia256 -> ByteString
encode :: SecretKey Camellia256 -> ByteString
$cdecode :: ByteString -> Maybe (SecretKey Camellia256)
decode :: ByteString -> Maybe (SecretKey Camellia256)
Encodable)

pattern Camellia256SecretKey :: ByteString -> SecretKey Camellia256
pattern $mCamellia256SecretKey :: forall {r}.
SecretKey Camellia256 -> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia256SecretKey :: ByteString -> SecretKey Camellia256
Camellia256SecretKey bytes = MkCamellia256SecretKey (MkGSecretKey bytes)

getCamellia256SecretKey :: SecretKey Camellia256 -> ByteString
getCamellia256SecretKey :: SecretKey Camellia256 -> ByteString
getCamellia256SecretKey (Camellia256SecretKey ByteString
bs) = ByteString
bs

type Camellia256SecretKey = SecretKey Camellia256

newtype instance Ciphertext Camellia256 = MkCamellia256Ciphertext GCiphertext
    deriving newtype (Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
(Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool)
-> (Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool)
-> Eq (Ciphertext Camellia256)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
== :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
$c/= :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
/= :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
Eq, Eq (Ciphertext Camellia256)
Eq (Ciphertext Camellia256) =>
(Ciphertext Camellia256 -> Ciphertext Camellia256 -> Ordering)
-> (Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool)
-> (Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool)
-> (Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool)
-> (Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool)
-> (Ciphertext Camellia256
    -> Ciphertext Camellia256 -> Ciphertext Camellia256)
-> (Ciphertext Camellia256
    -> Ciphertext Camellia256 -> Ciphertext Camellia256)
-> Ord (Ciphertext Camellia256)
Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
Ciphertext Camellia256 -> Ciphertext Camellia256 -> Ordering
Ciphertext Camellia256
-> Ciphertext Camellia256 -> Ciphertext Camellia256
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 :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Ordering
compare :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Ordering
$c< :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
< :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
$c<= :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
<= :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
$c> :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
> :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
$c>= :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
>= :: Ciphertext Camellia256 -> Ciphertext Camellia256 -> Bool
$cmax :: Ciphertext Camellia256
-> Ciphertext Camellia256 -> Ciphertext Camellia256
max :: Ciphertext Camellia256
-> Ciphertext Camellia256 -> Ciphertext Camellia256
$cmin :: Ciphertext Camellia256
-> Ciphertext Camellia256 -> Ciphertext Camellia256
min :: Ciphertext Camellia256
-> Ciphertext Camellia256 -> Ciphertext Camellia256
Ord, Int -> Ciphertext Camellia256 -> ShowS
[Ciphertext Camellia256] -> ShowS
Ciphertext Camellia256 -> String
(Int -> Ciphertext Camellia256 -> ShowS)
-> (Ciphertext Camellia256 -> String)
-> ([Ciphertext Camellia256] -> ShowS)
-> Show (Ciphertext Camellia256)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Ciphertext Camellia256 -> ShowS
showsPrec :: Int -> Ciphertext Camellia256 -> ShowS
$cshow :: Ciphertext Camellia256 -> String
show :: Ciphertext Camellia256 -> String
$cshowList :: [Ciphertext Camellia256] -> ShowS
showList :: [Ciphertext Camellia256] -> ShowS
Show, ByteString -> Maybe (Ciphertext Camellia256)
Ciphertext Camellia256 -> ByteString
(Ciphertext Camellia256 -> ByteString)
-> (ByteString -> Maybe (Ciphertext Camellia256))
-> Encodable (Ciphertext Camellia256)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: Ciphertext Camellia256 -> ByteString
encode :: Ciphertext Camellia256 -> ByteString
$cdecode :: ByteString -> Maybe (Ciphertext Camellia256)
decode :: ByteString -> Maybe (Ciphertext Camellia256)
Encodable)

pattern Camellia256Ciphertext :: ByteString -> Ciphertext Camellia256
pattern $mCamellia256Ciphertext :: forall {r}.
Ciphertext Camellia256 -> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia256Ciphertext :: ByteString -> Ciphertext Camellia256
Camellia256Ciphertext bs = MkCamellia256Ciphertext (MkGCiphertext bs)

getCamellia256Ciphertext :: Ciphertext Camellia256 -> ByteString
getCamellia256Ciphertext :: Ciphertext Camellia256 -> ByteString
getCamellia256Ciphertext (Camellia256Ciphertext ByteString
bs) = ByteString
bs

type Camellia256Ciphertext = Ciphertext Camellia256

newtype instance LazyCiphertext Camellia256 = MkCamellia256LazyCiphertext GLazyCiphertext
    deriving newtype (LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
(LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool)
-> (LazyCiphertext Camellia256
    -> LazyCiphertext Camellia256 -> Bool)
-> Eq (LazyCiphertext Camellia256)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
== :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
$c/= :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
/= :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
Eq, Eq (LazyCiphertext Camellia256)
Eq (LazyCiphertext Camellia256) =>
(LazyCiphertext Camellia256
 -> LazyCiphertext Camellia256 -> Ordering)
-> (LazyCiphertext Camellia256
    -> LazyCiphertext Camellia256 -> Bool)
-> (LazyCiphertext Camellia256
    -> LazyCiphertext Camellia256 -> Bool)
-> (LazyCiphertext Camellia256
    -> LazyCiphertext Camellia256 -> Bool)
-> (LazyCiphertext Camellia256
    -> LazyCiphertext Camellia256 -> Bool)
-> (LazyCiphertext Camellia256
    -> LazyCiphertext Camellia256 -> LazyCiphertext Camellia256)
-> (LazyCiphertext Camellia256
    -> LazyCiphertext Camellia256 -> LazyCiphertext Camellia256)
-> Ord (LazyCiphertext Camellia256)
LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
LazyCiphertext Camellia256
-> LazyCiphertext Camellia256 -> Ordering
LazyCiphertext Camellia256
-> LazyCiphertext Camellia256 -> LazyCiphertext Camellia256
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 :: LazyCiphertext Camellia256
-> LazyCiphertext Camellia256 -> Ordering
compare :: LazyCiphertext Camellia256
-> LazyCiphertext Camellia256 -> Ordering
$c< :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
< :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
$c<= :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
<= :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
$c> :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
> :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
$c>= :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
>= :: LazyCiphertext Camellia256 -> LazyCiphertext Camellia256 -> Bool
$cmax :: LazyCiphertext Camellia256
-> LazyCiphertext Camellia256 -> LazyCiphertext Camellia256
max :: LazyCiphertext Camellia256
-> LazyCiphertext Camellia256 -> LazyCiphertext Camellia256
$cmin :: LazyCiphertext Camellia256
-> LazyCiphertext Camellia256 -> LazyCiphertext Camellia256
min :: LazyCiphertext Camellia256
-> LazyCiphertext Camellia256 -> LazyCiphertext Camellia256
Ord, Int -> LazyCiphertext Camellia256 -> ShowS
[LazyCiphertext Camellia256] -> ShowS
LazyCiphertext Camellia256 -> String
(Int -> LazyCiphertext Camellia256 -> ShowS)
-> (LazyCiphertext Camellia256 -> String)
-> ([LazyCiphertext Camellia256] -> ShowS)
-> Show (LazyCiphertext Camellia256)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LazyCiphertext Camellia256 -> ShowS
showsPrec :: Int -> LazyCiphertext Camellia256 -> ShowS
$cshow :: LazyCiphertext Camellia256 -> String
show :: LazyCiphertext Camellia256 -> String
$cshowList :: [LazyCiphertext Camellia256] -> ShowS
showList :: [LazyCiphertext Camellia256] -> ShowS
Show, ByteString -> Maybe (LazyCiphertext Camellia256)
LazyCiphertext Camellia256 -> ByteString
(LazyCiphertext Camellia256 -> ByteString)
-> (ByteString -> Maybe (LazyCiphertext Camellia256))
-> Encodable (LazyCiphertext Camellia256)
forall a.
(a -> ByteString) -> (ByteString -> Maybe a) -> Encodable a
$cencode :: LazyCiphertext Camellia256 -> ByteString
encode :: LazyCiphertext Camellia256 -> ByteString
$cdecode :: ByteString -> Maybe (LazyCiphertext Camellia256)
decode :: ByteString -> Maybe (LazyCiphertext Camellia256)
Encodable, Encodable (LazyCiphertext Camellia256)
ByteString -> Maybe (LazyCiphertext Camellia256)
LazyCiphertext Camellia256 -> ByteString
Encodable (LazyCiphertext Camellia256) =>
(LazyCiphertext Camellia256 -> ByteString)
-> (ByteString -> Maybe (LazyCiphertext Camellia256))
-> LazyEncodable (LazyCiphertext Camellia256)
forall a.
Encodable a =>
(a -> ByteString) -> (ByteString -> Maybe a) -> LazyEncodable a
$cencodeLazy :: LazyCiphertext Camellia256 -> ByteString
encodeLazy :: LazyCiphertext Camellia256 -> ByteString
$cdecodeLazy :: ByteString -> Maybe (LazyCiphertext Camellia256)
decodeLazy :: ByteString -> Maybe (LazyCiphertext Camellia256)
LazyEncodable)

pattern Camellia256LazyCiphertext :: Lazy.ByteString -> LazyCiphertext Camellia256
pattern $mCamellia256LazyCiphertext :: forall {r}.
LazyCiphertext Camellia256
-> (ByteString -> r) -> ((# #) -> r) -> r
$bCamellia256LazyCiphertext :: ByteString -> LazyCiphertext Camellia256
Camellia256LazyCiphertext lbs = MkCamellia256LazyCiphertext (MkGLazyCiphertext lbs)

getCamellia256LazyCiphertext :: LazyCiphertext Camellia256 -> Lazy.ByteString
getCamellia256LazyCiphertext :: LazyCiphertext Camellia256 -> ByteString
getCamellia256LazyCiphertext (Camellia256LazyCiphertext ByteString
bs) = ByteString
bs

type Camellia256LazyCiphertext = LazyCiphertext Camellia256

instance HasSecretKey Camellia256 where
    
    secretKeySpec :: SizeSpecifier (SecretKey Camellia256)
    secretKeySpec :: SizeSpecifier (SecretKey Camellia256)
secretKeySpec = SizeSpecifier () -> SizeSpecifier (SecretKey Camellia256)
forall a b. SizeSpecifier a -> SizeSpecifier b
coerceSizeSpec (SizeSpecifier () -> SizeSpecifier (SecretKey Camellia256))
-> SizeSpecifier () -> SizeSpecifier (SecretKey Camellia256)
forall a b. (a -> b) -> a -> b
$ BlockCipher -> SizeSpecifier ()
Botan.blockCipherKeySpec BlockCipher
Botan.camellia256

instance (MonadRandomIO m )=> SecretKeyGen Camellia256 m where

    newSecretKey :: MonadRandomIO m => m (SecretKey Camellia256)
    newSecretKey :: MonadRandomIO m => m (SecretKey Camellia256)
newSecretKey = ByteString -> SecretKey Camellia256
Camellia256SecretKey (ByteString -> SecretKey Camellia256)
-> m ByteString -> m (SecretKey Camellia256)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SizeSpecifier (SecretKey Camellia256) -> m ByteString
forall (m :: * -> *) a.
MonadRandomIO m =>
SizeSpecifier a -> m ByteString
newSized (forall alg. HasSecretKey alg => SizeSpecifier (SecretKey alg)
secretKeySpec @Camellia256)
    
    newSecretKeyMaybe :: MonadRandomIO m => Int -> m (Maybe (SecretKey Camellia256))
    newSecretKeyMaybe :: MonadRandomIO m => Int -> m (Maybe (SecretKey Camellia256))
newSecretKeyMaybe Int
i = (ByteString -> SecretKey Camellia256)
-> Maybe ByteString -> Maybe (SecretKey Camellia256)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> SecretKey Camellia256
Camellia256SecretKey (Maybe ByteString -> Maybe (SecretKey Camellia256))
-> m (Maybe ByteString) -> m (Maybe (SecretKey Camellia256))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SizeSpecifier (SecretKey Camellia256)
-> Int -> m (Maybe ByteString)
forall (m :: * -> *) a.
MonadRandomIO m =>
SizeSpecifier a -> Int -> m (Maybe ByteString)
newSizedMaybe (forall alg. HasSecretKey alg => SizeSpecifier (SecretKey alg)
secretKeySpec @Camellia256) Int
i

instance HasCiphertext Camellia256 where

instance BlockCipher Camellia256 where

    blockCipherEncrypt :: SecretKey Camellia256 -> ByteString -> Maybe (Ciphertext Camellia256)
    blockCipherEncrypt :: SecretKey Camellia256
-> ByteString -> Maybe (Ciphertext Camellia256)
blockCipherEncrypt (Camellia256SecretKey ByteString
k) = (ByteString -> Ciphertext Camellia256)
-> Maybe ByteString -> Maybe (Ciphertext Camellia256)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext Camellia256
Camellia256Ciphertext (Maybe ByteString -> Maybe (Ciphertext Camellia256))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext Camellia256)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.camellia256 ByteString
k

    blockCipherDecrypt :: SecretKey Camellia256 -> Ciphertext Camellia256 -> Maybe ByteString
    blockCipherDecrypt :: SecretKey Camellia256 -> Ciphertext Camellia256 -> Maybe ByteString
blockCipherDecrypt (Camellia256SecretKey ByteString
k) (Camellia256Ciphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.camellia256 ByteString
k ByteString
ct

instance HasLazyCiphertext Camellia256 where

instance IncrementalBlockCipher Camellia256 where

    blockCipherEncryptLazy :: SecretKey Camellia256 -> Lazy.ByteString -> Maybe (LazyCiphertext Camellia256)
    blockCipherEncryptLazy :: SecretKey Camellia256
-> ByteString -> Maybe (LazyCiphertext Camellia256)
blockCipherEncryptLazy (Camellia256SecretKey ByteString
k) = (ByteString -> LazyCiphertext Camellia256)
-> Maybe ByteString -> Maybe (LazyCiphertext Camellia256)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext Camellia256
Camellia256LazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext Camellia256))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext Camellia256)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.camellia256 ByteString
k

    blockCipherDecryptLazy :: SecretKey Camellia256 -> LazyCiphertext Camellia256 -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey Camellia256
-> LazyCiphertext Camellia256 -> Maybe ByteString
blockCipherDecryptLazy (Camellia256SecretKey ByteString
k) (Camellia256LazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.camellia256 ByteString
k ByteString
ct

-- Camellia blockCipher

camellia256Encrypt :: SecretKey Camellia256 -> ByteString -> Maybe Camellia256Ciphertext
camellia256Encrypt :: SecretKey Camellia256
-> ByteString -> Maybe (Ciphertext Camellia256)
camellia256Encrypt = SecretKey Camellia256
-> ByteString -> Maybe (Ciphertext Camellia256)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

camellia256Decrypt :: SecretKey Camellia256 -> Camellia256Ciphertext -> Maybe ByteString
camellia256Decrypt :: SecretKey Camellia256 -> Ciphertext Camellia256 -> Maybe ByteString
camellia256Decrypt = SecretKey Camellia256 -> Ciphertext Camellia256 -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

camellia256EncryptLazy :: SecretKey Camellia256 -> Lazy.ByteString -> Maybe Camellia256LazyCiphertext
camellia256EncryptLazy :: SecretKey Camellia256
-> ByteString -> Maybe (LazyCiphertext Camellia256)
camellia256EncryptLazy = SecretKey Camellia256
-> ByteString -> Maybe (LazyCiphertext Camellia256)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

camellia256DecryptLazy :: SecretKey Camellia256 -> Camellia256LazyCiphertext -> Maybe Lazy.ByteString
camellia256DecryptLazy :: SecretKey Camellia256
-> LazyCiphertext Camellia256 -> Maybe ByteString
camellia256DecryptLazy = SecretKey Camellia256
-> LazyCiphertext Camellia256 -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy

-- Temporary BlockCipher128 conformance

instance BlockCipher128 Camellia128 where
instance IncrementalBlockCipher128 Camellia128 where
instance BlockCipher128 Camellia192 where
instance IncrementalBlockCipher128 Camellia192 where
instance BlockCipher128 Camellia256 where
instance IncrementalBlockCipher128 Camellia256 where