* Use BCrypt for get byte on windows
* Revert "Use BCrypt for get byte on windows"
This reverts commit e664b927f2.
* Revert changes to method signature, move assert. remove mod operation
* Fixing a potential BO that could happen if the ID assigned by the trustee would exceed the limit in the ballot files.
Adding a test for the fix.
* Fixing a potential BO that could happen if the ID assigned by the trustee would exceed the limit in the ballot files and adding a test for the fix.
* Adding the parameter for ballot_samples to Makefile
* Update exploit
Update exploit
* test update ubuntu workflow runner & cmake version
* pin release runner version to 18.04
Co-authored-by: Matt Wilhelm <github@addressxception.com>
* 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
* 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
* 55655 - Unsafe usage of string related APIs
55655 - Usage of unsafe string related APIs could lead to potential buffer overflow.
For Windows & C11 compilers, we switched to the usage of *_s version of the APIs as recommended.
For other compilers, additional checks to prevent buffer overflow have been added.
* 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
* 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
* 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
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
* 🚀 Create Release Workflow
This github action makes use of original build tasks to create each of the artifacts and zips them up for easy consumption by the c# package
* 🔥 Delete unnecessary make install
Make install was failing and not completing. It is already installed on the system due to cmake. Removed the call for cleaner build logs.
* 🏗 Expose File Methods
Expose File methods to be used on external libraries. C File methods need to be exposed. The simple example file methods were used for simplicity.
* 🏗 Add Seek File Method
Simple election tests is now run successfully on Windows and Mac builds
- Windows had issue with gmp location. This was resolved by adding them to the path
- Mac has a similar issue with gmp due to Mojave but is more convoluted. The direct library path had to be added.
Implement threshold decryption
Threshold decryption proofs generate and check
Changed to 256 bit subgroup used in the spec
Addressed decryption DoS
Removed asserts from proof checks
Co-Authored-By: Dragan Stosic <dragan.stosic@gmail.com>
- Update submodule to latest commit
- Link gmp to ensure that builds have access to gmp.h
- uint4096.c: `a` reference gives error. Substituted with `out` similar to other code sections.