Skip to content

Implement an AVID protocol for batched AVSS#954

Open
jonas-lj wants to merge 91 commits into
mainfrom
jonas/avid_1
Open

Implement an AVID protocol for batched AVSS#954
jonas-lj wants to merge 91 commits into
mainfrom
jonas/avid_1

Conversation

@jonas-lj
Copy link
Copy Markdown
Contributor

@jonas-lj jonas-lj commented May 1, 2026

No description provided.

@jonas-lj jonas-lj marked this pull request as ready for review May 4, 2026 19:05
@jonas-lj jonas-lj requested a review from benr-ml May 4, 2026 19:05

/// 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 {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.
Comment thread fastcrypto-tbls/src/ecies_v1.rs Outdated
Comment thread fastcrypto-tbls/src/threshold_schnorr/reed_solomon.rs
Comment thread fastcrypto-tbls/src/threshold_schnorr/reed_solomon.rs
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs Outdated
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs Outdated
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs Outdated
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs Outdated
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs
Comment thread fastcrypto-tbls/src/threshold_schnorr/batch_avss.rs
Comment thread fastcrypto-tbls/src/threshold_schnorr/reed_solomon.rs Outdated
Comment thread fastcrypto-tbls/src/threshold_schnorr/reed_solomon.rs Outdated
Comment thread fastcrypto-tbls/src/threshold_schnorr/reed_solomon.rs Outdated
Comment thread fastcrypto-tbls/src/threshold_schnorr/reed_solomon.rs Outdated
}

#[cfg(test)]
mod tests {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding tests for the three newly-added validation paths?

jonas-lj and others added 27 commits May 11, 2026 13:43
- 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.
Co-authored-by: benr-ml <112846738+benr-ml@users.noreply.github.com>
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.

3 participants