Skip to content

Commit

Permalink
Additional votes in the structures
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Jun 26, 2023
1 parent e0c9afb commit 42c3b44
Show file tree
Hide file tree
Showing 4 changed files with 1,943 additions and 67 deletions.
23 changes: 23 additions & 0 deletions evoting/lib/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
// type :map\[string\]string:map<string, string>
// type :network.ServerIdentityID:bytes
// type :ElectionState:uint32
// type :kyber.Point:bytes
// import "onet.proto";
//
// option java_package = "ch.epfl.dedis.lib.proto";
Expand Down Expand Up @@ -123,6 +124,12 @@ type Ballot struct {
// ElGamal ciphertext pair.
Alpha kyber.Point
Beta kyber.Point

// Additional ciphertext pairs in case there are more than 9 candidates.
// As these are slices, the resulting protobuf is backward compatible with
// the old ones.
AdditionalAlphas []kyber.Point
AdditionalBetas []kyber.Point
}

// Mix contains the shuffled ballots.
Expand All @@ -136,6 +143,11 @@ type Mix struct {
NodeID network.ServerIdentityID
// Signature of the public key
Signature []byte

// Additional proofs for eventual additional ciphertexts in the Ballots.
// To keep backward-compatibility in the resulting protobuf,
// these proofs are added at the end of the structure.
AdditionalProofs [][]byte
}

// Partial contains the partially decrypted ballots.
Expand All @@ -147,4 +159,15 @@ type Partial struct {
NodeID network.ServerIdentityID
// Signature of the public key
Signature []byte

// Additional points from decrypted plaintexts.
// To keep backward-compatibility in the resulting protobuf,
// these points are added at the end of the structure.
AdditionalPoints []PartialAdditional
}

// PartialAdditional is used because protobuf cannot handle array of array of bytes.
type PartialAdditional struct {
// All additional points from a single voter.
AdditionalPoints []kyber.Point
}
Loading

0 comments on commit 42c3b44

Please sign in to comment.