cardano-crypto-class-2.2.0.0: Type classes abstracting over cryptography primitives for Cardano
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Crypto.DSIGN.Class

Description

Abstract digital signatures.

Synopsis

DSIGN algorithm class

class (Typeable v, Show (VerKeyDSIGN v), Eq (VerKeyDSIGN v), Show (SignKeyDSIGN v), Show (SigDSIGN v), Eq (SigDSIGN v), NoThunks (SigDSIGN v), NoThunks (SignKeyDSIGN v), NoThunks (VerKeyDSIGN v), KnownNat (SeedSizeDSIGN v), KnownNat (SizeVerKeyDSIGN v), KnownNat (SizeSignKeyDSIGN v), KnownNat (SizeSigDSIGN v)) ⇒ DSIGNAlgorithm v where Source #

The pure DSIGN API, which supports the full set of DSIGN operations, but does not allow for secure forgetting of private keys.

Associated Types

type SeedSizeDSIGN v ∷ Nat Source #

type SizeVerKeyDSIGN v ∷ Nat Source #

type SizeSignKeyDSIGN v ∷ Nat Source #

type SizeSigDSIGN v ∷ Nat Source #

data VerKeyDSIGN v ∷ Type Source #

data SignKeyDSIGN v ∷ Type Source #

data SigDSIGN v ∷ Type Source #

type ContextDSIGN v ∷ Type Source #

Context required to run the DSIGN algorithm

Unit by default (no context required)

type ContextDSIGN v = ()

type Signable v ∷ TypeConstraint Source #

type Signable v = Empty

Instances

Instances details
DSIGNAlgorithm EcdsaSecp256k1DSIGN Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

DSIGNAlgorithm Ed25519DSIGN Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed25519

DSIGNAlgorithm Ed448DSIGN Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed448

DSIGNAlgorithm MockDSIGN Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Mock

DSIGNAlgorithm NeverDSIGN Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.NeverUsed

DSIGNAlgorithm SchnorrSecp256k1DSIGN Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

data Seed Source #

A seed contains a finite number of bytes, and is used for seeding cryptographic algorithms including key generation.

This is not itself a PRNG, but can be used to seed a PRNG.

Instances

Instances details
Monoid Seed Source # 
Instance details

Defined in Cardano.Crypto.Seed

Methods

memptySeed Source #

mappendSeedSeedSeed Source #

mconcat ∷ [Seed] → Seed Source #

Semigroup Seed Source # 
Instance details

Defined in Cardano.Crypto.Seed

Methods

(<>)SeedSeedSeed Source #

sconcatNonEmpty SeedSeed Source #

stimesIntegral b ⇒ b → SeedSeed Source #

Show Seed Source # 
Instance details

Defined in Cardano.Crypto.Seed

Methods

showsPrecIntSeedShowS Source #

showSeedString Source #

showList ∷ [Seed] → ShowS Source #

NFData Seed Source # 
Instance details

Defined in Cardano.Crypto.Seed

Methods

rnfSeed → () Source #

Eq Seed Source # 
Instance details

Defined in Cardano.Crypto.Seed

Methods

(==)SeedSeedBool Source #

(/=)SeedSeedBool Source #

NoThunks Seed Source # 
Instance details

Defined in Cardano.Crypto.Seed

seedSizeDSIGN ∷ ∀ v proxy. DSIGNAlgorithm v ⇒ proxy v → Word Source #

The upper bound on the Seed size needed by genKeyDSIGN

sizeVerKeyDSIGN ∷ ∀ v proxy. DSIGNAlgorithm v ⇒ proxy v → Word Source #

sizeSignKeyDSIGN ∷ ∀ v proxy. DSIGNAlgorithm v ⇒ proxy v → Word Source #

sizeSigDSIGN ∷ ∀ v proxy. DSIGNAlgorithm v ⇒ proxy v → Word Source #

MLocked DSIGN algorithm class

class (DSIGNAlgorithm v, NoThunks (SignKeyDSIGNM v)) ⇒ DSIGNMAlgorithm v where Source #

Associated Types

data SignKeyDSIGNM v ∷ Type Source #

SignedDSIGN wrapper

newtype SignedDSIGN v a Source #

Constructors

SignedDSIGN (SigDSIGN v) 

Instances

Instances details
Generic (SignedDSIGN v a) Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Class

Associated Types

type Rep (SignedDSIGN v a) ∷ TypeType Source #

Methods

fromSignedDSIGN v a → Rep (SignedDSIGN v a) x Source #

toRep (SignedDSIGN v a) x → SignedDSIGN v a Source #

DSIGNAlgorithm v ⇒ Show (SignedDSIGN v a) Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Class

NFData (SigDSIGN v) ⇒ NFData (SignedDSIGN v a) Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Class

Methods

rnfSignedDSIGN v a → () Source #

DSIGNAlgorithm v ⇒ Eq (SignedDSIGN v a) Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Class

Methods

(==)SignedDSIGN v a → SignedDSIGN v a → Bool Source #

(/=)SignedDSIGN v a → SignedDSIGN v a → Bool Source #

DSIGNAlgorithm v ⇒ NoThunks (SignedDSIGN v a) Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Class

type Rep (SignedDSIGN v a) Source # 
Instance details

Defined in Cardano.Crypto.DSIGN.Class

type Rep (SignedDSIGN v a) = D1 ('MetaData "SignedDSIGN" "Cardano.Crypto.DSIGN.Class" "cardano-crypto-class-2.2.0.0-inplace" 'True) (C1 ('MetaCons "SignedDSIGN" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SigDSIGN v))))

CBOR encoding and decoding

Encoded Size expresssions

encodedVerKeyDSIGNSizeExpr ∷ ∀ v. DSIGNAlgorithm v ⇒ Proxy (VerKeyDSIGN v) → Size Source #

Size expression for VerKeyDSIGN which is using sizeVerKeyDSIGN encoded as Size.

encodedSignKeyDSIGNSizeExpr ∷ ∀ v. DSIGNAlgorithm v ⇒ Proxy (SignKeyDSIGN v) → Size Source #

Size expression for SignKeyDSIGN which is using sizeSignKeyDSIGN encoded as Size.

encodedSigDSIGNSizeExpr ∷ ∀ v. DSIGNAlgorithm v ⇒ Proxy (SigDSIGN v) → Size Source #

Size expression for SigDSIGN which is using sizeSigDSIGN encoded as Size.

Helper

failSizeCheckMonadFail m ⇒ StringStringByteStringWord → m a Source #

Helper function that always fails, but it provides a different message whenever expected size does not match.

Unsound CBOR encoding and decoding of MLocked DSIGN keys

class DSIGNMAlgorithm v ⇒ UnsoundDSIGNMAlgorithm v where Source #

Unsound operations on DSIGNM sign keys. These operations violate secure forgetting constraints by leaking secrets to unprotected memory. Consider using the DirectSerialise / DirectDeserialise APIs instead.