You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my attempts to understand HashedElGamal, I've found problems. I wrote this unit test, while setting the environment variable to ensure I was using the 4096-bit production group.
It's worth noting that this padding process is not specified anywhere in the NIST spec. The NIST encryption has a length field that allows for truncation, and of course the message is "chunked" into 32-byte pieces that fit the underlying hash function's input size. I've only included the padding here because I need to be compatible with it.
If I strip out the padding altogether, the test will always fail.
Expected Behavior
There should exist a suitable property-based test, perhaps like the one above, that passes consistently.
* Tests for the hashed elgamal that expose the problem
* Pad incoming data during hashed elgamal decrypt to 512
* Refactor to use the 512 number from serialize.py per PR
* Refactor 512 into untils per PR
* ♻️ Refactor Byte Padding
Co-authored-by: Keith Fung <[email protected]>
Is there an existing issue for this?
Current Behavior
In my attempts to understand HashedElGamal, I've found problems. I wrote this unit test, while setting the environment variable to ensure I was using the 4096-bit production group.
This test passes often. But it sometimes fails the HMAC check.
It's worth noting that this padding process is not specified anywhere in the NIST spec. The NIST encryption has a length field that allows for truncation, and of course the message is "chunked" into 32-byte pieces that fit the underlying hash function's input size. I've only included the padding here because I need to be compatible with it.
If I strip out the padding altogether, the test will always fail.
Expected Behavior
There should exist a suitable property-based test, perhaps like the one above, that passes consistently.
For contrast, here's our TypeScript version:
https://github.com/danwallach/ElectionGuard-TypeScript/blob/main/src/electionguard/core/hashed-elgamal.ts
And the property-based tests that it passes:
https://github.com/danwallach/ElectionGuard-TypeScript/blob/main/test/electionguard/core/hashed-elgamal.test.ts
The TypeScript implementation, for contrast:
Steps To Reproduce
No response
Environment
No response
Anything else?
Related bug report: #646
The text was updated successfully, but these errors were encountered: