shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.Keys

Synopsis

Documentation

data KeyRole Source #

The role of a key.

Note that a role is not _fixed_, nor is it unique. In particular, keys may variously be used as witnesses, and so in many case we will change the role of a key to the Witness role.

It is also perfectly allowable for a key to be used in many roles; there is nothing prohibiting somebody using the same underlying key as their payment and staking key, as well as the key for their stake pool. So these roles are more intended for two purposes:

  • To make explicit how we are using a key in the specifications
  • To provide a guide to downstream implementors, for whom the profusion of keys may be confusing.

Instances

Instances details
Show KeyRole Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

showsPrecIntKeyRoleShowS #

showKeyRoleString #

showList ∷ [KeyRole] → ShowS #

class HasKeyRole (a ∷ KeyRoleTypeType) where Source #

Minimal complete definition

Nothing

Methods

coerceKeyRole ∷ a r crypto → a r' crypto Source #

General coercion of key roles.

The presence of this function is mostly to help the user realise where they are converting key roles.

default coerceKeyRoleCoercible (a r crypto) (a r' crypto) ⇒ a r crypto → a r' crypto Source #

Instances

Instances details
HasKeyRole KeyHash Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) crypto (r' ∷ KeyRole). KeyHash r crypto → KeyHash r' crypto Source #

HasKeyRole KeyPair Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) crypto (r' ∷ KeyRole). KeyPair r crypto → KeyPair r' crypto Source #

HasKeyRole VKey Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) crypto (r' ∷ KeyRole). VKey r crypto → VKey r' crypto Source #

HasKeyRole Credential Source # 
Instance details

Defined in Shelley.Spec.Ledger.Credential

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) crypto (r' ∷ KeyRole). Credential r crypto → Credential r' crypto Source #

asWitnessHasKeyRole a ⇒ a r crypto → a 'Witness crypto Source #

Use a key as a witness.

This is the most common coercion between key roles, because most keys can be used as witnesses to some types of transaction. As such, we provide an explicit coercion for it.

DSIGN

newtype VKey (kd ∷ KeyRole) crypto Source #

Discriminated verification key

We wrap the basic VerKeyDSIGN in order to add the key role.

Constructors

VKey 

Fields

Instances

Instances details
HasKeyRole VKey Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) crypto (r' ∷ KeyRole). VKey r crypto → VKey r' crypto Source #

Crypto crypto ⇒ Eq (VKey kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

(==)VKey kd crypto → VKey kd crypto → Bool #

(/=)VKey kd crypto → VKey kd crypto → Bool #

Crypto crypto ⇒ Show (VKey kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

showsPrecIntVKey kd crypto → ShowS #

showVKey kd crypto → String #

showList ∷ [VKey kd crypto] → ShowS #

Generic (VKey kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Associated Types

type Rep (VKey kd crypto) ∷ TypeType #

Methods

fromVKey kd crypto → Rep (VKey kd crypto) x #

toRep (VKey kd crypto) x → VKey kd crypto #

(Crypto crypto, NFData (VerKeyDSIGN (DSIGN crypto))) ⇒ NFData (VKey kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

rnfVKey kd crypto → () #

(Crypto crypto, Typeable kd) ⇒ ToCBOR (VKey kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

toCBORVKey kd crypto → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (VKey kd crypto) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VKey kd crypto] → Size Source #

(Crypto crypto, Typeable kd) ⇒ FromCBOR (VKey kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

fromCBORDecoder s (VKey kd crypto) Source #

labelProxy (VKey kd crypto) → Text Source #

Crypto crypto ⇒ NoThunks (VKey kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

noThunks ∷ Context → VKey kd crypto → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → VKey kd crypto → IO (Maybe ThunkInfo)

showTypeOfProxy (VKey kd crypto) → String

type Rep (VKey kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

type Rep (VKey kd crypto) = D1 ('MetaData "VKey" "Shelley.Spec.Ledger.Keys" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "VKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unVKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VerKeyDSIGN (DSIGN crypto)))))

data KeyPair (kd ∷ KeyRole) crypto Source #

Pair of signing key and verification key, with a usage role.

Constructors

KeyPair 

Fields

Instances

Instances details
HasKeyRole KeyPair Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) crypto (r' ∷ KeyRole). KeyPair r crypto → KeyPair r' crypto Source #

Crypto crypto ⇒ Show (KeyPair kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

showsPrecIntKeyPair kd crypto → ShowS #

showKeyPair kd crypto → String #

showList ∷ [KeyPair kd crypto] → ShowS #

Generic (KeyPair kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Associated Types

type Rep (KeyPair kd crypto) ∷ TypeType #

Methods

fromKeyPair kd crypto → Rep (KeyPair kd crypto) x #

toRep (KeyPair kd crypto) x → KeyPair kd crypto #

(Crypto crypto, NFData (VerKeyDSIGN (DSIGN crypto)), NFData (SignKeyDSIGN (DSIGN crypto))) ⇒ NFData (KeyPair kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

rnfKeyPair kd crypto → () #

Crypto crypto ⇒ NoThunks (KeyPair kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

noThunks ∷ Context → KeyPair kd crypto → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → KeyPair kd crypto → IO (Maybe ThunkInfo)

showTypeOfProxy (KeyPair kd crypto) → String

type Rep (KeyPair kd crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

type Rep (KeyPair kd crypto) = D1 ('MetaData "KeyPair" "Shelley.Spec.Ledger.Keys" "shelley-spec-ledger-0.1.0.0-inplace" 'False) (C1 ('MetaCons "KeyPair" 'PrefixI 'True) (S1 ('MetaSel ('Just "vKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VKey kd crypto)) :*: S1 ('MetaSel ('Just "sKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignKeyDSIGN (DSIGN crypto)))))

signedDSIGN ∷ (Crypto crypto, Signable (DSIGN crypto) a) ⇒ SignKeyDSIGN (DSIGN crypto) → a → SignedDSIGN crypto a Source #

Produce a digital signature

verifySignedDSIGN ∷ (Crypto crypto, Signable (DSIGN crypto) a) ⇒ VKey kd crypto → a → SignedDSIGN crypto a → Bool Source #

Verify a digital signature

Key hashes

newtype KeyHash (discriminator ∷ KeyRole) crypto Source #

Discriminated hash of public Key

Constructors

KeyHash (Hash (ADDRHASH crypto) (VerKeyDSIGN (DSIGN crypto))) 

Instances

Instances details
HasKeyRole KeyHash Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) crypto (r' ∷ KeyRole). KeyHash r crypto → KeyHash r' crypto Source #

Embed (PoolDistr crypto) (Map (KeyHash 'StakePool crypto) (IndividualPoolStake crypto)) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Delegation.Certificates

Methods

toBasePoolDistr crypto → Map (KeyHash 'StakePool crypto) (IndividualPoolStake crypto) Source #

fromBaseMap (KeyHash 'StakePool crypto) (IndividualPoolStake crypto) → PoolDistr crypto Source #

HasExp (PoolDistr crypto) (Map (KeyHash 'StakePool crypto) (IndividualPoolStake crypto)) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Delegation.Certificates

Methods

toExpPoolDistr crypto → Exp (Map (KeyHash 'StakePool crypto) (IndividualPoolStake crypto)) Source #

Eq (KeyHash discriminator crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

(==)KeyHash discriminator crypto → KeyHash discriminator crypto → Bool #

(/=)KeyHash discriminator crypto → KeyHash discriminator crypto → Bool #

Ord (KeyHash discriminator crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

compareKeyHash discriminator crypto → KeyHash discriminator crypto → Ordering #

(<)KeyHash discriminator crypto → KeyHash discriminator crypto → Bool #

(<=)KeyHash discriminator crypto → KeyHash discriminator crypto → Bool #

(>)KeyHash discriminator crypto → KeyHash discriminator crypto → Bool #

(>=)KeyHash discriminator crypto → KeyHash discriminator crypto → Bool #

maxKeyHash discriminator crypto → KeyHash discriminator crypto → KeyHash discriminator crypto #

minKeyHash discriminator crypto → KeyHash discriminator crypto → KeyHash discriminator crypto #

Show (KeyHash discriminator crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

showsPrecIntKeyHash discriminator crypto → ShowS #

showKeyHash discriminator crypto → String #

showList ∷ [KeyHash discriminator crypto] → ShowS #

Generic (KeyHash discriminator crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Associated Types

type Rep (KeyHash discriminator crypto) ∷ TypeType #

Methods

fromKeyHash discriminator crypto → Rep (KeyHash discriminator crypto) x #

toRep (KeyHash discriminator crypto) x → KeyHash discriminator crypto #

NFData (KeyHash discriminator crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

rnfKeyHash discriminator crypto → () #

(Crypto crypto, Typeable disc) ⇒ ToCBOR (KeyHash disc crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

toCBORKeyHash disc crypto → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (KeyHash disc crypto) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [KeyHash disc crypto] → Size Source #

(Crypto crypto, Typeable disc) ⇒ FromCBOR (KeyHash disc crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

fromCBORDecoder s (KeyHash disc crypto) Source #

labelProxy (KeyHash disc crypto) → Text Source #

NoThunks (KeyHash discriminator crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

noThunks ∷ Context → KeyHash discriminator crypto → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → KeyHash discriminator crypto → IO (Maybe ThunkInfo)

showTypeOfProxy (KeyHash discriminator crypto) → String

Crypto crypto ⇒ FromJSON (KeyHash disc crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

parseJSON ∷ Value → Parser (KeyHash disc crypto)

parseJSONList ∷ Value → Parser [KeyHash disc crypto]

ToJSON (KeyHash disc crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

toJSONKeyHash disc crypto → Value

toEncodingKeyHash disc crypto → Encoding

toJSONList ∷ [KeyHash disc crypto] → Value

toEncodingList ∷ [KeyHash disc crypto] → Encoding

Crypto crypto ⇒ FromJSONKey (KeyHash disc crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

fromJSONKey ∷ FromJSONKeyFunction (KeyHash disc crypto)

fromJSONKeyList ∷ FromJSONKeyFunction [KeyHash disc crypto]

ToJSONKey (KeyHash disc crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

toJSONKey ∷ ToJSONKeyFunction (KeyHash disc crypto)

toJSONKeyList ∷ ToJSONKeyFunction [KeyHash disc crypto]

type Rep (KeyHash discriminator crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

type Rep (KeyHash discriminator crypto) = Rep (Hash (ADDRHASH crypto) (VerKeyDSIGN (DSIGN crypto)))

hashKeyCrypto crypto ⇒ VKey kd crypto → KeyHash kd crypto Source #

Hash a given public key

Genesis delegations

data GenDelegPair crypto Source #

Constructors

GenDelegPair 

Fields

Instances

Instances details
Eq (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

(==)GenDelegPair crypto → GenDelegPair crypto → Bool #

(/=)GenDelegPair crypto → GenDelegPair crypto → Bool #

Ord (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

compareGenDelegPair crypto → GenDelegPair crypto → Ordering #

(<)GenDelegPair crypto → GenDelegPair crypto → Bool #

(<=)GenDelegPair crypto → GenDelegPair crypto → Bool #

(>)GenDelegPair crypto → GenDelegPair crypto → Bool #

(>=)GenDelegPair crypto → GenDelegPair crypto → Bool #

maxGenDelegPair crypto → GenDelegPair crypto → GenDelegPair crypto #

minGenDelegPair crypto → GenDelegPair crypto → GenDelegPair crypto #

Show (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

showsPrecIntGenDelegPair crypto → ShowS #

showGenDelegPair crypto → String #

showList ∷ [GenDelegPair crypto] → ShowS #

Generic (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Associated Types

type Rep (GenDelegPair crypto) ∷ TypeType #

Methods

fromGenDelegPair crypto → Rep (GenDelegPair crypto) x #

toRep (GenDelegPair crypto) x → GenDelegPair crypto #

NFData (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

rnfGenDelegPair crypto → () #

Crypto crypto ⇒ ToCBOR (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

toCBORGenDelegPair crypto → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (GenDelegPair crypto) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [GenDelegPair crypto] → Size Source #

Crypto crypto ⇒ FromCBOR (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

fromCBORDecoder s (GenDelegPair crypto) Source #

labelProxy (GenDelegPair crypto) → Text Source #

NoThunks (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

noThunks ∷ Context → GenDelegPair crypto → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → GenDelegPair crypto → IO (Maybe ThunkInfo)

showTypeOfProxy (GenDelegPair crypto) → String

Crypto crypto ⇒ FromJSON (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

parseJSON ∷ Value → Parser (GenDelegPair crypto)

parseJSONList ∷ Value → Parser [GenDelegPair crypto]

Crypto crypto ⇒ ToJSON (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

toJSONGenDelegPair crypto → Value

toEncodingGenDelegPair crypto → Encoding

toJSONList ∷ [GenDelegPair crypto] → Value

toEncodingList ∷ [GenDelegPair crypto] → Encoding

type Rep (GenDelegPair crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

type Rep (GenDelegPair crypto) = D1 ('MetaData "GenDelegPair" "Shelley.Spec.Ledger.Keys" "shelley-spec-ledger-0.1.0.0-inplace" 'False) (C1 ('MetaCons "GenDelegPair" 'PrefixI 'True) (S1 ('MetaSel ('Just "genDelegKeyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'GenesisDelegate crypto)) :*: S1 ('MetaSel ('Just "genDelegVrfHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash crypto (VerKeyVRF crypto)))))

newtype GenDelegs crypto Source #

Constructors

GenDelegs 

Fields

Instances

Instances details
Eq (GenDelegs crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

(==)GenDelegs crypto → GenDelegs crypto → Bool #

(/=)GenDelegs crypto → GenDelegs crypto → Bool #

Show (GenDelegs crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

showsPrecIntGenDelegs crypto → ShowS #

showGenDelegs crypto → String #

showList ∷ [GenDelegs crypto] → ShowS #

Generic (GenDelegs crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Associated Types

type Rep (GenDelegs crypto) ∷ TypeType #

Methods

fromGenDelegs crypto → Rep (GenDelegs crypto) x #

toRep (GenDelegs crypto) x → GenDelegs crypto #

NFData (GenDelegs crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

rnfGenDelegs crypto → () #

Crypto crypto ⇒ ToCBOR (GenDelegs crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

toCBORGenDelegs crypto → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (GenDelegs crypto) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [GenDelegs crypto] → Size Source #

Crypto crypto ⇒ FromCBOR (GenDelegs crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

fromCBORDecoder s (GenDelegs crypto) Source #

labelProxy (GenDelegs crypto) → Text Source #

NoThunks (GenDelegs crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

noThunks ∷ Context → GenDelegs crypto → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → GenDelegs crypto → IO (Maybe ThunkInfo)

showTypeOfProxy (GenDelegs crypto) → String

type Rep (GenDelegs crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

type Rep (GenDelegs crypto) = D1 ('MetaData "GenDelegs" "Shelley.Spec.Ledger.Keys" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "GenDelegs" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGenDelegs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (KeyHash 'Genesis crypto) (GenDelegPair crypto)))))

newtype GKeys crypto Source #

Constructors

GKeys 

Fields

Instances

Instances details
Crypto crypto ⇒ Eq (GKeys crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

(==)GKeys crypto → GKeys crypto → Bool #

(/=)GKeys crypto → GKeys crypto → Bool #

Crypto crypto ⇒ Show (GKeys crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

showsPrecIntGKeys crypto → ShowS #

showGKeys crypto → String #

showList ∷ [GKeys crypto] → ShowS #

Generic (GKeys crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Associated Types

type Rep (GKeys crypto) ∷ TypeType #

Methods

fromGKeys crypto → Rep (GKeys crypto) x #

toRep (GKeys crypto) x → GKeys crypto #

Crypto crypto ⇒ NoThunks (GKeys crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

Methods

noThunks ∷ Context → GKeys crypto → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → GKeys crypto → IO (Maybe ThunkInfo)

showTypeOfProxy (GKeys crypto) → String

type Rep (GKeys crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Keys

type Rep (GKeys crypto) = D1 ('MetaData "GKeys" "Shelley.Spec.Ledger.Keys" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "GKeys" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGKeys") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set (VKey 'Genesis crypto)))))

KES

VRF

Re-exports from cardano-crypto-class

hashWithSerialiserHashAlgorithm h ⇒ (a → Encoding) → a → Hash h a Source #

A variation on hashWith, but specially for CBOR encodings.

signedKES ∷ (KESAlgorithm v, Signable v a) ⇒ ContextKES v → Period → a → SignKeyKES v → SignedKES v a Source #

updateKES Source #

Arguments

KESAlgorithm v 
ContextKES v 
SignKeyKES v 
Period

The current period for the key, not the target period.

Maybe (SignKeyKES v) 

Update the KES signature key to the next period, given the current period.

It returns Nothing if the cannot be evolved any further.

The precondition (to get a Just result) is that the current KES period of the input key is not the last period. The given period must be the current KES period of the input key (not the next or target).

The postcondition is that in case a key is returned, its current KES period is incremented by one compared to before.

Note that you must track the current period separately, and to skip to a later period requires repeated use of this function, since it only increments one period at once.

verifyKES Source #

Arguments

∷ (KESAlgorithm v, Signable v a, HasCallStack) 
ContextKES v 
VerKeyKES v 
Period

The current period for the key

→ a 
SigKES v 
Either String () 

verifySignedKES ∷ (KESAlgorithm v, Signable v a) ⇒ ContextKES v → VerKeyKES v → Period → a → SignedKES v a → Either String () Source #

Re-parametrised types over crypto

type Hash c = Hash (HASH c) Source #