Skip to content

Stateful Refactor#356

Merged
keithrfung merged 2 commits intomainfrom
integration/stateful-refactor
Apr 21, 2021
Merged

Stateful Refactor#356
keithrfung merged 2 commits intomainfrom
integration/stateful-refactor

Conversation

@keithrfung
Copy link
Copy Markdown
Contributor

@keithrfung keithrfung commented Apr 19, 2021

🚨 Please review the guidelines for contributing to this repository.

Issue

Fixes #335
Fixes #354
Fixes #346
Fixes #220
Fixes #340

Description

This is a combination of two major parts of work.
The first part is refactoring the Key Ceremony to not use Guardians at any stage and focus on the ElectionPublicKey
The second part is refactoring the Decryption process to also isolate the guardians at any stage and focus on passing of the shares

MUST BE REBASED AND MERGED

@keithrfung keithrfung marked this pull request as draft April 19, 2021 19:49
This was linked to issues Apr 20, 2021
@keithrfung keithrfung marked this pull request as ready for review April 20, 2021 17:39
@keithrfung keithrfung force-pushed the integration/stateful-refactor branch from e11bf37 to 7597478 Compare April 20, 2021 19:19
self.context,
self.ciphertext_tally,
self.ciphertext_ballots,
# self.ciphertext_tally,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we leaving this commented out for a reason?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. this is a mistake. Good catch.

keithrfung and others added 2 commits April 21, 2021 11:32
* 🐛. Exponent modifier should not be zero

The exponent modifier should never be allowed to be zero to compute a polynomial coordinate.

In the same way a sequence_order should never be zero.

* Refactor Auxiliary Key

* Refactor Elgamal Key

* Refactor ElectionPolynomial

* Refactor Key Ceremony and Election Keys

- Remove GuardianKeyPair for migration to stateful class
- Migration of coefficient commitments and proofs into electionpublickey
- Removal of hash coefficient commitment specialty method 
- Update tests

* Update Publish and tests

* Update Guardian to Stateless

* Functional Key Ceremony Test

* Update Decryption

* ❓Remove optional on store

Optional on store shouldn't exist. This returns a list.

* Refactor Guardian

- Remove references to manually doing recovery key
- Ensure using new naming for election public key
- Correctly handle publish
- Change tests to rely on what can possibly be an outside verifier not necessarily a guardian.

* Refactor Key Ceremony

- Ensure key owner id and sequence order passed into all guardian key generation

* Implement Key Ceremony Helper

Key Ceremony Helper is both an example and a test implementation to perform the key ceremony. The idea is to provide an example and simply long testing sections.

* Updates to Functional Key Ceremony

* Add identity encrypt to ElectionGuard Test

Identity encrypt to the mock library to reduce the recoding of this function

* Update decryption tests

* Update Election Builder

* Update Key Ceremony Mediator

* Add Changes into Election Factory

* Update Decryption Mediator

* Update End to End Election Tests

Update the end to end election to demonstrate the entire election process including the new key ceremony changes.

* Review Adjustments

- Add property descriptions
- Add method descriptions

* Remove sequence order that is created with zero

* Update Ballot Box to use BALLOT_ID

* 🐛 Fix decryption mediator for ballots

* ✅ Add Decryption Tests

- Migrate some tests to decrypt_with_shares
- Add test_decryption tests
- Add Decryption Mediator tests
* ♻️ Add MEDIATOR_ID type

* 🔥 Remove methods forcing multiplicity on ballots

Replace methods for simpler single ballot methods that can then be iterated through. This reduces down the scope and gives individuals more flexibility on collections without the use of DataStore

* ⚠️  Create a Decryption Helper

Create a decryption helper to assist in explaining how to perform the decryption ceremony without the repeated code in various sections

* ♻️ Remove available / missing name 

To reduce the amount of typing here and replace with a singular name instead of adding extra types to exports

* ✅  Update decryption test for a single ballot

* ✨ Update Guardian to perform own shares

Guardian is now in charge of its own shares and uses the functional methods instead of referencing some internal methods. A guardian must perform their own shares and send to mediator

* ✨ Update Decryption Mediator

Major change to decryption mediator. The mediator now only handles the brief exchanges of shares and reconstructs the missing guardian shares. 

Missing guardians now also have to be announced separately. 

Other tests updated to match.
Remove commented lines
@keithrfung keithrfung merged commit 9e48f5a into main Apr 21, 2021
@keithrfung keithrfung deleted the integration/stateful-refactor branch April 21, 2021 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants