cardano-crypto-class-2.0.0.0.1: Type classes abstracting over cryptography primitives for Cardano
Safe Haskell None
Language Haskell2010

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 :: Type -> Constraint Source #

Instances

Instances details
VRFAlgorithm NeverVRF Source #
Instance details

Defined in Cardano.Crypto.VRF.NeverUsed

VRFAlgorithm SimpleVRF Source #
Instance details

Defined in Cardano.Crypto.VRF.Simple

VRFAlgorithm MockVRF Source #
Instance details

Defined in Cardano.Crypto.VRF.Mock

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 .

Instances

Instances details
Eq ( OutputVRF v) Source #
Instance details

Defined in Cardano.Crypto.VRF.Class

Ord ( OutputVRF v) Source #
Instance details

Defined in Cardano.Crypto.VRF.Class

Show ( 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

Typeable v => FromCBOR ( OutputVRF v) Source #
Instance details

Defined in Cardano.Crypto.VRF.Class

NFData ( OutputVRF v) Source #
Instance details

Defined in Cardano.Crypto.VRF.Class

NoThunks ( OutputVRF v) Source #
Instance details

Defined in Cardano.Crypto.VRF.Class

getOutputVRFNatural :: OutputVRF 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 :: forall v. VRFAlgorithm v => Natural -> OutputVRF 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 #

Instances

Instances details
VRFAlgorithm v => Eq ( CertifiedVRF v a) Source #
Instance details

Defined in Cardano.Crypto.VRF.Class

VRFAlgorithm v => Show ( CertifiedVRF v a) Source #
Instance details

Defined in Cardano.Crypto.VRF.Class

Generic ( CertifiedVRF v a) Source #
Instance details

Defined in Cardano.Crypto.VRF.Class

Associated Types

type Rep ( CertifiedVRF v a) :: Type -> Type Source #

( VRFAlgorithm v, Typeable a) => ToCBOR ( 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 => 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.0.0.0.1-5PqST7yhL1v7PBV5z4tsb9" ' 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