module Botan.BlockCipher.Noekeon
( Noekeon(..)
, NoekeonSecretKey(..)
, pattern NoekeonSecretKey
, getNoekeonSecretKey
, NoekeonCiphertext(..)
, noekeonEncrypt
, noekeonDecrypt
, noekeonEncryptLazy
, noekeonDecryptLazy
) 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

-- Noekeon type

data Noekeon

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

pattern NoekeonSecretKey :: ByteString -> SecretKey Noekeon
pattern $mNoekeonSecretKey :: forall {r}.
SecretKey Noekeon -> (ByteString -> r) -> ((# #) -> r) -> r
$bNoekeonSecretKey :: ByteString -> SecretKey Noekeon
NoekeonSecretKey bytes = MkNoekeonSecretKey (MkGSecretKey bytes)

getNoekeonSecretKey :: SecretKey Noekeon -> ByteString
getNoekeonSecretKey :: SecretKey Noekeon -> ByteString
getNoekeonSecretKey (NoekeonSecretKey ByteString
bs) = ByteString
bs

type NoekeonSecretKey = SecretKey Noekeon

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

pattern NoekeonCiphertext :: ByteString -> Ciphertext Noekeon
pattern $mNoekeonCiphertext :: forall {r}.
Ciphertext Noekeon -> (ByteString -> r) -> ((# #) -> r) -> r
$bNoekeonCiphertext :: ByteString -> Ciphertext Noekeon
NoekeonCiphertext bs = MkNoekeonCiphertext (MkGCiphertext bs)

getNoekeonCiphertext :: Ciphertext Noekeon -> ByteString
getNoekeonCiphertext :: Ciphertext Noekeon -> ByteString
getNoekeonCiphertext (NoekeonCiphertext ByteString
bs) = ByteString
bs

type NoekeonCiphertext = Ciphertext Noekeon

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

pattern NoekeonLazyCiphertext :: Lazy.ByteString -> LazyCiphertext Noekeon
pattern $mNoekeonLazyCiphertext :: forall {r}.
LazyCiphertext Noekeon -> (ByteString -> r) -> ((# #) -> r) -> r
$bNoekeonLazyCiphertext :: ByteString -> LazyCiphertext Noekeon
NoekeonLazyCiphertext lbs = MkNoekeonLazyCiphertext (MkGLazyCiphertext lbs)

getNoekeonLazyCiphertext :: LazyCiphertext Noekeon -> Lazy.ByteString
getNoekeonLazyCiphertext :: LazyCiphertext Noekeon -> ByteString
getNoekeonLazyCiphertext (NoekeonLazyCiphertext ByteString
bs) = ByteString
bs

type NoekeonLazyCiphertext = LazyCiphertext Noekeon

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

instance (MonadRandomIO m )=> SecretKeyGen Noekeon m where

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

instance HasCiphertext Noekeon where

instance BlockCipher Noekeon where

    blockCipherEncrypt :: SecretKey Noekeon -> ByteString -> Maybe (Ciphertext Noekeon)
    blockCipherEncrypt :: SecretKey Noekeon -> ByteString -> Maybe (Ciphertext Noekeon)
blockCipherEncrypt (NoekeonSecretKey ByteString
k) = (ByteString -> Ciphertext Noekeon)
-> Maybe ByteString -> Maybe (Ciphertext Noekeon)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Ciphertext Noekeon
NoekeonCiphertext (Maybe ByteString -> Maybe (Ciphertext Noekeon))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (Ciphertext Noekeon)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncrypt BlockCipher
Botan.noekeon ByteString
k

    blockCipherDecrypt :: SecretKey Noekeon -> Ciphertext Noekeon -> Maybe ByteString
    blockCipherDecrypt :: SecretKey Noekeon -> Ciphertext Noekeon -> Maybe ByteString
blockCipherDecrypt (NoekeonSecretKey ByteString
k) (NoekeonCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecrypt BlockCipher
Botan.noekeon ByteString
k ByteString
ct

instance HasLazyCiphertext Noekeon where

instance IncrementalBlockCipher Noekeon where

    blockCipherEncryptLazy :: SecretKey Noekeon -> Lazy.ByteString -> Maybe (LazyCiphertext Noekeon)
    blockCipherEncryptLazy :: SecretKey Noekeon -> ByteString -> Maybe (LazyCiphertext Noekeon)
blockCipherEncryptLazy (NoekeonSecretKey ByteString
k) = (ByteString -> LazyCiphertext Noekeon)
-> Maybe ByteString -> Maybe (LazyCiphertext Noekeon)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> LazyCiphertext Noekeon
NoekeonLazyCiphertext (Maybe ByteString -> Maybe (LazyCiphertext Noekeon))
-> (ByteString -> Maybe ByteString)
-> ByteString
-> Maybe (LazyCiphertext Noekeon)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherEncryptLazy BlockCipher
Botan.noekeon ByteString
k

    blockCipherDecryptLazy :: SecretKey Noekeon -> LazyCiphertext Noekeon -> Maybe Lazy.ByteString
    blockCipherDecryptLazy :: SecretKey Noekeon -> LazyCiphertext Noekeon -> Maybe ByteString
blockCipherDecryptLazy (NoekeonSecretKey ByteString
k) (NoekeonLazyCiphertext ByteString
ct) = BlockCipher -> ByteString -> ByteString -> Maybe ByteString
Botan.blockCipherDecryptLazy BlockCipher
Botan.noekeon ByteString
k ByteString
ct

-- Noekeon blockCipher

noekeonEncrypt :: SecretKey Noekeon -> ByteString -> Maybe NoekeonCiphertext
noekeonEncrypt :: SecretKey Noekeon -> ByteString -> Maybe (Ciphertext Noekeon)
noekeonEncrypt = SecretKey Noekeon -> ByteString -> Maybe (Ciphertext Noekeon)
forall bc.
BlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (Ciphertext bc)
blockCipherEncrypt

noekeonDecrypt :: SecretKey Noekeon -> NoekeonCiphertext -> Maybe ByteString
noekeonDecrypt :: SecretKey Noekeon -> Ciphertext Noekeon -> Maybe ByteString
noekeonDecrypt = SecretKey Noekeon -> Ciphertext Noekeon -> Maybe ByteString
forall bc.
BlockCipher bc =>
SecretKey bc -> Ciphertext bc -> Maybe ByteString
blockCipherDecrypt

noekeonEncryptLazy :: SecretKey Noekeon -> Lazy.ByteString -> Maybe NoekeonLazyCiphertext
noekeonEncryptLazy :: SecretKey Noekeon -> ByteString -> Maybe (LazyCiphertext Noekeon)
noekeonEncryptLazy = SecretKey Noekeon -> ByteString -> Maybe (LazyCiphertext Noekeon)
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> ByteString -> Maybe (LazyCiphertext bc)
blockCipherEncryptLazy

noekeonDecryptLazy :: SecretKey Noekeon -> NoekeonLazyCiphertext -> Maybe Lazy.ByteString
noekeonDecryptLazy :: SecretKey Noekeon -> LazyCiphertext Noekeon -> Maybe ByteString
noekeonDecryptLazy = SecretKey Noekeon -> LazyCiphertext Noekeon -> Maybe ByteString
forall bc.
IncrementalBlockCipher bc =>
SecretKey bc -> LazyCiphertext bc -> Maybe ByteString
blockCipherDecryptLazy

-- Temporary BlockCipher128 conformance

instance BlockCipher128 Noekeon where
instance IncrementalBlockCipher128 Noekeon where