| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- data PraosBatchCompatVRF
- crypto_vrf_ietfdraft13_bytes_batchcompat ∷ CSize
- crypto_vrf_ietfdraft13_publickeybytes ∷ CSize
- crypto_vrf_ietfdraft13_secretkeybytes ∷ CSize
- crypto_vrf_ietfdraft13_seedbytes ∷ CSize
- crypto_vrf_ietfdraft13_outputbytes ∷ CSize
- io_crypto_vrf_ietfdraft13_publickeybytes ∷ IO CSize
- io_crypto_vrf_ietfdraft13_secretkeybytes ∷ IO CSize
- certSizeVRF ∷ Int
- signKeySizeVRF ∷ Int
- verKeySizeVRF ∷ Int
- vrfKeySizeVRF ∷ Int
- data Seed
- genSeed ∷ IO Seed
- keypairFromSeed ∷ Seed → (VerKey, SignKey)
- unsafeRawSeed ∷ Seed → IO ByteString
- outputBytes ∷ Output → ByteString
- outputFromBytes ∷ MonadFail m ⇒ ByteString → m Output
- outputFromProof ∷ Proof → Maybe Output
- proofBytes ∷ Proof → ByteString
- proofFromBytes ∷ MonadFail m ⇒ ByteString → m Proof
- skBytes ∷ SignKey → ByteString
- skFromBytes ∷ MonadFail m ⇒ ByteString → m SignKey
- vkBytes ∷ VerKey → ByteString
- vkFromBytes ∷ MonadFail m ⇒ ByteString → m VerKey
- skToVerKey ∷ SignKey → VerKey
- skToSeed ∷ SignKey → Seed
- prove ∷ SignKey → ByteString → Maybe Proof
- verify ∷ VerKey → Proof → ByteString → Maybe Output
- data family SignKeyVRF v
- data family VerKeyVRF v
- data family CertVRF v
- data Proof
- data SignKey
- data VerKey
- data Output
VRFAlgorithm API
data PraosBatchCompatVRF Source #
Instances
Low-level size specifiers
Key sizes
Seed and key generation
A random seed, used to derive a key pair.
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.
Conversions
unsafeRawSeed ∷ Seed → IO 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.
outputFromBytes ∷ MonadFail m ⇒ ByteString → m Output Source #
proofBytes ∷ Proof → ByteString Source #
Deprecated: Use rawEncodeFixedSized instead
Convert a proof into a ByteString that we can inspect.
proofFromBytes ∷ MonadFail m ⇒ ByteString → m Proof Source #
Deprecated: Use rawDecodeFixedSized instead
skBytes ∷ SignKey → ByteString Source #
Deprecated: Use rawEncodeFixedSized instead
Convert a signing key into a ByteString that we can inspect.
skFromBytes ∷ MonadFail m ⇒ ByteString → m SignKey Source #
Deprecated: Use rawDecodeFixedSized instead
vkBytes ∷ VerKey → ByteString Source #
Deprecated: Use rawEncodeFixedSized instead
Convert a verification key into a ByteString that we can inspect.
vkFromBytes ∷ MonadFail m ⇒ ByteString → m VerKey Source #
Deprecated: Use rawDecodeFixedSized instead
skToVerKey ∷ SignKey → VerKey Source #
Derive a Verification Key from a Signing Key.
Core VRF operations
data family SignKeyVRF v Source #
Instances
data family VerKeyVRF v Source #
Instances
data family CertVRF v Source #
Instances
A proof, as constructed by the prove function.
Instances
| Generic Proof Source # | |
| Show Proof Source # | |
| FixedSizeCodec Proof Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat Methods rawEncodeFixedSized ∷ Proof → ByteString Source # rawDecodeFixedSized ∷ MonadFail m ⇒ ByteString → m Proof Source # | |
| FromCBOR Proof Source # | |
| ToCBOR Proof Source # | |
| NFData Proof Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |
| Eq Proof Source # | |
| Ord Proof Source # | |
| NoThunks Proof Source # | |
| type Rep Proof Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |
| type FixedSize Proof Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |
Signing key. In this implementation, the signing key is actually a 64-byte value that contains both the 32-byte signing key and the corresponding 32-byte verification key.
Instances
| Generic SignKey Source # | |
| Show SignKey Source # | |
| FixedSizeCodec SignKey Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat Methods rawEncodeFixedSized ∷ SignKey → ByteString Source # rawDecodeFixedSized ∷ MonadFail m ⇒ ByteString → m SignKey Source # | |
| FromCBOR SignKey Source # | |
| ToCBOR SignKey Source # | |
| NFData SignKey Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |
| Eq SignKey Source # | |
| NoThunks SignKey Source # | |
| type Rep SignKey Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |
| type FixedSize SignKey Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |
Verification key.
Instances
| Generic VerKey Source # | |
| Show VerKey Source # | |
| FixedSizeCodec VerKey Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat Methods rawEncodeFixedSized ∷ VerKey → ByteString Source # rawDecodeFixedSized ∷ MonadFail m ⇒ ByteString → m VerKey Source # | |
| FromCBOR VerKey Source # | |
| ToCBOR VerKey Source # | |
| NFData VerKey Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |
| Eq VerKey Source # | |
| NoThunks VerKey Source # | |
| type Rep VerKey Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |
| type FixedSize VerKey Source # | |
Defined in Cardano.Crypto.VRF.PraosBatchCompat | |