Skip to main content

Module mock

Module mock 

Source
Expand description

Mock threshold-signature scheme — "mock-tc-sig".

This is a deterministic, cryptographically meaningless scheme whose only purpose is to exercise the full crate::session::Session lifecycle (create → round → result) end-to-end. It proves the framework wiring is correct: the registry resolves the scheme, the session drives the rounds, the threshold property holds (any T of N parties produce identical output), and below-threshold coalitions fail.

§Protocol

The “shared secret” is a fixed fake key baked into every party’s share bytes. The “signature” is a deterministic function of the full party roster plus the signed message — it never depends on which coalition produced it, so any T-of-N produces the same bytes.

Three rounds:

  • Round 0 — broadcast: each party emits its party_id plus a nonce derived deterministically from (shared_key, party_id, message). Determinism guarantees the nonce set is identical across coalitions of the same party roster.

  • Round 1 — broadcast: each party HMAC-SHA256-signs the sorted nonce set with the shared key, then broadcasts the tag.

  • Round 2 — complete: the party checks that at least T distinct round-1 tags arrived (threshold enforcement), then rebuilds the canonical signature by re-deriving every roster party’s round-1 tag and concatenating them sorted by party_id. Because nonces and the HMAC key are deterministic, this signature is identical on every party regardless of coalition.

Structs§

MockTcSigScheme
Mock threshold-signature scheme.

Constants§

SCHEME_NAME
Canonical scheme name advertised through the registry.