There are multiple places at the protocol level where we can't be sure about the self-consistency of party idx and the total number of parties. e.g.:
the number of parties should be non-zero (maybe even >1)
the party index must be within the number of parties
the party index should not coincide with the current party's index (e.g. in verify_direct_message()/verify_broadcast())
the consistency of the party index/number of parties obtained from different sources (e.g. on creation of presigning::Round1 we get those as separate arguments, and in a KeyShare object)
the correct size and excluded index in the HoleVec objects passed to finalize_to_result()/finalize_to_next_round() methods
We are using maps/sets keyed by an ID type now, so this issue is largely invalidated. To close it completely we need to enable clippy::indexing_slicing lint.
There are multiple places at the protocol level where we can't be sure about the self-consistency of party idx and the total number of parties. e.g.:
verify_direct_message()
/verify_broadcast()
)presigning::Round1
we get those as separate arguments, and in aKeyShare
object)HoleVec
objects passed tofinalize_to_result()
/finalize_to_next_round()
methodsThese should be asserted.