module Botan.BlockCipher.Serpent
( Serpent(..)
, SerpentSecretKey(..)
, pattern SerpentSecretKey
, getSerpentSecretKey
, SerpentCiphertext(..)
, serpentEncrypt
, serpentDecrypt
, serpentEncryptLazy
, serpentDecryptLazy
) 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

-- Serpent type

data Serpent

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

pattern SerpentSecretKey :: ByteString -> SecretKey Serpent
pattern $mSerpentSecretKey :: forall {r}.
SecretKey Serpent -> (ByteString -> r) -> ((# #) -> r) -> r
$bSerpentSecretKey :: ByteString -> SecretKey Serpent
SerpentSecretKey bytes = MkSerpentSecretKey (MkGSecretKey bytes)

getSerpentSecretKey :: SecretKey Serpent -> ByteString
getSerpentSecretKey :: SecretKey Serpent -> ByteString
getSerpentSecretKey (SerpentSecretKey ByteString
bs) = ByteString
bs

type SerpentSecretKey = SecretKey Serpent

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

pattern SerpentCiphertext :: ByteString -> Ciphertext Serpent
pattern $mSerpentCiphertext :: forall {r}.
Ciphertext Serpent -> (ByteString -> r) -> ((# #) -> r) -> r
$bSerpentCiphertext :: ByteString -> Ciphertext Serpent
SerpentCiphertext bs = MkSerpentCiphertext (MkGCiphertext bs)

getSerpentCiphertext :: Ciphertext Serpent -> ByteString
getSerpentCiphertext :: Ciphertext Serpent -> ByteString
getSerpentCiphertext (SerpentCiphertext ByteString
bs) = ByteString
bs

type SerpentCiphertext = Ciphertext Serpent

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

pattern SerpentLazyCiphertext :: Lazy.ByteString -> LazyCiphertext Serpent
pattern $mSerpentLazyCiphertext :: forall {r}.
LazyCiphertext Serpent -> (ByteString -> r) -> ((# #) -> r) -> r
$bSerpentLazyCiphertext :: ByteString -> LazyCiphertext Serpent
SerpentLazyCiphertext lbs = MkSerpentLazyCiphertext (MkGLazyCiphertext lbs)

getSerpentLazyCiphertext :: LazyCiphertext Serpent -> Lazy.ByteString
getSerpentLazyCiphertext :: LazyCiphertext Serpent -> ByteString
getSerpentLazyCiphertext (SerpentLazyCiphertext ByteString
bs) = ByteString
bs

type SerpentLazyCiphertext = LazyCiphertext Serpent

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

instance (MonadRandomIO m )=> SecretKeyGen Serpent m where

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

instance HasCiphertext Serpent where

instance BlockCipher Serpent where

    blockCipherEncrypt :: SecretKey Serpent -> ByteString -> Maybe (Ciphertext Serpent)
    blockCipherEncrypt :: SecretKey Serpent -> ByteString -> Maybe (Ciphertext Serpent)
blockCipherEncrypt (SerpentSecretKey ByteString
k) = (ByteString -> Ciphertext Serpent)
-> Maybe ByteString -> Maybe (Ciphertext Serpent)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext Serpent
SerpentCiphertext (Maybe ByteString -> Maybe (Ciphertext Serpent))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext Serpent)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.serpent ByteString
k

    blockCipherDecrypt :: SecretKey Serpent -> Ciphertext Serpent -> Maybe ByteString
    blockCipherDecrypt :: SecretKey Serpent -> Ciphertext Serpent -> Maybe ByteString
blockCipherDecrypt (SerpentSecretKey ByteString
k) (SerpentCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.serpent ByteString
k ByteString
ct

instance HasLazyCiphertext Serpent where

instance IncrementalBlockCipher Serpent where

    blockCipherEncryptLazy :: SecretKey Serpent -> Lazy.ByteString -> Maybe (LazyCiphertext Serpent)
    blockCipherEncryptLazy :: SecretKey Serpent -> ByteString -> Maybe (LazyCiphertext Serpent)
blockCipherEncryptLazy (SerpentSecretKey ByteString
k) = (ByteString -> LazyCiphertext Serpent)
-> Maybe ByteString -> Maybe (LazyCiphertext Serpent)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext Serpent
SerpentLazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext Serpent))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext Serpent)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.serpent ByteString
k

    blockCipherDecryptLazy :: SecretKey Serpent -> LazyCiphertext Serpent -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey Serpent -> LazyCiphertext Serpent -> Maybe ByteString
blockCipherDecryptLazy (SerpentSecretKey ByteString
k) (SerpentLazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.serpent ByteString
k ByteString
ct

-- Serpent blockCipher

serpentEncrypt :: SecretKey Serpent -> ByteString -> Maybe SerpentCiphertext
serpentEncrypt :: SecretKey Serpent -> ByteString -> Maybe (Ciphertext Serpent)
serpentEncrypt = SecretKey Serpent -> ByteString -> Maybe (Ciphertext Serpent)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

serpentDecrypt :: SecretKey Serpent -> SerpentCiphertext -> Maybe ByteString
serpentDecrypt :: SecretKey Serpent -> Ciphertext Serpent -> Maybe ByteString
serpentDecrypt = SecretKey Serpent -> Ciphertext Serpent -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

serpentEncryptLazy :: SecretKey Serpent -> Lazy.ByteString -> Maybe SerpentLazyCiphertext
serpentEncryptLazy :: SecretKey Serpent -> ByteString -> Maybe (LazyCiphertext Serpent)
serpentEncryptLazy = SecretKey Serpent -> ByteString -> Maybe (LazyCiphertext Serpent)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

serpentDecryptLazy :: SecretKey Serpent -> SerpentLazyCiphertext -> Maybe Lazy.ByteString
serpentDecryptLazy :: SecretKey Serpent -> LazyCiphertext Serpent -> Maybe ByteString
serpentDecryptLazy = SecretKey Serpent -> LazyCiphertext Serpent -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy

-- Temporary BlockCipher128 conformance

instance BlockCipher128 Serpent where
instance IncrementalBlockCipher128 Serpent where