module Botan.BlockCipher.Threefish
( Threefish512(..)
, Threefish512SecretKey(..)
, pattern Threefish512SecretKey
, getThreefish512SecretKey
, Threefish512Ciphertext(..)
, threefish512Encrypt
, threefish512Decrypt
, threefish512EncryptLazy
, threefish512DecryptLazy
) 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

-- Threefish512 type

data Threefish512

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

pattern Threefish512SecretKey :: ByteString -> SecretKey Threefish512
pattern $mThreefish512SecretKey :: forall {r}.
SecretKey Threefish512 -> (ByteString -> r) -> ((# #) -> r) -> r
$bThreefish512SecretKey :: ByteString -> SecretKey Threefish512
Threefish512SecretKey bytes = MkThreefish512SecretKey (MkGSecretKey bytes)

getThreefish512SecretKey :: SecretKey Threefish512 -> ByteString
getThreefish512SecretKey :: SecretKey Threefish512 -> ByteString
getThreefish512SecretKey (Threefish512SecretKey ByteString
bs) = ByteString
bs

type Threefish512SecretKey = SecretKey Threefish512

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

pattern Threefish512Ciphertext :: ByteString -> Ciphertext Threefish512
pattern $mThreefish512Ciphertext :: forall {r}.
Ciphertext Threefish512 -> (ByteString -> r) -> ((# #) -> r) -> r
$bThreefish512Ciphertext :: ByteString -> Ciphertext Threefish512
Threefish512Ciphertext bs = MkThreefish512Ciphertext (MkGCiphertext bs)

getThreefish512Ciphertext :: Ciphertext Threefish512 -> ByteString
getThreefish512Ciphertext :: Ciphertext Threefish512 -> ByteString
getThreefish512Ciphertext (Threefish512Ciphertext ByteString
bs) = ByteString
bs

type Threefish512Ciphertext = Ciphertext Threefish512

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

pattern Threefish512LazyCiphertext :: Lazy.ByteString -> LazyCiphertext Threefish512
pattern $mThreefish512LazyCiphertext :: forall {r}.
LazyCiphertext Threefish512
-> (ByteString -> r) -> ((# #) -> r) -> r
$bThreefish512LazyCiphertext :: ByteString -> LazyCiphertext Threefish512
Threefish512LazyCiphertext lbs = MkThreefish512LazyCiphertext (MkGLazyCiphertext lbs)

getThreefish512LazyCiphertext :: LazyCiphertext Threefish512 -> Lazy.ByteString
getThreefish512LazyCiphertext :: LazyCiphertext Threefish512 -> ByteString
getThreefish512LazyCiphertext (Threefish512LazyCiphertext ByteString
bs) = ByteString
bs

type Threefish512LazyCiphertext = LazyCiphertext Threefish512

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

instance (MonadRandomIO m )=> SecretKeyGen Threefish512 m where

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

instance HasCiphertext Threefish512 where

instance BlockCipher Threefish512 where

    blockCipherEncrypt :: SecretKey Threefish512 -> ByteString -> Maybe (Ciphertext Threefish512)
    blockCipherEncrypt :: SecretKey Threefish512
-> ByteString -> Maybe (Ciphertext Threefish512)
blockCipherEncrypt (Threefish512SecretKey ByteString
k) = (ByteString -> Ciphertext Threefish512)
-> Maybe ByteString -> Maybe (Ciphertext Threefish512)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext Threefish512
Threefish512Ciphertext (Maybe ByteString -> Maybe (Ciphertext Threefish512))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext Threefish512)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.threefish512 ByteString
k

    blockCipherDecrypt :: SecretKey Threefish512 -> Ciphertext Threefish512 -> Maybe ByteString
    blockCipherDecrypt :: SecretKey Threefish512
-> Ciphertext Threefish512 -> Maybe ByteString
blockCipherDecrypt (Threefish512SecretKey ByteString
k) (Threefish512Ciphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.threefish512 ByteString
k ByteString
ct

instance HasLazyCiphertext Threefish512 where

instance IncrementalBlockCipher Threefish512 where

    blockCipherEncryptLazy :: SecretKey Threefish512 -> Lazy.ByteString -> Maybe (LazyCiphertext Threefish512)
    blockCipherEncryptLazy :: SecretKey Threefish512
-> ByteString -> Maybe (LazyCiphertext Threefish512)
blockCipherEncryptLazy (Threefish512SecretKey ByteString
k) = (ByteString -> LazyCiphertext Threefish512)
-> Maybe ByteString -> Maybe (LazyCiphertext Threefish512)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext Threefish512
Threefish512LazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext Threefish512))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext Threefish512)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.threefish512 ByteString
k

    blockCipherDecryptLazy :: SecretKey Threefish512 -> LazyCiphertext Threefish512 -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey Threefish512
-> LazyCiphertext Threefish512 -> Maybe ByteString
blockCipherDecryptLazy (Threefish512SecretKey ByteString
k) (Threefish512LazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.threefish512 ByteString
k ByteString
ct

-- Threefish512 blockCipher

threefish512Encrypt :: SecretKey Threefish512 -> ByteString -> Maybe Threefish512Ciphertext
threefish512Encrypt :: SecretKey Threefish512
-> ByteString -> Maybe (Ciphertext Threefish512)
threefish512Encrypt = SecretKey Threefish512
-> ByteString -> Maybe (Ciphertext Threefish512)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

threefish512Decrypt :: SecretKey Threefish512 -> Threefish512Ciphertext -> Maybe ByteString
threefish512Decrypt :: SecretKey Threefish512
-> Ciphertext Threefish512 -> Maybe ByteString
threefish512Decrypt = SecretKey Threefish512
-> Ciphertext Threefish512 -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

threefish512EncryptLazy :: SecretKey Threefish512 -> Lazy.ByteString -> Maybe Threefish512LazyCiphertext
threefish512EncryptLazy :: SecretKey Threefish512
-> ByteString -> Maybe (LazyCiphertext Threefish512)
threefish512EncryptLazy = SecretKey Threefish512
-> ByteString -> Maybe (LazyCiphertext Threefish512)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

threefish512DecryptLazy :: SecretKey Threefish512 -> Threefish512LazyCiphertext -> Maybe Lazy.ByteString
threefish512DecryptLazy :: SecretKey Threefish512
-> LazyCiphertext Threefish512 -> Maybe ByteString
threefish512DecryptLazy = SecretKey Threefish512
-> LazyCiphertext Threefish512 -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy