Implement an AVID protocol for batched AVSS#954
Open
jonas-lj wants to merge 91 commits into
Open
Conversation
jonas-lj
commented
May 5, 2026
|
|
||
| /// BCS-serialized length of a `SharesForNode` for a node of the given weight at the given | ||
| /// batch size. | ||
| fn bcs_serialized_size(weight: usize, batch_size: usize) -> usize { |
Contributor
Author
There was a problem hiding this comment.
This is a bit of a hack: The erasure code pads zeros to fit the block size, so when decoding, we need to truncate before decrypting. This function computes the expected size of a parties' shares given its weight.
This is safer than relying on the dealer to give the expected length and more efficient than saving this along with the shards, but suggestions are welcome.
2 tasks
jonas-lj
added a commit
that referenced
this pull request
May 5, 2026
Splits the support-module changes out of #954 so that PR can focus on the AVID/AVSS protocol itself. No protocol changes here: - Cargo.toml: drop serde-big-array (unused), add reed-solomon-erasure for the RS code. - ecies_v1.rs: small additions used by the AVSS complaint flow, with a regression test. - nodes.rs: add `collect_to_nodes` helper. - reed_solomon.rs: extend the RS wrapper used for AVID dispersal, with doc comments on encode/decode.
benr-ml
reviewed
May 7, 2026
zhouwfang
reviewed
May 7, 2026
zhouwfang
reviewed
May 7, 2026
zhouwfang
approved these changes
May 8, 2026
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { |
Contributor
There was a problem hiding this comment.
Consider adding tests for the three newly-added validation paths?
benr-ml
approved these changes
May 10, 2026
- Add Complaint enum with Reveal and Blame variants - Unify handle_complaint to verify both - Rename DecryptedShares -> DecryptionOutcome, AvidMessage -> AuthenticatedShards, Message.avid -> dispersal - Cache ErasureCoder on Receiver
- CommonMessage gains hash() and recipient_root(id) accessors. Replaces free fns and repeated `recipient_roots.get(id as usize).ok_or(...)`. - reconstruct_ciphertext now takes &BTreeMap<PartyId, AuthenticatedShards> directly, dropping the closure indirection. - recover drops the upfront total_response_weight check (the filter_map already handles invalid responder ids and the post-filter weight check enforces the quorum). - Inline require_uniform_common_message_hash at its only call site.
…ct_ciphertext doc
Co-authored-by: benr-ml <112846738+benr-ml@users.noreply.github.com>
…gle shadowed binding
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.
No description provided.