Election-Tech-Initiative / Election-Tech-Initiative/electionguard-python

🐞 When serializing decrypted spoiled ballots, placeholder selections should be removed

オープン
#521 コメント 4 件 リアクション 0 件 担当者 1 名 @rc-ms が担当を希望しています GitHub で見る
bug
主要言語
Python
スター
168
フォーク
103
PR マージ指標
30日以内にマージされた PR はありません

説明

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

in **election_record/spoiled_ballots/spoiled_ballot_.json,** decrypted spoiled ballots still contain placeholder selections.

1. this is likely confusing for people examining spoiled ballots to verify they are correctly decrypted.

1. this causes validation 12.B ("An election verifier should also confirm that for each decrypted spoiled ballot, the selections
listed in text match the corresponding text in the ballot coding file.") to fail, eg:

```
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (referendum-pineapple-2-placeholder) not contained in contest (referendum-pineapple).
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (referendum-pineapple-2-placeholder) not contained in contest (referendum-pineapple).
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (referendum-pineapple-2-placeholder) not contained in contest (referendum-pineapple).
***Ballot Selection id (justice-supreme-court-5-placeholder) not contained in contest (justice-supreme-court).
***Ballot Selection id (justice-supreme-court-4-placeholder) not contained in contest (justice-supreme-court).
***12.B Spoiled PlaintextTally Names Validation failed.
```

### Expected Behavior

placeholder selections should not appear in decrypted spoiled ballots

### Steps To Reproduce

run TestEndToEndElection
examine election_record/spoiled_ballots/spoiled_ballot_.json

### Environment

```markdown
OS: Ubuntu 20.04
```

### Anything else?

In decrypt_with_shares.py, skip any placeholder selection:

```
def decrypt_contest_with_decryption_shares(
contest: CiphertextContest,
shares: Dict[GuardianId, DecryptionShare],
crypto_extended_base_hash: ElementModQ,
) -> Optional[PlaintextTallyContest]:
plaintext_selections: Dict[SelectionId, PlaintextTallySelection] = {}

for selection in contest.selections
if selection.is_placeholder is True:
continue
...
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。