cardano-crypto-leios-0.1.0.0: Crypto primitives for Leios
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Crypto.Leios.Gen

Description

QuickCheck generators for Leios types, intended for downstream test suites (e.g. cardano-ledger) that want a real structurally-valid LeiosCert without depending on the BLS plumbing.

These generators produce values whose CBOR encoding round-trips, but they do not attempt to satisfy verifyLeiosCert against any particular committee or message — the signers bitfield is uncorrelated with the aggregated signature. That makes them suitable for serialisation and AST-shape tests, not for protocol-level acceptance tests.

Synopsis

Documentation

genLeiosCertGen LeiosCert Source #

Generate a real, canonical LeiosCert by building a fresh committee and aggregating a non-empty subset of its members' signatures over a random message. The cert is structurally valid (bitfield length matches the committee, aggregate signature is well-formed) but the committee is not returned — suitable for CBOR / AST-shape tests, not for protocol-acceptance tests in downstream packages.

Coverage of bitfield byte-length boundaries (CBOR uint widths > 256 bytes) is not exercised here; that belongs in this package's own test suite, not in the shared testlib.

genLeiosSignatureGen LeiosSignature Source #

Generate a real BLS LeiosSignature by signing a random message with a freshly-generated signing key. Suitable as a byte-generator source for CDDL specs that need on-wire bytes which round-trip through rawDeserialiseSigDSIGN — uniformly random 48-byte strings do not decode to valid BLS G1 points and will crash there.

genLeiosSigningKeyGen LeiosSigningKey Source #

Generate a LeiosSigningKey from a uniformly random seed of the algorithm's expected size.

generateWithGen a → Word64 → a Source #

Deterministically evaluate a QuickCheck Gen at a fixed seed. Useful for pinning a single value (e.g. for golden tests) without going through generate in IO.