Граф коммитов

9 Коммитов

Автор SHA1 Сообщение Дата
Matt Wilhelm 3115c412ec
Remove assert statements from bignum (#78)
* Remove assert statements from bignum

improve logging around bignum computation

* remove assert.h update max ballot payload

* reset max ballot payload to 2000

* Explicitly break loop on import end of file

add log.h to coordinator

* modify test selections
2020-02-03 14:52:23 -05:00
Matt Wilhelm d9dd0a1037 Support external_ballot_identifer as a string (#71)
* Support external_ballot_identifer as a string.  Export/import ballots from encrypter

Add support for encrypter to export ballots to the file system.  Import encrypter ballots into coordinator.  Add a hashtable implementation that tracks ballot cast/spoil state against the external identifier (ballot_collection.c).  Support loading ballots into a buffer.  

Fix memory leaks in bignum.c, crypto.c, decryption/coordinator.c, decryption/trustee.c, voting/coordinator.c, voting/encrypter.c, etc.

Rework the API example to demonstrate the new external id and file system changes.

Improve debug logging.  Add more api documentation.  Modify MAX_BALLOT_PAYLOAD to 2000.  Explicitly add // TODO: to track remaining work.

Note this commit is a work in progress and currently breaks the simple example.

* Remove Simple Example, add api doc stubs

Add stubs for the api documentation.  Remove the simple example and use the api sample in the PR pipeline workflow

* Fix Merge Issue

* Verify malloc success

* Address PR Feedback

* Fix LGTM alerts

* Add soft delete of encrypter files

* Free CP Proof

* Fix windows Makefile

* test fix pr workflow on windows

* use secure api's

* explicitly compile release

* flush file write before read

* clean up makefile

* Document consumers resonsible for free

when calling an api that generates a filename as an out parameter, the caller is responsible for managing the memory of the out parameter when the call is successful

* Rename static coordinators in API to differentiate local vars

add an underscore prefix to static coordinator instance handles to differentiate vars until #62 is complete

* add new enum cases to the end on voting coordinator

* Add convenience logging

* Handle error cases on file access

use convenience logging

* use consistent file formatting when rebuilding tracker string

* optimize null check

* explicitly set tracker array positions to NULL on failure

* Reformat refactor Decryption_Coordinator_receive_share

* guard tallies_initialized when freeing resources

explicitly initialize num_tallies

* rename _encrypted_ballot_count

* don't return early

* do not fail soft delete if rename fails

* fix assignment

* adjust number of ballots to force a rebuild
2020-01-28 09:44:07 -05:00
Matt Wilhelm 2288e878f9 Fix/tally votes trustee threshold (#61)
* Rename refactor decryption_trustee

add summary comments.  Consistently format files.

* Add Trustee index to decryption trustee

* ignore files in ballots results folder

* handle announce trutees less than max trustees

* use the threshold trustees in test to decrypt with missing trustees

only tally votes using the threshold number of trustees to validate that threshold decryption works as expected

* add test_ballot.  Use assert for some test conditions

check expected and actual tally results.

* fix extraneous arguments in call
2020-01-06 15:44:24 -05:00
Matt Wilhelm fb0fead26c Fix/configurable storage paths (#55)
* when writing files, create directories if they do not exist

* revert botched merge file

* modify tasks to include debug shared lib builds

* use FILENAME_MAX from stdio instead of PATH_MAX from linux/limits

* include header guard

* Fix windows support for mkdir
2019-12-05 13:10:00 -05:00
Pamela Vong a2a707ee7a Implement return of tally results as uint array 2019-12-03 16:27:10 -05:00
Pamela Vong a8118f7ce9 Fix for encrypting ballot boolean arrays with multiple true selections (#49)
* Fix for encrypting ballot boolean arrays with multiple true selections; Repurpose Validate_selections; Update/simplify api test example with random selections

* Also remove extra Validate_selections call from simple example since its called anyway

* fix random ballots in example tests to be more random and valid ballots

* Have expected_num_selected passed in from higher level for encrypting ballot
2019-12-03 16:03:09 -05:00
Matt Wilhelm 77037e2fc1 Add .vscode tasks (#47)
* Add .vscode tasks
2019-12-03 15:48:57 -05:00
Pamela Vong 3743de8bed Implement returning arrays of strings for the ballots that have been casted or spoiled 2019-12-03 14:04:51 -05:00
Pamela Vong ceb3e10895 Implement API in the C library (#44)
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.

* Fix loop in computeTrusteePolynomial that results in segfault

* Implement API to Create Election from the C library and update simple example test

* Added missing include

* Add method to free bytes allocated for trustee states and joint public key

* Revert original simple example, create new simple example using api

* Intial implementation to encrypt ballot from C API; added new api to example

* Refactor create-election api in C to write joint key to config param; updated api example

* Update EncryptBallot API signature to work with PInvoke; updated api example

* Add API Tests to the test workflow

* Fix for EncryptBallot passing in array of selections because booleans are non-blittable from C# and the array is not a fixed size

* Implement RecordBallots and TallyVotes API in C library (Merge into PR #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
2019-12-02 16:56:39 -05:00