Skip to content

chilldkg: tighten API and internal representation#248

Merged
LLFourn merged 1 commit into
masterfrom
chilldkg-api-tightening
May 8, 2026
Merged

chilldkg: tighten API and internal representation#248
LLFourn merged 1 commit into
masterfrom
chilldkg-api-tightening

Conversation

@LLFourn
Copy link
Copy Markdown
Owner

@LLFourn LLFourn commented Apr 30, 2026

Summary

Stacked on #247. A single squashed commit that tightens the chilldkg API.

The core idea: each Contributor now saves the parameters it was set up with (encryption keys, contributor nonce, threshold, role, slot) and verifies the aggregated input against that saved view rather than trusting whatever the coordinator returns. cert_bytes() incorporates the saved keysets, so a malicious coordinator that shows different parties different views of the receiver- or aux-keyset produces different cert_bytes per victim and mutual certification fails.

The biggest consequences:

  • Receiver encryption keys leave the encpedpop wire form (they were embedded next to each encrypted share) and aux contributor keys stop being a finalize parameter; both move onto the contributor at gen_keygen_input time and feed into cert_bytes() via the verified state.

  • encpedpop::AggKeygenInput length consistency is enforced on deserialize via a private wire type, so downstream code can assume the embedded simplepedpop contributor count matches the encryption-nonce count.

  • Contributor is type-parameterized by role (ShareReceiver | AuxContributor). The role decides slot-index translation at compile time and selects the verify shape; ShareReceiver's verify atomically pairs the secret share, and the share is gated behind a final certificate check.

  • Errors are split into per-function variants so each call site enumerates exactly the conditions it can produce; an EncryptionCheckError sub-enum is shared between aux and share-receiver verify paths so simplepedpop errors flow through one Inner path with no ambiguity.

The only thing missing from this PR is a way to "keep around" the final agg keygen so you can actually recover from it. We don't use that in frostsnap but the feature has been soft-deleted since it's hard to create a VerifiedAggKeygenInput (which is the thing you can actually recover from) and you can't serialize it.

Frostsnap is updated against this branch in frostsnap/frostsnap#chilldkg-api-update.

@LLFourn LLFourn force-pushed the claude-security-review-omnibus branch from 890a003 to e037e96 Compare April 30, 2026 06:27
@LLFourn LLFourn force-pushed the chilldkg-api-tightening branch from 5f191b4 to a7263ab Compare April 30, 2026 06:27
@LLFourn LLFourn force-pushed the claude-security-review-omnibus branch from e037e96 to 8c3f869 Compare April 30, 2026 06:30
@LLFourn LLFourn force-pushed the chilldkg-api-tightening branch 2 times, most recently from 3fb755a to b426366 Compare April 30, 2026 06:36
@LLFourn LLFourn force-pushed the chilldkg-api-tightening branch from b426366 to a3464ae Compare April 30, 2026 07:15
Comment thread schnorr_fun/src/frost/chilldkg/certpedpop/certificate.rs Outdated
@LLFourn LLFourn force-pushed the chilldkg-api-tightening branch 15 times, most recently from 46f1b5c to 0ad908c Compare May 1, 2026 08:51
@LLFourn LLFourn force-pushed the claude-security-review-omnibus branch from 8c3f869 to 4102268 Compare May 1, 2026 08:58
@LLFourn LLFourn force-pushed the chilldkg-api-tightening branch 6 times, most recently from c815239 to c12a19a Compare May 4, 2026 00:23
@LLFourn LLFourn force-pushed the chilldkg-api-tightening branch from c12a19a to 7b01ae4 Compare May 4, 2026 00:55
@LLFourn LLFourn requested a review from nickfarrow May 6, 2026 00:32
nickfarrow
nickfarrow previously approved these changes May 7, 2026
Comment thread schnorr_fun/src/frost/chilldkg/certpedpop.rs
@LLFourn LLFourn changed the base branch from claude-security-review-omnibus to master May 8, 2026 01:57
@LLFourn LLFourn dismissed nickfarrow’s stale review May 8, 2026 01:57

The base branch was changed.

@LLFourn LLFourn force-pushed the chilldkg-api-tightening branch 2 times, most recently from e88dbb2 to 7b01ae4 Compare May 8, 2026 02:18
Each Contributor now saves the parameters it was set up with (encryption
keys, contributor nonce, threshold, role, slot) and verifies the
aggregated input against that saved view rather than trusting whatever
the coordinator returns. cert_bytes() incorporates the saved keysets, so
a malicious coordinator that shows different parties different views of
the receiver- or aux-keyset produces different cert_bytes per victim and
mutual certification fails.

The biggest consequences:

- Receiver encryption keys leave the encpedpop wire form (they were
  embedded next to each encrypted share) and aux contributor keys stop
  being a `finalize` parameter; both move onto the contributor at
  gen_keygen_input time and feed into cert_bytes() via the verified
  state.

- encpedpop::AggKeygenInput length consistency is enforced on
  deserialize via a private wire type, so downstream code can assume
  the embedded simplepedpop contributor count matches the
  encryption-nonce count.

- Contributor is type-parameterized by role (ShareReceiver |
  AuxContributor). The role decides slot-index translation at compile
  time and selects the verify shape; ShareReceiver's verify atomically
  pairs the secret share, and the share is gated behind a final
  certificate check.

- Errors are split into per-function variants so each call site
  enumerates exactly the conditions it can produce; an
  EncryptionCheckError sub-enum is shared between aux and share-receiver
  verify paths so simplepedpop errors flow through one Inner path with
  no ambiguity.
@LLFourn LLFourn force-pushed the chilldkg-api-tightening branch from 7b01ae4 to 1d1b02b Compare May 8, 2026 02:43
@LLFourn LLFourn merged commit bf68d94 into master May 8, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants