Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HashedElGamal: Compatibility with the reference implementation #26

Open
shreyasminocha opened this issue Jun 26, 2022 · 3 comments
Open

Comments

@shreyasminocha
Copy link
Collaborator

shreyasminocha commented Jun 26, 2022

Manually transferred.

Dependent issue: Election-Tech-Initiative/electionguard-python#646

Depending on what they do or don't fix, we might need to:

  • Ensure that we're always serializing integers to 32-bits
  • Remove the 0x00 from the KDF computation
  • Encode HMAC keys in hex bytes (hopefully not!)

We should also double-check that they are correctly handling inputs that aren't multiples of 32 bytes long.

@danwallach
Copy link
Owner

Short term: we're not using HashedElGamal and not supporting features that require it (encoding overvotes & write-ins).

In the fall, when ElectionGuard gets past the 1.0x versions in to 2.0, we'll bring this back.

@shreyasminocha
Copy link
Collaborator Author

So in the meantime what should we do about the numBytes field? It causes issues with my compatibility tests, particularly in terms of deserializing and re-serializing the sample data. electionguard-python's padding approach has issues like you described earlier. I saw that electionguard-cpp just errors on plaintexts and ciphertexts whose length isn't a multiple of the block size. Should I implement something of that sort and adjust the tests accordingly?

@danwallach
Copy link
Owner

Hmm. It really bugs me when we have a "correct" implementation and we have to introduce bugs.

I suggest we introduce a HashedElGamalCompat structure of some kind, which is just an empty shell of a data structure. We can serialize and deserialize, but it has no actual code attached. Since we're not actually using it, we don't care about it yet.

shreyasminocha added a commit that referenced this issue Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants