Election-Tech-Initiative / electionguard-cpp

A C++ implementation of ElectionGuard specification focused on encryption components.
https://www.electionguard.vote/
MIT License
23 stars 26 forks source link

Optimize Chaum Pedersen Proof Generation & Validation #72

Open AddressXception opened 3 years ago

AddressXception commented 3 years ago

As a user of electionguard I would like selection and contest proof generation and validation to be as fast as possible so that I can optimize my application for performance.

Currently the code in chaum_pedersen.cpp is a line-by-line port of the python code. While this improves readability, there are multiple allocations and deallocations happening inline which incur a performance cost. We should instead refactor this code to allocate all of the necessary memory on entry, execute the operations, and then deallocate the intermediate values only at the end.

lmarie79 commented 2 years ago

@AddressXception - can this be deleted given the more recent performance enhancement issues? Or, at least updated to reflect them if not already?