paillier-zkp.git
6 years agoAdd link to slides preview image master
Adrian-Ken Rueegsegger [Tue, 24 Jul 2012 18:02:46 +0000 (20:02 +0200)]
Add link to slides preview image

6 years agoAdd slides section to html doc
Reto Buerki [Tue, 24 Jul 2012 17:07:50 +0000 (19:07 +0200)]
Add slides section to html doc

6 years agoFix functionality list formatting in README
Reto Buerki [Tue, 24 Jul 2012 16:26:51 +0000 (18:26 +0200)]
Fix functionality list formatting in README

6 years agoMakefile: Add target to build html doc
Reto Buerki [Tue, 24 Jul 2012 16:20:13 +0000 (18:20 +0200)]
Makefile: Add target to build html doc

6 years agoDrop unnecessary comment about no available release
Adrian-Ken Rueegsegger [Tue, 24 Jul 2012 16:15:15 +0000 (18:15 +0200)]
Drop unnecessary comment about no available release

6 years agoDoc: Add voter registry to input of module 3
Adrian-Ken Rueegsegger [Sun, 10 Jun 2012 22:48:06 +0000 (00:48 +0200)]
Doc: Add voter registry to input of module 3

6 years agoDoc: rework weighted tallying slide
Adrian-Ken Rueegsegger [Sun, 10 Jun 2012 22:19:10 +0000 (00:19 +0200)]
Doc: rework weighted tallying slide

Add formulas for additive homomorphic properties of Paillier to slide,
which makes weighting and tallying apparent.

6 years agoFix gnatcoll project file location
Reto Buerki [Sun, 10 Jun 2012 20:16:51 +0000 (22:16 +0200)]
Fix gnatcoll project file location

6 years agoRemove completed TODO item
Adrian-Ken Rueegsegger [Sat, 9 Jun 2012 15:39:04 +0000 (17:39 +0200)]
Remove completed TODO item

6 years agoAdd initial version of README file
Adrian-Ken Rueegsegger [Sat, 9 Jun 2012 15:38:49 +0000 (17:38 +0200)]
Add initial version of README file

6 years agoAdd license info to slides
Adrian-Ken Rueegsegger [Sat, 9 Jun 2012 15:06:18 +0000 (17:06 +0200)]
Add license info to slides

6 years agoAdd copyright headers, COPYING and AUTHORS file
Adrian-Ken Rueegsegger [Sat, 9 Jun 2012 15:03:40 +0000 (17:03 +0200)]
Add copyright headers, COPYING and AUTHORS file

6 years agoAdd slides.lyx~ to gitignore
Adrian-Ken Rueegsegger [Sat, 9 Jun 2012 11:45:33 +0000 (13:45 +0200)]
Add slides.lyx~ to gitignore

6 years agoExtend ZKP verification slides
Reto Buerki [Sat, 9 Jun 2012 09:11:40 +0000 (11:11 +0200)]
Extend ZKP verification slides

6 years agoAdd negative test for OS.Read_File function
Reto Buerki [Sat, 9 Jun 2012 09:01:32 +0000 (11:01 +0200)]
Add negative test for OS.Read_File function

This test verifies that an exception is raised if an invalid filename
has been specified.

6 years agoAdd presentation slides
Adrian-Ken Rueegsegger [Fri, 8 Jun 2012 18:50:30 +0000 (20:50 +0200)]
Add presentation slides

6 years agoAdd TODO item
Adrian-Ken Rueegsegger [Sun, 3 Jun 2012 10:00:54 +0000 (12:00 +0200)]
Add TODO item

6 years agoFix comments of instruction operations
Adrian-Ken Rueegsegger [Sun, 3 Jun 2012 09:59:58 +0000 (11:59 +0200)]
Fix comments of instruction operations

6 years agoUpdate example public key
Adrian-Ken Rueegsegger [Fri, 1 Jun 2012 15:05:09 +0000 (17:05 +0200)]
Update example public key

6 years agoUtils: Fix message base output
Reto Buerki [Tue, 29 May 2012 14:28:38 +0000 (16:28 +0200)]
Utils: Fix message base output

6 years agoRemove completed TODO items
Adrian-Ken Rueegsegger [Mon, 28 May 2012 16:10:20 +0000 (18:10 +0200)]
Remove completed TODO items

6 years agoTally: Reject ballots with duplicate voter ids
Adrian-Ken Rueegsegger [Mon, 28 May 2012 16:05:29 +0000 (18:05 +0200)]
Tally: Reject ballots with duplicate voter ids

Only allow one ballot per voter id.

6 years agoTest vote verification for invalid commitment
Adrian-Ken Rueegsegger [Mon, 28 May 2012 15:46:13 +0000 (17:46 +0200)]
Test vote verification for invalid commitment

6 years agoAdd invalid choice vote test
Adrian-Ken Rueegsegger [Mon, 28 May 2012 15:33:34 +0000 (17:33 +0200)]
Add invalid choice vote test

6 years agoActually execute write file test
Adrian-Ken Rueegsegger [Mon, 28 May 2012 15:15:53 +0000 (17:15 +0200)]
Actually execute write file test

6 years agoAdd TODO items
Adrian-Ken Rueegsegger [Fri, 25 May 2012 11:48:01 +0000 (13:48 +0200)]
Add TODO items

6 years agoChange filename of tally output file
Adrian-Ken Rueegsegger [Fri, 25 May 2012 11:21:08 +0000 (11:21 +0000)]
Change filename of tally output file

6 years agoUse 2 ^ 32 as message base
Adrian-Ken Rueegsegger [Fri, 25 May 2012 11:12:46 +0000 (11:12 +0000)]
Use 2 ^ 32 as message base

6 years agoReset hash context when calculating commitment
Adrian-Ken Rueegsegger [Fri, 25 May 2012 11:08:13 +0000 (11:08 +0000)]
Reset hash context when calculating commitment

Use previous hash as input of new hash without any other data.

6 years agoDo cleanup when adding the first ballot to tally
Adrian-Ken Rueegsegger [Thu, 24 May 2012 14:03:50 +0000 (16:03 +0200)]
Do cleanup when adding the first ballot to tally

6 years agoMake Tally_Type a limited controlled type
Adrian-Ken Rueegsegger [Thu, 24 May 2012 14:01:52 +0000 (16:01 +0200)]
Make Tally_Type a limited controlled type

Clear all Mpz_T record fields in Finalize.

6 years agoMakefile: build tools instead of tests by default
Adrian-Ken Rueegsegger [Wed, 23 May 2012 22:57:30 +0000 (00:57 +0200)]
Makefile: build tools instead of tests by default

6 years agoAdd error index to log messages in Verify_Vote
Adrian-Ken Rueegsegger [Wed, 23 May 2012 22:55:59 +0000 (00:55 +0200)]
Add error index to log messages in Verify_Vote

6 years agoExtend tally tool
Adrian-Ken Rueegsegger [Wed, 23 May 2012 22:22:54 +0000 (00:22 +0200)]
Extend tally tool

Ballots are loaded from JSON files and homomorphically added weighted
and tallied. The ballots are skipped if
- the shareholder registry has no entry for the voter
- the election id of the ballot and the tally mismatch
- the vote cannot be verified

The weighted tally is written to a JSON file.

6 years agoExtend vote tool
Adrian-Ken Rueegsegger [Wed, 23 May 2012 22:14:36 +0000 (00:14 +0200)]
Extend vote tool

The vote tool loads voting instructions from a JSON file and casts a
vote for each voter. The votes are stored in ballot files.

6 years agoUse Natural instead of Positive as choice type
Adrian-Ken Rueegsegger [Wed, 23 May 2012 21:59:28 +0000 (23:59 +0200)]
Use Natural instead of Positive as choice type

Zero is a valid choice (abstention).

6 years agoAdd Contains function to registry
Adrian-Ken Rueegsegger [Wed, 23 May 2012 21:57:25 +0000 (23:57 +0200)]
Add Contains function to registry

This funtion returns True if a shareholder entry for the specified name
exists in the given registry.

6 years agoImplement (voting) instruction type
Adrian-Ken Rueegsegger [Wed, 23 May 2012 21:05:12 +0000 (23:05 +0200)]
Implement (voting) instruction type

This type is used to load voting instructions from JSON files and
iterate over the instructions.

6 years agoDrop unneeded Paillier_ZKP test procedure
Reto Buerki [Wed, 23 May 2012 21:21:05 +0000 (23:21 +0200)]
Drop unneeded Paillier_ZKP test procedure

6 years agoAdd debug output to Verify_Vote function
Reto Buerki [Wed, 23 May 2012 21:19:54 +0000 (23:19 +0200)]
Add debug output to Verify_Vote function

6 years agoFactor out candidates to string conversion
Reto Buerki [Wed, 23 May 2012 21:18:37 +0000 (23:18 +0200)]
Factor out candidates to string conversion

6 years agoPrint debug message if cheating is enabled
Reto Buerki [Wed, 23 May 2012 20:55:59 +0000 (22:55 +0200)]
Print debug message if cheating is enabled

6 years agoAdd string conversion function for election data
Reto Buerki [Wed, 23 May 2012 20:40:10 +0000 (22:40 +0200)]
Add string conversion function for election data

6 years agoAdd debug output to Calculate_Ballot procedure
Reto Buerki [Tue, 22 May 2012 21:08:23 +0000 (23:08 +0200)]
Add debug output to Calculate_Ballot procedure

6 years agoUtils: Implement bignum array to string function
Reto Buerki [Tue, 22 May 2012 21:05:10 +0000 (23:05 +0200)]
Utils: Implement bignum array to string function

This function converts a given GMP bignum array to string.

6 years agoMove conversion functions to ZKP.Utils package
Reto Buerki [Tue, 22 May 2012 20:33:46 +0000 (22:33 +0200)]
Move conversion functions to ZKP.Utils package

6 years agoAdd ZKP.Logger package
Reto Buerki [Tue, 22 May 2012 15:39:55 +0000 (17:39 +0200)]
Add ZKP.Logger package

This package provides a Log procedure which can be used to log to
console.

6 years agoAdd initial version of tally tool
Adrian-Ken Rueegsegger [Mon, 21 May 2012 23:47:42 +0000 (01:47 +0200)]
Add initial version of tally tool

This tool calculates the tally for an election loaded from a JSON file.

Votes are loaded from ballot files, weighted with their share count and
homomorphically added to the tally.

Unverifiable votes and voters with no entry in the shareholder registry
are ignored.

6 years agoImplement add ballot operation for tally type
Adrian-Ken Rueegsegger [Mon, 21 May 2012 23:07:32 +0000 (01:07 +0200)]
Implement add ballot operation for tally type

This procedure adds the given ballot to the tally. The vote in the ballot is
weighted with the share count for the corresponding voter id.

Reference values for testing were generated using [1] with the following
settings:
p = 101, q = 43, message base = 64, random seed = 6, default choices for
candidate selections; Ballots of voters V1-3 used for tallying.

[1] - http://security.hsr.ch/msevote/paillier

6 years agoImplement tally to JSON conversion function
Adrian-Ken Rueegsegger [Mon, 21 May 2012 23:06:24 +0000 (01:06 +0200)]
Implement tally to JSON conversion function

This function returns tally as JSON string.

6 years agoAdd Tally type
Adrian-Ken Rueegsegger [Mon, 21 May 2012 23:02:51 +0000 (01:02 +0200)]
Add Tally type

This type is used to count votes/ballots and add their weighted value
to the encrypted tally of the election.

6 years agoMove JSON string constants to ZKP.JSON package
Adrian-Ken Rueegsegger [Sun, 20 May 2012 23:39:09 +0000 (01:39 +0200)]
Move JSON string constants to ZKP.JSON package

6 years agoAdd cheating functionality to Cast_Vote function
Reto Buerki [Mon, 21 May 2012 18:21:50 +0000 (20:21 +0200)]
Add cheating functionality to Cast_Vote function

If the cheat flag is True, the function creates an invalid ballot by
voting two times for the selected choice.

6 years agoImprove Create_Messages_Mk function
Reto Buerki [Sun, 20 May 2012 23:48:54 +0000 (01:48 +0200)]
Improve Create_Messages_Mk function

Change the type of the Base argument from Positive to Mpz_T. This is
needed to support large message base values.

6 years agoMake ballot type non-limited
Adrian-Ken Rueegsegger [Thu, 17 May 2012 14:39:15 +0000 (14:39 +0000)]
Make ballot type non-limited

6 years agoFix to bignum conversion test on i386
Reto Buerki [Thu, 10 May 2012 07:57:19 +0000 (09:57 +0200)]
Fix to bignum conversion test on i386

6 years agoAdd hex string to bignum conversion test
Reto Buerki [Tue, 8 May 2012 16:57:44 +0000 (18:57 +0200)]
Add hex string to bignum conversion test

6 years agoAdd Novartis Shareholder registry JSON file
Adrian-Ken Rueegsegger [Tue, 8 May 2012 15:26:32 +0000 (17:26 +0200)]
Add Novartis Shareholder registry JSON file

The shareholder data will be used for weighted tallying for the
exemplary electronic vote as specified by [1].

The registry data is taken from slide 19 of [1].

[1] - http://security.hsr.ch/msevote/fs12/Kickoff.pdf

6 years agoImplement Verify_Vote function
Adrian-Ken Rueegsegger [Tue, 8 May 2012 15:17:17 +0000 (17:17 +0200)]
Implement Verify_Vote function

This function returns True if the given ballot represents a correct vote
in the context of the specified election.

6 years agoAdd test for ballot to JSON conversion
Adrian-Ken Rueegsegger [Tue, 8 May 2012 11:42:04 +0000 (13:42 +0200)]
Add test for ballot to JSON conversion

6 years agoTest loading of ballot from JSON file
Adrian-Ken Rueegsegger [Sat, 5 May 2012 14:28:34 +0000 (16:28 +0200)]
Test loading of ballot from JSON file

6 years agoAdd Getters to ballot type
Adrian-Ken Rueegsegger [Sat, 5 May 2012 14:28:04 +0000 (16:28 +0200)]
Add Getters to ballot type

6 years agoStore data as hex strings in ballot
Adrian-Ken Rueegsegger [Sat, 5 May 2012 14:03:57 +0000 (16:03 +0200)]
Store data as hex strings in ballot

Similar to the election store the data as hex string instead of mpz_t
types/arrays. In turn the ballot type does not need to be limited
controlled.

6 years agoImplement Load_File function for ballot type
Adrian-Ken Rueegsegger [Thu, 26 Apr 2012 15:03:55 +0000 (17:03 +0200)]
Implement Load_File function for ballot type

This function loads JSON data from the specified file and returns a
corresponding ballot instance.

6 years agoImplement n-th powers verification
Reto Buerki [Thu, 26 Apr 2012 20:59:49 +0000 (22:59 +0200)]
Implement n-th powers verification

The Verify_Nth_Powers function checks the following equation:

zk^n = ak * uk^ek mod n^2

The result of the verification is returned in the Success parameter. The
Err_Idx parameter points to the (first) incorrect z value if the n-th
powers could not be verified; Err_Idx is set to -1 on success.

6 years agoFix random e, z value initialization
Reto Buerki [Thu, 26 Apr 2012 16:24:06 +0000 (18:24 +0200)]
Fix random e, z value initialization

6 years agoAdd TODO item
Adrian-Ken Rueegsegger [Thu, 26 Apr 2012 11:09:10 +0000 (13:09 +0200)]
Add TODO item

6 years agopaillier_zkp: Use generator provided by election
Reto Buerki [Wed, 25 Apr 2012 20:56:05 +0000 (22:56 +0200)]
paillier_zkp: Use generator provided by election

6 years agoImplement Verify_Response_Ek function
Reto Buerki [Wed, 25 Apr 2012 20:47:52 +0000 (22:47 +0200)]
Implement Verify_Response_Ek function

This function verifies if the given challenge equals the sum of the
values in the specified ek array:

sum (ek) = challenge mod 2^b

6 years agoAdd TODO file
Reto Buerki [Wed, 25 Apr 2012 20:05:22 +0000 (22:05 +0200)]
Add TODO file

6 years agoAdd function to create GMP bignum from hex string
Reto Buerki [Wed, 25 Apr 2012 20:02:44 +0000 (22:02 +0200)]
Add function to create GMP bignum from hex string

6 years agoRemove completed TODO comment
Reto Buerki [Wed, 25 Apr 2012 19:39:04 +0000 (21:39 +0200)]
Remove completed TODO comment

6 years agoUse election exponent to calculate message base
Adrian-Ken Rueegsegger [Wed, 25 Apr 2012 12:16:44 +0000 (14:16 +0200)]
Use election exponent to calculate message base

6 years agoRename message exponent to base exponent
Adrian-Ken Rueegsegger [Wed, 25 Apr 2012 12:08:27 +0000 (14:08 +0200)]
Rename message exponent to base exponent

The maximum of votes that can be cast per choice is specified by the
base exponent as follows:

Max vote count := (2^base_exponent) - 1

6 years agoRename election candidate count to choices
Adrian-Ken Rueegsegger [Wed, 25 Apr 2012 11:59:36 +0000 (13:59 +0200)]
Rename election candidate count to choices

6 years agoRename A/E/Zks to A/E/Zk
Adrian-Ken Rueegsegger [Wed, 25 Apr 2012 11:58:05 +0000 (13:58 +0200)]
Rename A/E/Zks to A/E/Zk

6 years agoAdd initial version of vote tool
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 20:03:10 +0000 (22:03 +0200)]
Add initial version of vote tool

This tool can be used to cast a vote for a specific election.

Currently the election and the choice are hardcoded.

6 years agoAdd ballot type
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 20:03:04 +0000 (22:03 +0200)]
Add ballot type

A ballot contains all information related to a cast vote.

Beware, the current initial implementation most probably does not work
as intended.

6 years agoRename election ID fieldname
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 19:07:24 +0000 (21:07 +0200)]
Rename election ID fieldname

Avoid confusion with the upcoming voter id fieldname constant.

6 years agoLet candidate array start at index 0
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 19:05:13 +0000 (21:05 +0200)]
Let candidate array start at index 0

Use the same range as the Mpz_T_Array type.

6 years agoDrop election equal function
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 16:38:00 +0000 (18:38 +0200)]
Drop election equal function

The standard "=" operator can now be used instead.

6 years agoMake election non-limited type
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 16:34:35 +0000 (16:34 +0000)]
Make election non-limited type

The election type does not need to be a limited controlled type since it
does not contain any record fields of type mpz_t anymore.

6 years agoConvert message exponent to positive
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 16:33:28 +0000 (16:33 +0000)]
Convert message exponent to positive

6 years agoAdd generator G to election type
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 16:28:44 +0000 (18:28 +0200)]
Add generator G to election type

6 years agoElection: Store N as hex string instead of mpz_t
Adrian-Ken Rueegsegger [Tue, 24 Apr 2012 16:17:04 +0000 (18:17 +0200)]
Election: Store N as hex string instead of mpz_t

6 years agopaillier_zkp: Implement ZKP prover side
Reto Buerki [Mon, 23 Apr 2012 16:09:37 +0000 (18:09 +0200)]
paillier_zkp: Implement ZKP prover side

The paillier_zkp tool now calculates ZKP values for an example vote and
prints them to the console.

6 years agoMinor: Fix indentation
Reto Buerki [Sun, 22 Apr 2012 22:12:23 +0000 (00:12 +0200)]
Minor: Fix indentation

6 years agoAdd To_Hex_String function
Reto Buerki [Sun, 22 Apr 2012 22:08:16 +0000 (00:08 +0200)]
Add To_Hex_String function

This function returns the hexadecimal representation of a given GMP
bignum.

6 years agoImplement Compute_Response_Zk function
Reto Buerki [Sun, 22 Apr 2012 21:56:50 +0000 (23:56 +0200)]
Implement Compute_Response_Zk function

This function computes the response array zk for a given Choice using
the specified modulus n, masking random r, array of random numbers z and
the ek array calculated using the Compute_Response_Ek function.

6 years agoMinor: Cleanups in Paillier tests
Reto Buerki [Sun, 22 Apr 2012 21:51:10 +0000 (23:51 +0200)]
Minor: Cleanups in Paillier tests

6 years agoImplement Compute_Response_Ek function
Reto Buerki [Sun, 22 Apr 2012 17:33:42 +0000 (19:33 +0200)]
Implement Compute_Response_Ek function

This function computes the response array ek for the given Choice using
the specified Challenge, bit Size and random numbers e.

6 years agoPaillier: Fix formula comments (= vs :=)
Reto Buerki [Sun, 22 Apr 2012 17:29:37 +0000 (19:29 +0200)]
Paillier: Fix formula comments (= vs :=)

6 years agoRename challenge test procedures
Reto Buerki [Sun, 22 Apr 2012 16:34:40 +0000 (18:34 +0200)]
Rename challenge test procedures

6 years agoAdjust Paillier test names
Reto Buerki [Thu, 19 Apr 2012 07:56:52 +0000 (09:56 +0200)]
Adjust Paillier test names

6 years agoRename Calculate_Uk function to Compute_Uk
Reto Buerki [Thu, 19 Apr 2012 07:53:14 +0000 (09:53 +0200)]
Rename Calculate_Uk function to Compute_Uk

6 years agoRename Calculate_Commitment_Ak to Compute_Commitment_Ak
Reto Buerki [Thu, 19 Apr 2012 07:50:32 +0000 (09:50 +0200)]
Rename Calculate_Commitment_Ak to Compute_Commitment_Ak

6 years agoMinor style fixes
Reto Buerki [Thu, 19 Apr 2012 07:30:41 +0000 (09:30 +0200)]
Minor style fixes

6 years agoImplemente loading of registry from JSON file
Adrian-Ken Rueegsegger [Wed, 18 Apr 2012 22:16:00 +0000 (00:16 +0200)]
Implemente loading of registry from JSON file

6 years agoAdd shareholder registry package
Adrian-Ken Rueegsegger [Wed, 18 Apr 2012 21:50:19 +0000 (23:50 +0200)]
Add shareholder registry package

The registry stores information about shareholders and their share
count. This information is needed for weighted tallying.

6 years agoFix mpz_t memory leaks
Reto Buerki [Wed, 18 Apr 2012 21:01:04 +0000 (23:01 +0200)]
Fix mpz_t memory leaks

Looks good now:

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 0 bytes in 0 blocks