chilldkg: tighten API and internal representation#248
Merged
Conversation
890a003 to
e037e96
Compare
5f191b4 to
a7263ab
Compare
e037e96 to
8c3f869
Compare
3fb755a to
b426366
Compare
b426366 to
a3464ae
Compare
LLFourn
commented
Apr 30, 2026
46f1b5c to
0ad908c
Compare
8c3f869 to
4102268
Compare
c815239 to
c12a19a
Compare
c12a19a to
7b01ae4
Compare
nickfarrow
previously approved these changes
May 7, 2026
e88dbb2 to
7b01ae4
Compare
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.
7b01ae4 to
1d1b02b
Compare
nickfarrow
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #247. A single squashed commit that tightens the chilldkg API.
The core idea: each
Contributornow 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 differentcert_bytesper 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
finalizeparameter; both move onto the contributor atgen_keygen_inputtime and feed intocert_bytes()via the verified state.encpedpop::AggKeygenInputlength 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.Contributoris 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
EncryptionCheckErrorsub-enum is shared between aux and share-receiver verify paths so simplepedpop errors flow through oneInnerpath 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.