Election-Tech-Initiative / Election-Tech-Initiative/electionguard-core2
✨ Discrete Log add support for multiple bases
- Dominant language
- C#
- Stars
- 14
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Suggestion
the discrete log context is a singleton instance that only supports a single cache of values for a given base (G). We should instead refactor this class similar to the precompute tables (and using #216 and #217) to support cache generation for multiple bases.
This is necessary because of the EG 2.0 shift to using base-K for ballot encryption where the base for encryption is fixed to the election public key and not the generator, and therefore only one base can be processed in memory at once.
### Possible Implementation
Add a singleton "Context" similar to the compute tables, and scope the discrete log class to a specific base.
### Anything else?
the current implementation blows out the cache and starts over when a new base is detected, which could lead to performance issues if ballots are being processed through the same instance of the library from multiple elections with different public keys.
Contributor guide
Assessment
This issue has not been assessed yet.