Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Implement API in the C library #44

Merged
merged 12 commits into from
Dec 2, 2019
Merged

Conversation

pamtaro
Copy link
Contributor

@pamtaro pamtaro commented Nov 22, 2019

Checklist

🚨Please review the guidelines for contributing to this repository.

  • 🤔 CONSIDER adding a unit test if your PR resolves an issue.
  • DO check open PR's to avoid duplicates.
  • DO keep pull requests small so they can be easily reviewed.
  • DO build locally before pushing.
  • DO make sure tests pass.
  • DO make sure any new changes are documented.
  • DO make sure not to introduce any compiler warnings.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

Description

This introduces an api layer to the C library which can be used to execute the entire election via single api methods to create election/key ceremony, encrypt ballot, register ballot, record cast/spoil ballot, and tally votes. It is based on the simple election's examples, but with adjustments to the flow to more approriately fit real eleciton scenarios and with signatures adjusted to allow for Interop marshalling via PInvoke from the C# wrapper sdk side. This also adds the api version to the examples folder as an alternative executable that can demonstrate an end-to-end election.

NOTE: This contains and should be merged after PR #42

closes #33
closes #34
closes #35
closes #36

Copy link
Contributor

@AddressXception AddressXception left a comment

Choose a reason for hiding this comment

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

Looks good. Since we adjusted the create election workflow to use the new classes here, should we either:

  1. remove the examples/simple/main_keyceremony.h and corresponding implementation, or
  2. modify examples/simple/main.c to include both initialization workflows (so it's clear the simple election tests can be executed using both setup methods)?

@pamtaro
Copy link
Contributor Author

pamtaro commented Nov 24, 2019

Looks good. Since we adjusted the create election workflow to use the new classes here, should we either:

  1. remove the examples/simple/main_keyceremony.h and corresponding implementation, or
  2. modify examples/simple/main.c to include both initialization workflows (so it's clear the simple election tests can be executed using both setup methods)?

I think I prefer to keep both examples around.. maybe I should create an api_simple example and use the API approach in that instead of trying to reuse the existing simple example 🤔

@pamtaro pamtaro changed the title Implement API to Create Election from the C library ⚠ (WIP) Implement API in the C library Nov 26, 2019
… are non-blittable from C# and the array is not a fixed size
AddressXception
AddressXception previously approved these changes Dec 2, 2019
…#44) (#46)

* Implement RecordBallots API in C library

* Fix C example api tests for selection array; Refactor RecordBallot API to return the created file name

* Implement TallyVotes API and example test in C library

* Convert to using byte array for input instead of unsigned short array
@pamtaro pamtaro changed the title ⚠ (WIP) Implement API in the C library Implement API in the C library Dec 2, 2019
@echumley-msft echumley-msft merged commit ceb3e10 into master Dec 2, 2019
@keithrfung keithrfung deleted the feature/api-create-election branch February 4, 2020 20:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants