Skip to main content

Module inprocess

Module inprocess 

Source
Expand description

In-process synchronous driver for any registered threshold scheme.

Wraps the multi-round session state machine in a single function call so language bindings and integration tests don’t have to reconstruct the round / message-routing loop on their own side. The driver is local — it does no real networking — and is intended for integration tests, demos, and the in-process surface of language bindings. Production deployments drive the sessions over a real transport via confium-tc-coordinator.

§Why this exists

Without this module every binding (Ruby, Python, WASM, the in-tree examples) had to copy the same N-session-create + route-messages + drive-rounds boilerplate. The CMP20 and GG18 in-process shims were ~200 LOC each, ~90% of which was identical. This module collapses that pattern into one place; scheme-specific shims now only declare their scheme name and how to extract a public key from a share blob.

§Output contract

run_dkg returns the per-party share blobs produced by Session::result. The joint public key is not returned — the caller knows the scheme-specific encoding and extracts it from the first share (see confium-tc-cmp20::inprocess::keygen for the pattern).

run_sign returns the cryptographic artifact (e.g. a 64-byte (r, s) ECDSA signature).

Functions§

run_dkg
Drive a registered DKG scheme to completion in-process.
run_sign
Drive a registered signing / decapsulation scheme to completion in-process using share_blobs as the per-party inputs.