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

♻️ Hash of Manifest should include candidates

Open
#225 4 comments 0 reactions 0 assignees View on GitHub
enhancement question
Dominant language
Python
Stars
872
Forks
131
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Suggestion

This is an update for documentation of hashing and proposing changes for 2.0.

The hash of the Manifest done in both languages does not include the contests. This seems like a necessity.

```py
def crypto_hash(self) -> ElementModQ:
"""
Returns a hash of the metadata components of the election
"""
hash = hash_elems(
self.election_scope_id,
str(self.type.name),
to_iso_date_string(self.start_date),
to_iso_date_string(self.end_date),
self.name,
self.contact_information,
self.geopolitical_units,
self.parties,
self.contests,
self.ballot_styles,
)
log_debug(f"{self.__class__} : crypto_hash: {hash.to_hex()}")
return hash
```

### Possible Implementation

_No response_

### Anything else?

Original Issue by @JohnLCaron
https://github.com/microsoft/electionguard-python/issues/523

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.