cardano-crypto-praos-2.2.0.0: Crypto primitives from libsodium
Safe HaskellNone
LanguageHaskell2010

Cardano.Crypto.VRF.PraosBatchCompat

Description

Verifiable Random Function (VRF) implemented as FFI wrappers around the implementation in https://github.com/input-output-hk/libsodium

Synopsis

VRFAlgorithm API

data PraosBatchCompatVRF Source #

Instances

Instances details
VRFAlgorithm PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Methods

algorithmNameVRF ∷ proxy PraosBatchCompatVRFString Source #

deriveVerKeyVRFSignKeyVRF PraosBatchCompatVRFVerKeyVRF PraosBatchCompatVRF Source #

hashVerKeyVRFHashAlgorithm h ⇒ VerKeyVRF PraosBatchCompatVRFHash h (VerKeyVRF PraosBatchCompatVRF) Source #

evalVRF ∷ (HasCallStack, Signable PraosBatchCompatVRF a) ⇒ ContextVRF PraosBatchCompatVRF → a → SignKeyVRF PraosBatchCompatVRF → (OutputVRF PraosBatchCompatVRF, CertVRF PraosBatchCompatVRF) Source #

verifyVRF ∷ (HasCallStack, Signable PraosBatchCompatVRF a) ⇒ ContextVRF PraosBatchCompatVRFVerKeyVRF PraosBatchCompatVRF → a → CertVRF PraosBatchCompatVRFMaybe (OutputVRF PraosBatchCompatVRF) Source #

genKeyVRFSeedSignKeyVRF PraosBatchCompatVRF Source #

genKeyPairVRFSeed → (SignKeyVRF PraosBatchCompatVRF, VerKeyVRF PraosBatchCompatVRF) Source #

seedSizeVRF ∷ proxy PraosBatchCompatVRFWord Source #

sizeVerKeyVRF ∷ proxy PraosBatchCompatVRFWord Source #

sizeSignKeyVRF ∷ proxy PraosBatchCompatVRFWord Source #

sizeCertVRF ∷ proxy PraosBatchCompatVRFWord Source #

sizeOutputVRF ∷ proxy PraosBatchCompatVRFWord Source #

rawSerialiseVerKeyVRFVerKeyVRF PraosBatchCompatVRFByteString Source #

rawSerialiseSignKeyVRFSignKeyVRF PraosBatchCompatVRFByteString Source #

rawSerialiseCertVRFCertVRF PraosBatchCompatVRFByteString Source #

rawDeserialiseVerKeyVRFByteStringMaybe (VerKeyVRF PraosBatchCompatVRF) Source #

rawDeserialiseSignKeyVRFByteStringMaybe (SignKeyVRF PraosBatchCompatVRF) Source #

rawDeserialiseCertVRFByteStringMaybe (CertVRF PraosBatchCompatVRF) Source #

Generic (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Associated Types

type Rep (CertVRF PraosBatchCompatVRF) ∷ TypeType Source #

Generic (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Associated Types

type Rep (SignKeyVRF PraosBatchCompatVRF) ∷ TypeType Source #

Generic (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Associated Types

type Rep (VerKeyVRF PraosBatchCompatVRF) ∷ TypeType Source #

Show (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Show (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Show (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

FromCBOR (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

FromCBOR (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

FromCBOR (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

ToCBOR (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

ToCBOR (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

ToCBOR (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NFData (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NFData (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NFData (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Eq (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Eq (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Eq (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NoThunks (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NoThunks (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NoThunks (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

newtype CertVRF PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

type ContextVRF PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

newtype SignKeyVRF PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

type Signable PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

newtype VerKeyVRF PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

type Rep (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

type Rep (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

type Rep (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Low-level size specifiers

Key sizes

Seed and key generation

data Seed Source #

A random seed, used to derive a key pair.

Instances

Instances details
NoThunks Seed Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

genSeedIO Seed Source #

Generate a random seed. Uses randombytes_buf to create random data.

This function provides an alternative way of generating seeds specifically for the PraosVRF algorithm. Unlike the genKeyPairVRF method, which uses a ByteString-based Seed, this seed generation method bypasses the GHC heap, keeping the seed in C-allocated memory instead.

This provides two advantages: 1. It avoids the overhead of unnecessary GHC-side heap allocations. 2. It avoids leaking the seed via the GHC heap; the Seed type itself takes care of zeroing out its memory upon finalization.

keypairFromSeedSeed → (VerKey, SignKey) Source #

Derive a key pair (Sign + Verify) from a seed.

Conversions

unsafeRawSeedSeedIO ByteString Source #

Convert an opaque Seed into a ByteString that we can inspect. Note that this will copy the seed into RTS-managed memory; this is not currently a problem, but if at any point we decide that we want to make sure the seed is properly mlocked, then this function will leak such a secured seed into non-locked (swappable) memory.

outputBytes ∷ Output → ByteString Source #

Convert a proof verification output hash into a ByteString that we can inspect.

proofBytes ∷ Proof → ByteString Source #

Convert a proof into a ByteString that we can inspect.

skBytes ∷ SignKey → ByteString Source #

Convert a signing key into a ByteString that we can inspect.

vkBytes ∷ VerKey → ByteString Source #

Convert a verification key into a ByteString that we can inspect.

skToVerKey ∷ SignKey → VerKey Source #

Derive a Verification Key from a Signing Key.

skToSeed ∷ SignKey → Seed Source #

Get the seed used to generate a given Signing Key

Core VRF operations

prove ∷ SignKey → ByteStringMaybe Proof Source #

Construct a proof from a Signing Key and a message. Returns Just the proof on success, Nothing if the signing key could not be decoded.

verify ∷ VerKey → Proof → ByteStringMaybe Output Source #

Verify a VRF proof and validate the Verification Key. Returns Just a hash of the verification result on success, Nothing if the verification did not succeed.

For a given verification key and message, there are many possible proofs but only one possible output hash.

data family SignKeyVRF v Source #

Instances

Instances details
Generic (SignKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Associated Types

type Rep (SignKeyVRF PraosVRF) ∷ TypeType Source #

Generic (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Associated Types

type Rep (SignKeyVRF PraosBatchCompatVRF) ∷ TypeType Source #

Show (SignKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Show (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

FromCBOR (SignKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

ToCBOR (SignKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

ToCBOR (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NFData (SignKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Methods

rnfSignKeyVRF PraosVRF → () Source #

NFData (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Eq (SignKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Eq (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

(TypeError ('Text "Ord not supported for signing keys, use the hash instead") ∷ Constraint, Eq (SignKeyVRF v)) ⇒ Ord (SignKeyVRF v) 
Instance details

Defined in Cardano.Crypto.VRF.Class

NoThunks (SignKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

NoThunks (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

newtype SignKeyVRF PraosVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

newtype SignKeyVRF PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

type Rep (SignKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

type Rep (SignKeyVRF PraosVRF) = D1 ('MetaData "SignKeyVRF" "Cardano.Crypto.VRF.Praos" "cardano-crypto-praos-2.2.0.0-inplace" 'True) (C1 ('MetaCons "SignKeyPraosVRF" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SignKey)))
type Rep (SignKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

data family VerKeyVRF v Source #

Instances

Instances details
Generic (VerKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Associated Types

type Rep (VerKeyVRF PraosVRF) ∷ TypeType Source #

Generic (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Associated Types

type Rep (VerKeyVRF PraosBatchCompatVRF) ∷ TypeType Source #

Show (VerKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Show (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

FromCBOR (VerKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

ToCBOR (VerKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

ToCBOR (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NFData (VerKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Methods

rnfVerKeyVRF PraosVRF → () Source #

NFData (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Eq (VerKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Eq (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

(TypeError ('Text "Ord not supported for verification keys, use the hash instead") ∷ Constraint, Eq (VerKeyVRF v)) ⇒ Ord (VerKeyVRF v) 
Instance details

Defined in Cardano.Crypto.VRF.Class

NoThunks (VerKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

NoThunks (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

newtype VerKeyVRF PraosVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

newtype VerKeyVRF PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

type Rep (VerKeyVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

type Rep (VerKeyVRF PraosVRF) = D1 ('MetaData "VerKeyVRF" "Cardano.Crypto.VRF.Praos" "cardano-crypto-praos-2.2.0.0-inplace" 'True) (C1 ('MetaCons "VerKeyPraosVRF" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VerKey)))
type Rep (VerKeyVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

data family CertVRF v Source #

Instances

Instances details
Generic (CertVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Associated Types

type Rep (CertVRF PraosVRF) ∷ TypeType Source #

Generic (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Associated Types

type Rep (CertVRF PraosBatchCompatVRF) ∷ TypeType Source #

Show (CertVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Show (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

FromCBOR (CertVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

ToCBOR (CertVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Methods

toCBORCertVRF PraosVRFEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (CertVRF PraosVRF) → Size Source #

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

ToCBOR (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NFData (CertVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Methods

rnfCertVRF PraosVRF → () Source #

NFData (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Eq (CertVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Eq (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

NoThunks (CertVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

NoThunks (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

newtype CertVRF PraosVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

newtype CertVRF PraosBatchCompatVRF Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

type Rep (CertVRF PraosVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.Praos

type Rep (CertVRF PraosVRF) = D1 ('MetaData "CertVRF" "Cardano.Crypto.VRF.Praos" "cardano-crypto-praos-2.2.0.0-inplace" 'True) (C1 ('MetaCons "CertPraosVRF" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Proof)))
type Rep (CertVRF PraosBatchCompatVRF) Source # 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat