Election-Tech-Initiative / electionguard-python

A python module implementing the ElectionGuard specification. This implementation can be used to conduct End-to-End Verifiable Elections as well as privacy-enhanced risk-limiting audits.
https://www.electionguard.vote/
MIT License
162 stars 96 forks source link

✨ Null hashes don't match between Python and C++ #535

Open lmarie79 opened 2 years ago

lmarie79 commented 2 years ago

Feature Request

Description There is a discrepancy between null hashes in the C and Python code. A hash of null results in H() in one case but H(|), a hash of a delimiter, in the other.

Proposed Solution Per @benaloh - a null hash should just be H()

keithrfung commented 2 years ago

We are waiting for an individual to confirm the location of this issue. This is marked as question due to this.

keithrfung commented 2 years ago

This doesn't make sense. The code reads this should result in a hash of H(|null|) in python. We definitely need follow up. https://github.com/microsoft/electionguard-python/blob/e35b68dc3175243ffaf872e9a0ea56c5b8a05830/src/electionguard/hash.py#L88-L93

lmarie79 commented 2 years ago

@rc-ms considering whether to push to 2.0 or closing all together

benaloh commented 2 years ago

Consistency amongst implementations and clarity are most important. A null hash being H() is best, but this can be deferred until 2.0 as long as re eliminate inconsistencies and ambiguities now.