module Botan.BlockCipher.AES
( AES128(..)
, AES128SecretKey(..)
, pattern AES128SecretKey
, getAES128SecretKey
, AES128Ciphertext(..)
, aes128Encrypt
, aes128Decrypt
, aes128EncryptLazy
, aes128DecryptLazy
, AES192(..)
, AES192SecretKey(..)
, pattern AES192SecretKey
, getAES192SecretKey
, AES192Ciphertext(..)
, aes192Encrypt
, aes192Decrypt
, aes192EncryptLazy
, aes192DecryptLazy
, AES256(..)
, AES256SecretKey(..)
, pattern AES256SecretKey
, getAES256SecretKey
, AES256Ciphertext(..)
, aes256Encrypt
, aes256Decrypt
, aes256EncryptLazy
, aes256DecryptLazy
) 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

-- AES128 type

data AES128

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

pattern AES128SecretKey :: ByteString -> SecretKey AES128
pattern $mAES128SecretKey :: forall {r}.
SecretKey AES128 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES128SecretKey :: ByteString -> SecretKey AES128
AES128SecretKey bytes = MkAES128SecretKey (MkGSecretKey bytes)

getAES128SecretKey :: SecretKey AES128 -> ByteString
getAES128SecretKey :: SecretKey AES128 -> ByteString
getAES128SecretKey (AES128SecretKey ByteString
bs) = ByteString
bs

type AES128SecretKey = SecretKey AES128

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

pattern AES128Ciphertext :: ByteString -> Ciphertext AES128
pattern $mAES128Ciphertext :: forall {r}.
Ciphertext AES128 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES128Ciphertext :: ByteString -> Ciphertext AES128
AES128Ciphertext bs = MkAES128Ciphertext (MkGCiphertext bs)

getAES128Ciphertext :: Ciphertext AES128 -> ByteString
getAES128Ciphertext :: Ciphertext AES128 -> ByteString
getAES128Ciphertext (AES128Ciphertext ByteString
bs) = ByteString
bs

type AES128Ciphertext = Ciphertext AES128

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

pattern AES128LazyCiphertext :: Lazy.ByteString -> LazyCiphertext AES128
pattern $mAES128LazyCiphertext :: forall {r}.
LazyCiphertext AES128 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES128LazyCiphertext :: ByteString -> LazyCiphertext AES128
AES128LazyCiphertext lbs = MkAES128LazyCiphertext (MkGLazyCiphertext lbs)

getAES128LazyCiphertext :: LazyCiphertext AES128 -> Lazy.ByteString
getAES128LazyCiphertext :: LazyCiphertext AES128 -> ByteString
getAES128LazyCiphertext (AES128LazyCiphertext ByteString
bs) = ByteString
bs

type AES128LazyCiphertext = LazyCiphertext AES128

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

instance (MonadRandomIO m )=> SecretKeyGen AES128 m where

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

instance HasCiphertext AES128 where

instance BlockCipher AES128 where

    blockCipherEncrypt :: SecretKey AES128 -> ByteString -> Maybe (Ciphertext AES128)
    blockCipherEncrypt :: SecretKey AES128 -> ByteString -> Maybe (Ciphertext AES128)
blockCipherEncrypt (AES128SecretKey ByteString
k) = (ByteString -> Ciphertext AES128)
-> Maybe ByteString -> Maybe (Ciphertext AES128)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext AES128
AES128Ciphertext (Maybe ByteString -> Maybe (Ciphertext AES128))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext AES128)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.aes128 ByteString
k

    blockCipherDecrypt :: SecretKey AES128 -> Ciphertext AES128 -> Maybe ByteString
    blockCipherDecrypt :: SecretKey AES128 -> Ciphertext AES128 -> Maybe ByteString
blockCipherDecrypt (AES128SecretKey ByteString
k) (AES128Ciphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.aes128 ByteString
k ByteString
ct

instance HasLazyCiphertext AES128 where

instance IncrementalBlockCipher AES128 where

    blockCipherEncryptLazy :: SecretKey AES128 -> Lazy.ByteString -> Maybe (LazyCiphertext AES128)
    blockCipherEncryptLazy :: SecretKey AES128 -> ByteString -> Maybe (LazyCiphertext AES128)
blockCipherEncryptLazy (AES128SecretKey ByteString
k) = (ByteString -> LazyCiphertext AES128)
-> Maybe ByteString -> Maybe (LazyCiphertext AES128)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext AES128
AES128LazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext AES128))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext AES128)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.aes128 ByteString
k

    blockCipherDecryptLazy :: SecretKey AES128 -> LazyCiphertext AES128 -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey AES128 -> LazyCiphertext AES128 -> Maybe ByteString
blockCipherDecryptLazy (AES128SecretKey ByteString
k) (AES128LazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.aes128 ByteString
k ByteString
ct

-- AES blockCipher

aes128Encrypt :: SecretKey AES128 -> ByteString -> Maybe AES128Ciphertext
aes128Encrypt :: SecretKey AES128 -> ByteString -> Maybe (Ciphertext AES128)
aes128Encrypt = SecretKey AES128 -> ByteString -> Maybe (Ciphertext AES128)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

aes128Decrypt :: SecretKey AES128 -> AES128Ciphertext -> Maybe ByteString
aes128Decrypt :: SecretKey AES128 -> Ciphertext AES128 -> Maybe ByteString
aes128Decrypt = SecretKey AES128 -> Ciphertext AES128 -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

aes128EncryptLazy :: SecretKey AES128 -> Lazy.ByteString -> Maybe AES128LazyCiphertext
aes128EncryptLazy :: SecretKey AES128 -> ByteString -> Maybe (LazyCiphertext AES128)
aes128EncryptLazy = SecretKey AES128 -> ByteString -> Maybe (LazyCiphertext AES128)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

aes128DecryptLazy :: SecretKey AES128 -> AES128LazyCiphertext -> Maybe Lazy.ByteString
aes128DecryptLazy :: SecretKey AES128 -> LazyCiphertext AES128 -> Maybe ByteString
aes128DecryptLazy = SecretKey AES128 -> LazyCiphertext AES128 -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy

-- AES192 type

data AES192

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

pattern AES192SecretKey :: ByteString -> SecretKey AES192
pattern $mAES192SecretKey :: forall {r}.
SecretKey AES192 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES192SecretKey :: ByteString -> SecretKey AES192
AES192SecretKey bytes = MkAES192SecretKey (MkGSecretKey bytes)

getAES192SecretKey :: SecretKey AES192 -> ByteString
getAES192SecretKey :: SecretKey AES192 -> ByteString
getAES192SecretKey (AES192SecretKey ByteString
bs) = ByteString
bs

type AES192SecretKey = SecretKey AES192

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

pattern AES192Ciphertext :: ByteString -> Ciphertext AES192
pattern $mAES192Ciphertext :: forall {r}.
Ciphertext AES192 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES192Ciphertext :: ByteString -> Ciphertext AES192
AES192Ciphertext bs = MkAES192Ciphertext (MkGCiphertext bs)

getAES192Ciphertext :: Ciphertext AES192 -> ByteString
getAES192Ciphertext :: Ciphertext AES192 -> ByteString
getAES192Ciphertext (AES192Ciphertext ByteString
bs) = ByteString
bs

type AES192Ciphertext = Ciphertext AES192

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

pattern AES192LazyCiphertext :: Lazy.ByteString -> LazyCiphertext AES192
pattern $mAES192LazyCiphertext :: forall {r}.
LazyCiphertext AES192 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES192LazyCiphertext :: ByteString -> LazyCiphertext AES192
AES192LazyCiphertext lbs = MkAES192LazyCiphertext (MkGLazyCiphertext lbs)

getAES192LazyCiphertext :: LazyCiphertext AES192 -> Lazy.ByteString
getAES192LazyCiphertext :: LazyCiphertext AES192 -> ByteString
getAES192LazyCiphertext (AES192LazyCiphertext ByteString
bs) = ByteString
bs

type AES192LazyCiphertext = LazyCiphertext AES192

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

instance (MonadRandomIO m )=> SecretKeyGen AES192 m where

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

instance HasCiphertext AES192 where

instance BlockCipher AES192 where

    blockCipherEncrypt :: SecretKey AES192 -> ByteString -> Maybe (Ciphertext AES192)
    blockCipherEncrypt :: SecretKey AES192 -> ByteString -> Maybe (Ciphertext AES192)
blockCipherEncrypt (AES192SecretKey ByteString
k) = (ByteString -> Ciphertext AES192)
-> Maybe ByteString -> Maybe (Ciphertext AES192)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext AES192
AES192Ciphertext (Maybe ByteString -> Maybe (Ciphertext AES192))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext AES192)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.aes192 ByteString
k

    blockCipherDecrypt :: SecretKey AES192 -> Ciphertext AES192 -> Maybe ByteString
    blockCipherDecrypt :: SecretKey AES192 -> Ciphertext AES192 -> Maybe ByteString
blockCipherDecrypt (AES192SecretKey ByteString
k) (AES192Ciphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.aes192 ByteString
k ByteString
ct

instance HasLazyCiphertext AES192 where

instance IncrementalBlockCipher AES192 where

    blockCipherEncryptLazy :: SecretKey AES192 -> Lazy.ByteString -> Maybe (LazyCiphertext AES192)
    blockCipherEncryptLazy :: SecretKey AES192 -> ByteString -> Maybe (LazyCiphertext AES192)
blockCipherEncryptLazy (AES192SecretKey ByteString
k) = (ByteString -> LazyCiphertext AES192)
-> Maybe ByteString -> Maybe (LazyCiphertext AES192)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext AES192
AES192LazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext AES192))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext AES192)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.aes192 ByteString
k

    blockCipherDecryptLazy :: SecretKey AES192 -> LazyCiphertext AES192 -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey AES192 -> LazyCiphertext AES192 -> Maybe ByteString
blockCipherDecryptLazy (AES192SecretKey ByteString
k) (AES192LazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.aes192 ByteString
k ByteString
ct

-- AES blockCipher

aes192Encrypt :: SecretKey AES192 -> ByteString -> Maybe AES192Ciphertext
aes192Encrypt :: SecretKey AES192 -> ByteString -> Maybe (Ciphertext AES192)
aes192Encrypt = SecretKey AES192 -> ByteString -> Maybe (Ciphertext AES192)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

aes192Decrypt :: SecretKey AES192 -> AES192Ciphertext -> Maybe ByteString
aes192Decrypt :: SecretKey AES192 -> Ciphertext AES192 -> Maybe ByteString
aes192Decrypt = SecretKey AES192 -> Ciphertext AES192 -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

aes192EncryptLazy :: SecretKey AES192 -> Lazy.ByteString -> Maybe AES192LazyCiphertext
aes192EncryptLazy :: SecretKey AES192 -> ByteString -> Maybe (LazyCiphertext AES192)
aes192EncryptLazy = SecretKey AES192 -> ByteString -> Maybe (LazyCiphertext AES192)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

aes192DecryptLazy :: SecretKey AES192 -> AES192LazyCiphertext -> Maybe Lazy.ByteString
aes192DecryptLazy :: SecretKey AES192 -> LazyCiphertext AES192 -> Maybe ByteString
aes192DecryptLazy = SecretKey AES192 -> LazyCiphertext AES192 -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy

-- AES256 type

data AES256

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

pattern AES256SecretKey :: ByteString -> SecretKey AES256
pattern $mAES256SecretKey :: forall {r}.
SecretKey AES256 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES256SecretKey :: ByteString -> SecretKey AES256
AES256SecretKey bytes = MkAES256SecretKey (MkGSecretKey bytes)

getAES256SecretKey :: SecretKey AES256 -> ByteString
getAES256SecretKey :: SecretKey AES256 -> ByteString
getAES256SecretKey (AES256SecretKey ByteString
bs) = ByteString
bs

type AES256SecretKey = SecretKey AES256

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

pattern AES256Ciphertext :: ByteString -> Ciphertext AES256
pattern $mAES256Ciphertext :: forall {r}.
Ciphertext AES256 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES256Ciphertext :: ByteString -> Ciphertext AES256
AES256Ciphertext bs = MkAES256Ciphertext (MkGCiphertext bs)

getAES256Ciphertext :: Ciphertext AES256 -> ByteString
getAES256Ciphertext :: Ciphertext AES256 -> ByteString
getAES256Ciphertext (AES256Ciphertext ByteString
bs) = ByteString
bs

type AES256Ciphertext = Ciphertext AES256

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

pattern AES256LazyCiphertext :: Lazy.ByteString -> LazyCiphertext AES256
pattern $mAES256LazyCiphertext :: forall {r}.
LazyCiphertext AES256 -> (ByteString -> r) -> ((# #) -> r) -> r
$bAES256LazyCiphertext :: ByteString -> LazyCiphertext AES256
AES256LazyCiphertext lbs = MkAES256LazyCiphertext (MkGLazyCiphertext lbs)

getAES256LazyCiphertext :: LazyCiphertext AES256 -> Lazy.ByteString
getAES256LazyCiphertext :: LazyCiphertext AES256 -> ByteString
getAES256LazyCiphertext (AES256LazyCiphertext ByteString
bs) = ByteString
bs

type AES256LazyCiphertext = LazyCiphertext AES256

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

instance (MonadRandomIO m )=> SecretKeyGen AES256 m where

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

instance HasCiphertext AES256 where

instance BlockCipher AES256 where

    blockCipherEncrypt :: SecretKey AES256 -> ByteString -> Maybe (Ciphertext AES256)
    blockCipherEncrypt :: SecretKey AES256 -> ByteString -> Maybe (Ciphertext AES256)
blockCipherEncrypt (AES256SecretKey ByteString
k) = (ByteString -> Ciphertext AES256)
-> Maybe ByteString -> Maybe (Ciphertext AES256)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext AES256
AES256Ciphertext (Maybe ByteString -> Maybe (Ciphertext AES256))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext AES256)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.aes256 ByteString
k

    blockCipherDecrypt :: SecretKey AES256 -> Ciphertext AES256 -> Maybe ByteString
    blockCipherDecrypt :: SecretKey AES256 -> Ciphertext AES256 -> Maybe ByteString
blockCipherDecrypt (AES256SecretKey ByteString
k) (AES256Ciphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.aes256 ByteString
k ByteString
ct

instance HasLazyCiphertext AES256 where

instance IncrementalBlockCipher AES256 where

    blockCipherEncryptLazy :: SecretKey AES256 -> Lazy.ByteString -> Maybe (LazyCiphertext AES256)
    blockCipherEncryptLazy :: SecretKey AES256 -> ByteString -> Maybe (LazyCiphertext AES256)
blockCipherEncryptLazy (AES256SecretKey ByteString
k) = (ByteString -> LazyCiphertext AES256)
-> Maybe ByteString -> Maybe (LazyCiphertext AES256)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext AES256
AES256LazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext AES256))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext AES256)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.aes256 ByteString
k

    blockCipherDecryptLazy :: SecretKey AES256 -> LazyCiphertext AES256 -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey AES256 -> LazyCiphertext AES256 -> Maybe ByteString
blockCipherDecryptLazy (AES256SecretKey ByteString
k) (AES256LazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.aes256 ByteString
k ByteString
ct

-- AES blockCipher

aes256Encrypt :: SecretKey AES256 -> ByteString -> Maybe AES256Ciphertext
aes256Encrypt :: SecretKey AES256 -> ByteString -> Maybe (Ciphertext AES256)
aes256Encrypt = SecretKey AES256 -> ByteString -> Maybe (Ciphertext AES256)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

aes256Decrypt :: SecretKey AES256 -> AES256Ciphertext -> Maybe ByteString
aes256Decrypt :: SecretKey AES256 -> Ciphertext AES256 -> Maybe ByteString
aes256Decrypt = SecretKey AES256 -> Ciphertext AES256 -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

aes256EncryptLazy :: SecretKey AES256 -> Lazy.ByteString -> Maybe AES256LazyCiphertext
aes256EncryptLazy :: SecretKey AES256 -> ByteString -> Maybe (LazyCiphertext AES256)
aes256EncryptLazy = SecretKey AES256 -> ByteString -> Maybe (LazyCiphertext AES256)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

aes256DecryptLazy :: SecretKey AES256 -> AES256LazyCiphertext -> Maybe Lazy.ByteString
aes256DecryptLazy :: SecretKey AES256 -> LazyCiphertext AES256 -> Maybe ByteString
aes256DecryptLazy = SecretKey AES256 -> LazyCiphertext AES256 -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy

-- Temporary BlockCipher128 conformance

instance BlockCipher128 AES128 where
instance IncrementalBlockCipher128 AES128 where
instance BlockCipher128 AES192 where
instance IncrementalBlockCipher128 AES192 where
instance BlockCipher128 AES256 where
instance IncrementalBlockCipher128 AES256 where