Skip to content

Additional votes in the structures#2506

Open
ineiti wants to merge 5 commits intomainfrom
evoting-many-candidates
Open

Additional votes in the structures#2506
ineiti wants to merge 5 commits intomainfrom
evoting-many-candidates

Conversation

@ineiti
Copy link
Copy Markdown
Member

@ineiti ineiti commented Jun 26, 2023

What this PR does

For a new election at EPFL there will be more than 8 candidates. This is a problem, as currently all
choices are stored as data in an ed25519 Point. But as this Point only takes 24 bits of data,
we cannot store easily more than 9 choices.

To allow for more than 9 candidates, each Ballot, Mix, and Partial will have Additional* fields
to hold the additional choices.
As these fields are slices, and added to the end of the structures, and thus to the end of the protobuf definition,
it should be backward-compatible.
To make sure we don't add security problems, we also do:

  • fill up as many Additional fields in the Ballot as are maximally possible, to avoid leaking for how many candidates a person voted
  • use shuffle/sequences.go if there are more than 9 candidates
  • test if it works with one node down in shuffling / decryption
  • integration tests
    • create a set of nodes for testing the frontend
    • start with old version, set up an election, switch to new version, make sure it all works out

🙅‍ Friendly checklist:

  • 0. Code comments are added (or updated) when/where needed and explain the WHY of the code.
  • 1. Design choices, user documentation and any additional doc are added (or updated) in READMEs.
  • 2. Any new behaviour is tested and small units of code that can be are unit tested.
  • 3. Code comments are added on tests to explain what they do.
  • 4. Errors are systematically wrapped with a meaningful message using xerrors.Errorf and the %v verb.
  • 5. Hard limit of 80 chars is always respected.
  • 6. Changes are backward compatible.
  • 7. Indentation level does not exceed 5, although 4 is already suspicious.
  • 8. Functions, files, and packages are kept to a manageable size and decomposed into smaller units if needed.
  • 9. There are no magic values.

@ineiti ineiti force-pushed the evoting-many-candidates branch 3 times, most recently from c001d3c to 805682a Compare June 26, 2023 08:26
Added some security bugs found while adding the new functionalities.
They are here: #2507 #2508 #2509 #2510

Also added some comments and fixed some typos.
@ineiti ineiti force-pushed the evoting-many-candidates branch 5 times, most recently from faf72ba to 83a26f4 Compare June 28, 2023 08:57
ineiti added 3 commits June 28, 2023 11:08
Added 'Additional*' fields in a backward-compatible way.
Also split the evoting/struct.go to a evoting/proto.go for updating the messages in
the evoting frontend.
Put more methods in evoting/lib/container.go
Prepared usage of multiple points per vote
Showing all elections
Allow voting if the private key is known
@ineiti ineiti force-pushed the evoting-many-candidates branch from 83a26f4 to 1d37c7e Compare June 28, 2023 09:08
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
0.9% 0.9% Duplication

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants