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

Cardano.Crypto.VRF.Class

Description

Abstract Verifiable Random Functions.

Synopsis

VRF algorithm class

class (Typeable v, Show (VerKeyVRF v), Eq (VerKeyVRF v), Show (SignKeyVRF v), Show (CertVRF v), Eq (CertVRF v), NoThunks (CertVRF v), NoThunks (VerKeyVRF v), NoThunks (SignKeyVRF v)) ⇒ VRFAlgorithm v where Source #

Associated Types

data VerKeyVRF v ∷ Type Source #

data SignKeyVRF v ∷ Type Source #

data CertVRF v ∷ Type Source #

type ContextVRF v ∷ Type Source #

Context required to run the VRF algorithm

Unit by default (no context required)

type ContextVRF v = ()

type Signable v ∷ TypeConstraint Source #

type Signable c = Empty

Instances

Instances details
VRFAlgorithm MockVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.Mock

VRFAlgorithm NeverVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.NeverUsed

VRFAlgorithm SimpleVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.Simple

VRF output

newtype OutputVRF v Source #

The output bytes of the VRF.

The output size is a fixed number of bytes and is given by sizeOutputVRF.

Constructors

OutputVRF 

Instances

Instances details
Show (OutputVRF v) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

Typeable v ⇒ FromCBOR (OutputVRF v) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

Typeable v ⇒ ToCBOR (OutputVRF v) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

Methods

toCBOROutputVRF v → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (OutputVRF v) → Size Source #

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

NFData (OutputVRF v) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

Methods

rnfOutputVRF v → () Source #

Eq (OutputVRF v) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

Methods

(==)OutputVRF v → OutputVRF v → Bool Source #

(/=)OutputVRF v → OutputVRF v → Bool Source #

Ord (OutputVRF v) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

NoThunks (OutputVRF v) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

getOutputVRFNaturalOutputVRF v → Natural Source #

The output bytes of the VRF interpreted as a big endian natural number.

The range of this number is determined by the size of the VRF output bytes. It is thus in the range 0 .. 2 ^ (8 * sizeOutputVRF proxy) - 1.

mkTestOutputVRF ∷ ∀ v. VRFAlgorithm v ⇒ NaturalOutputVRF v Source #

For testing purposes, make an OutputVRF from a Natural.

The OutputVRF will be of the appropriate size for the VRFAlgorithm.

CertifiedVRF wrapper

data CertifiedVRF v a Source #

Constructors

CertifiedVRF 

Fields

Instances

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

Defined in Cardano.Crypto.VRF.Class

Associated Types

type Rep (CertifiedVRF v a) ∷ TypeType Source #

Methods

fromCertifiedVRF v a → Rep (CertifiedVRF v a) x Source #

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

VRFAlgorithm v ⇒ Show (CertifiedVRF v a) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

(VRFAlgorithm v, Typeable a) ⇒ FromCBOR (CertifiedVRF v a) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

(VRFAlgorithm v, Typeable a) ⇒ ToCBOR (CertifiedVRF v a) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

Methods

toCBORCertifiedVRF v a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (CertifiedVRF v a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [CertifiedVRF v a] → Size Source #

VRFAlgorithm v ⇒ Eq (CertifiedVRF v a) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

Methods

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

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

VRFAlgorithm v ⇒ NoThunks (CertifiedVRF v a) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

type Rep (CertifiedVRF v a) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Class

type Rep (CertifiedVRF v a) = D1 ('MetaData "CertifiedVRF" "Cardano.Crypto.VRF.Class" "cardano-crypto-class-2.2.0.0-inplace" 'False) (C1 ('MetaCons "CertifiedVRF" 'PrefixI 'True) (S1 ('MetaSel ('Just "certifiedOutput") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (OutputVRF v)) :*: S1 ('MetaSel ('Just "certifiedProof") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CertVRF v))))

CBOR encoding and decoding

Encoded Size expressions

encodedVerKeyVRFSizeExpr ∷ ∀ v. VRFAlgorithm v ⇒ Proxy (VerKeyVRF v) → Size Source #

Size expression for VerKeyVRF which is using sizeVerKeyVRF encoded as Size.

encodedSignKeyVRFSizeExpr ∷ ∀ v. VRFAlgorithm v ⇒ Proxy (SignKeyVRF v) → Size Source #

Size expression for SignKeyVRF which is using sizeSignKeyVRF encoded as Size

encodedCertVRFSizeExpr ∷ ∀ v. VRFAlgorithm v ⇒ Proxy (CertVRF v) → Size Source #

Size expression for CertVRF which is using sizeCertVRF encoded as Size.