electionguard
electionguard copied to clipboard
♻️ Hash of Manifest should include candidates
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.
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
I think this should be
Hash of Manifest should include candidates
@JohnLCaron Thanks for keeping me honest.
Along the same lines, CandidateContestDescription does not include primary_party_ids in crypto_hash. For simplicity, one could remove CandidateContestDescription and include an optional primary_party_ids in ContestDescription.
I think this is also something overall discussed for ElectionGuard 2.0