{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
module Cardano.Crypto.KES.NeverUsed
( NeverKES
, VerKeyKES (..)
, SignKeyKES (..)
, SigKES (..)
)
where
import GHC.Generics (Generic)
import NoThunks.Class (NoThunks)
import Cardano.Crypto.KES.Class
data NeverKES
instance KESAlgorithm NeverKES where
type SeedSizeKES NeverKES = 0
data VerKeyKES NeverKES = NeverUsedVerKeyKES
deriving (Int -> VerKeyKES NeverKES -> ShowS
[VerKeyKES NeverKES] -> ShowS
VerKeyKES NeverKES -> String
(Int -> VerKeyKES NeverKES -> ShowS)
-> (VerKeyKES NeverKES -> String)
-> ([VerKeyKES NeverKES] -> ShowS)
-> Show (VerKeyKES NeverKES)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerKeyKES NeverKES] -> ShowS
$cshowList :: [VerKeyKES NeverKES] -> ShowS
show :: VerKeyKES NeverKES -> String
$cshow :: VerKeyKES NeverKES -> String
showsPrec :: Int -> VerKeyKES NeverKES -> ShowS
$cshowsPrec :: Int -> VerKeyKES NeverKES -> ShowS
Show, VerKeyKES NeverKES -> VerKeyKES NeverKES -> Bool
(VerKeyKES NeverKES -> VerKeyKES NeverKES -> Bool)
-> (VerKeyKES NeverKES -> VerKeyKES NeverKES -> Bool)
-> Eq (VerKeyKES NeverKES)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerKeyKES NeverKES -> VerKeyKES NeverKES -> Bool
$c/= :: VerKeyKES NeverKES -> VerKeyKES NeverKES -> Bool
== :: VerKeyKES NeverKES -> VerKeyKES NeverKES -> Bool
$c== :: VerKeyKES NeverKES -> VerKeyKES NeverKES -> Bool
Eq, (forall x. VerKeyKES NeverKES -> Rep (VerKeyKES NeverKES) x)
-> (forall x. Rep (VerKeyKES NeverKES) x -> VerKeyKES NeverKES)
-> Generic (VerKeyKES NeverKES)
forall x. Rep (VerKeyKES NeverKES) x -> VerKeyKES NeverKES
forall x. VerKeyKES NeverKES -> Rep (VerKeyKES NeverKES) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep (VerKeyKES NeverKES) x -> VerKeyKES NeverKES
$cfrom :: forall x. VerKeyKES NeverKES -> Rep (VerKeyKES NeverKES) x
Generic, Context -> VerKeyKES NeverKES -> IO (Maybe ThunkInfo)
Proxy (VerKeyKES NeverKES) -> String
(Context -> VerKeyKES NeverKES -> IO (Maybe ThunkInfo))
-> (Context -> VerKeyKES NeverKES -> IO (Maybe ThunkInfo))
-> (Proxy (VerKeyKES NeverKES) -> String)
-> NoThunks (VerKeyKES NeverKES)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
showTypeOf :: Proxy (VerKeyKES NeverKES) -> String
$cshowTypeOf :: Proxy (VerKeyKES NeverKES) -> String
wNoThunks :: Context -> VerKeyKES NeverKES -> IO (Maybe ThunkInfo)
$cwNoThunks :: Context -> VerKeyKES NeverKES -> IO (Maybe ThunkInfo)
noThunks :: Context -> VerKeyKES NeverKES -> IO (Maybe ThunkInfo)
$cnoThunks :: Context -> VerKeyKES NeverKES -> IO (Maybe ThunkInfo)
NoThunks)
data SignKeyKES NeverKES = NeverUsedSignKeyKES
deriving (Int -> SignKeyKES NeverKES -> ShowS
[SignKeyKES NeverKES] -> ShowS
SignKeyKES NeverKES -> String
(Int -> SignKeyKES NeverKES -> ShowS)
-> (SignKeyKES NeverKES -> String)
-> ([SignKeyKES NeverKES] -> ShowS)
-> Show (SignKeyKES NeverKES)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignKeyKES NeverKES] -> ShowS
$cshowList :: [SignKeyKES NeverKES] -> ShowS
show :: SignKeyKES NeverKES -> String
$cshow :: SignKeyKES NeverKES -> String
showsPrec :: Int -> SignKeyKES NeverKES -> ShowS
$cshowsPrec :: Int -> SignKeyKES NeverKES -> ShowS
Show, SignKeyKES NeverKES -> SignKeyKES NeverKES -> Bool
(SignKeyKES NeverKES -> SignKeyKES NeverKES -> Bool)
-> (SignKeyKES NeverKES -> SignKeyKES NeverKES -> Bool)
-> Eq (SignKeyKES NeverKES)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignKeyKES NeverKES -> SignKeyKES NeverKES -> Bool
$c/= :: SignKeyKES NeverKES -> SignKeyKES NeverKES -> Bool
== :: SignKeyKES NeverKES -> SignKeyKES NeverKES -> Bool
$c== :: SignKeyKES NeverKES -> SignKeyKES NeverKES -> Bool
Eq, (forall x. SignKeyKES NeverKES -> Rep (SignKeyKES NeverKES) x)
-> (forall x. Rep (SignKeyKES NeverKES) x -> SignKeyKES NeverKES)
-> Generic (SignKeyKES NeverKES)
forall x. Rep (SignKeyKES NeverKES) x -> SignKeyKES NeverKES
forall x. SignKeyKES NeverKES -> Rep (SignKeyKES NeverKES) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep (SignKeyKES NeverKES) x -> SignKeyKES NeverKES
$cfrom :: forall x. SignKeyKES NeverKES -> Rep (SignKeyKES NeverKES) x
Generic, Context -> SignKeyKES NeverKES -> IO (Maybe ThunkInfo)
Proxy (SignKeyKES NeverKES) -> String
(Context -> SignKeyKES NeverKES -> IO (Maybe ThunkInfo))
-> (Context -> SignKeyKES NeverKES -> IO (Maybe ThunkInfo))
-> (Proxy (SignKeyKES NeverKES) -> String)
-> NoThunks (SignKeyKES NeverKES)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
showTypeOf :: Proxy (SignKeyKES NeverKES) -> String
$cshowTypeOf :: Proxy (SignKeyKES NeverKES) -> String
wNoThunks :: Context -> SignKeyKES NeverKES -> IO (Maybe ThunkInfo)
$cwNoThunks :: Context -> SignKeyKES NeverKES -> IO (Maybe ThunkInfo)
noThunks :: Context -> SignKeyKES NeverKES -> IO (Maybe ThunkInfo)
$cnoThunks :: Context -> SignKeyKES NeverKES -> IO (Maybe ThunkInfo)
NoThunks)
data SigKES NeverKES = NeverUsedSigKES
deriving (Int -> SigKES NeverKES -> ShowS
[SigKES NeverKES] -> ShowS
SigKES NeverKES -> String
(Int -> SigKES NeverKES -> ShowS)
-> (SigKES NeverKES -> String)
-> ([SigKES NeverKES] -> ShowS)
-> Show (SigKES NeverKES)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SigKES NeverKES] -> ShowS
$cshowList :: [SigKES NeverKES] -> ShowS
show :: SigKES NeverKES -> String
$cshow :: SigKES NeverKES -> String
showsPrec :: Int -> SigKES NeverKES -> ShowS
$cshowsPrec :: Int -> SigKES NeverKES -> ShowS
Show, SigKES NeverKES -> SigKES NeverKES -> Bool
(SigKES NeverKES -> SigKES NeverKES -> Bool)
-> (SigKES NeverKES -> SigKES NeverKES -> Bool)
-> Eq (SigKES NeverKES)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SigKES NeverKES -> SigKES NeverKES -> Bool
$c/= :: SigKES NeverKES -> SigKES NeverKES -> Bool
== :: SigKES NeverKES -> SigKES NeverKES -> Bool
$c== :: SigKES NeverKES -> SigKES NeverKES -> Bool
Eq, (forall x. SigKES NeverKES -> Rep (SigKES NeverKES) x)
-> (forall x. Rep (SigKES NeverKES) x -> SigKES NeverKES)
-> Generic (SigKES NeverKES)
forall x. Rep (SigKES NeverKES) x -> SigKES NeverKES
forall x. SigKES NeverKES -> Rep (SigKES NeverKES) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep (SigKES NeverKES) x -> SigKES NeverKES
$cfrom :: forall x. SigKES NeverKES -> Rep (SigKES NeverKES) x
Generic, Context -> SigKES NeverKES -> IO (Maybe ThunkInfo)
Proxy (SigKES NeverKES) -> String
(Context -> SigKES NeverKES -> IO (Maybe ThunkInfo))
-> (Context -> SigKES NeverKES -> IO (Maybe ThunkInfo))
-> (Proxy (SigKES NeverKES) -> String)
-> NoThunks (SigKES NeverKES)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
showTypeOf :: Proxy (SigKES NeverKES) -> String
$cshowTypeOf :: Proxy (SigKES NeverKES) -> String
wNoThunks :: Context -> SigKES NeverKES -> IO (Maybe ThunkInfo)
$cwNoThunks :: Context -> SigKES NeverKES -> IO (Maybe ThunkInfo)
noThunks :: Context -> SigKES NeverKES -> IO (Maybe ThunkInfo)
$cnoThunks :: Context -> SigKES NeverKES -> IO (Maybe ThunkInfo)
NoThunks)
algorithmNameKES :: proxy NeverKES -> String
algorithmNameKES proxy NeverKES
_ = String
"never"
deriveVerKeyKES :: SignKeyKES NeverKES -> VerKeyKES NeverKES
deriveVerKeyKES SignKeyKES NeverKES
_ = VerKeyKES NeverKES
NeverUsedVerKeyKES
signKES :: ContextKES NeverKES
-> Period -> a -> SignKeyKES NeverKES -> SigKES NeverKES
signKES = String
-> () -> Period -> a -> SignKeyKES NeverKES -> SigKES NeverKES
forall a. HasCallStack => String -> a
error String
"KES not available"
verifyKES :: ContextKES NeverKES
-> VerKeyKES NeverKES
-> Period
-> a
-> SigKES NeverKES
-> Either String ()
verifyKES = String
-> ()
-> VerKeyKES NeverKES
-> Period
-> a
-> SigKES NeverKES
-> Either String ()
forall a. HasCallStack => String -> a
error String
"KES not available"
updateKES :: ContextKES NeverKES
-> SignKeyKES NeverKES -> Period -> Maybe (SignKeyKES NeverKES)
updateKES = String
-> ()
-> SignKeyKES NeverKES
-> Period
-> Maybe (SignKeyKES NeverKES)
forall a. HasCallStack => String -> a
error String
"KES not available"
totalPeriodsKES :: proxy NeverKES -> Period
totalPeriodsKES proxy NeverKES
_ = Period
0
genKeyKES :: Seed -> SignKeyKES NeverKES
genKeyKES Seed
_ = SignKeyKES NeverKES
NeverUsedSignKeyKES
sizeVerKeyKES :: proxy NeverKES -> Period
sizeVerKeyKES proxy NeverKES
_ = Period
0
sizeSignKeyKES :: proxy NeverKES -> Period
sizeSignKeyKES proxy NeverKES
_ = Period
0
sizeSigKES :: proxy NeverKES -> Period
sizeSigKES proxy NeverKES
_ = Period
0
rawSerialiseVerKeyKES :: VerKeyKES NeverKES -> ByteString
rawSerialiseVerKeyKES VerKeyKES NeverKES
_ = ByteString
forall a. Monoid a => a
mempty
rawSerialiseSignKeyKES :: SignKeyKES NeverKES -> ByteString
rawSerialiseSignKeyKES SignKeyKES NeverKES
_ = ByteString
forall a. Monoid a => a
mempty
rawSerialiseSigKES :: SigKES NeverKES -> ByteString
rawSerialiseSigKES SigKES NeverKES
_ = ByteString
forall a. Monoid a => a
mempty
rawDeserialiseVerKeyKES :: ByteString -> Maybe (VerKeyKES NeverKES)
rawDeserialiseVerKeyKES ByteString
_ = VerKeyKES NeverKES -> Maybe (VerKeyKES NeverKES)
forall a. a -> Maybe a
Just VerKeyKES NeverKES
NeverUsedVerKeyKES
rawDeserialiseSignKeyKES :: ByteString -> Maybe (SignKeyKES NeverKES)
rawDeserialiseSignKeyKES ByteString
_ = SignKeyKES NeverKES -> Maybe (SignKeyKES NeverKES)
forall a. a -> Maybe a
Just SignKeyKES NeverKES
NeverUsedSignKeyKES
rawDeserialiseSigKES :: ByteString -> Maybe (SigKES NeverKES)
rawDeserialiseSigKES ByteString
_ = SigKES NeverKES -> Maybe (SigKES NeverKES)
forall a. a -> Maybe a
Just SigKES NeverKES
NeverUsedSigKES