You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its not obvious whether selection ids must be unique only within contests or across contests.
In decryption_share, we search across all shares, all contests, all selections, and match on the selection_id
def get_shares_for_selection(
selection_id: str,
shares: Dict[GuardianId, DecryptionShare],
) -> Dict[GuardianId, Tuple[ElementModP, CiphertextDecryptionSelection]]:
"""
Get all of the cast shares for a specific selection
"""
selections: Dict[GuardianId, Tuple[ElementModP, CiphertextDecryptionSelection]] = {}
for share in shares.values():
for contest in share.contests.values():
for selection in contest.selections.values():
if selection.object_id == selection_id:
selections[share.guardian_id] = (share.public_key, selection)
return selections
So this implies that selection_ids must be unique across all contests. If you didnt enforce that, likely there would be a verification failure. I think it would only fail when there are missing guardians, so it might be easy to miss in testing.
We could change that code to check both the contest id and the selection id, or just document and verify that selection ids are unique in the entire election manifest.
Possible Implementation
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Suggestion
Its not obvious whether selection ids must be unique only within contests or across contests.
In decryption_share, we search across all shares, all contests, all selections, and match on the selection_id
So this implies that selection_ids must be unique across all contests. If you didnt enforce that, likely there would be a verification failure. I think it would only fail when there are missing guardians, so it might be easy to miss in testing.
We could change that code to check both the contest id and the selection id, or just document and verify that selection ids are unique in the entire election manifest.
Possible Implementation
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: