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

Fix/ctor perf #257

Closed SteveMaier-IRT closed 2 years ago

SteveMaier-IRT commented 2 years ago

Issue

Link your PR to an issue

Fixes #252

Description

Fixed the ballot encrypt time based on what election context was used. There was a setting in the context that was not being used when a JSON/BSON file was serialized.

In the process also fixed the benchmarking system to work on Windows instead of only working on Linux and Mac.

Testing

There were benchmarks created to time the encrpytballot and encryptcontests methods that showed the issue with the timing.

To manual test it, create a test to encrypt a ballot and create 2 CithertextElectionContext, one using the standard paramter constructor and one using a JSON/BSON file. The encrypting of the ballot will take 2.5 times longer using the election context created from JSON. With this change there will be no timing issue.

keithrfung commented 2 years ago

Probably want to fix those builds though.

SteveMaier-IRT commented 2 years ago

Probably want to fix those builds though.

Fixed the issue. Thanks