diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 890dbd0775..9112b371b3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,7 +11,7 @@ env: jobs: go: name: Upload release binaries - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout code uses: actions/checkout@main diff --git a/evoting/README.md b/evoting/README.md index a618e63225..f6b8a8c882 100644 --- a/evoting/README.md +++ b/evoting/README.md @@ -140,3 +140,36 @@ See the [README.md](evoting-admin/README.md) in that directory. - Paper: **Helios: Web-based Open-Audit Voting**; *Ben Adida*, 2008 - Paper: **Decentralizing authorities into scalable strongest-link cothorities**: *Ford et. al.*, 2015 - Paper: **Secure distributed key generation for discrete-log based cryptosystems**; *Gennaro et. al.*, 1999 + +# Extension to more than 9 candidates + +## Description + +The pre-June 2023 version (v3.4.9) of the evoting backend only allowed for up to 9 choices of candidates. +This is due to the fact that the encryption is done with data in an ed25519 point, which can store up to +30 bytes. +Each candidate takes 3 bytes, so there would be 10 candidates possible, but probably due to a off-by-one error +decision, it was deemed better to only allow for 9 candidates. + +With the current change, a number of `Additional*` fields are added to the structures that hold the encrypted +and decrypted votes. +This has been done as a golang-slice, which is represented as a `repeated` in protobuf. +The advantage is that if it is missing, it will simply result in a 0-length slice. +So all the previous data should be fully compatible with the new system. + +The shuffling / mixing is now done with the `kyber/shuffle/sequences.go`, which has one big disadvantage: +**There is no verification of the shuffle being correct**! + +Anyway, due to many other security bugs, I think this is the least of concerns for now... + +## Bugs encountered + +The following bugs are security bugs. +If the D-voting implementation is a rewrite of this evoting +service, then you should definitely check that now it's done +correctly! + +- `hashMap` doesn't hash all it should: https://github.com/dedis/cothority/issues/2508 +- The authentication of the user is very bogus: https://github.com/dedis/cothority/issues/2507 +- `shuffle` and `decrypt` requests sent by the leader are not trustworthy: https://github.com/dedis/cothority/issues/2509 +- Blocks created by `shuffle` and `decrypt` are signed with a useless signature https://github.com/dedis/cothority/issues/2510 diff --git a/evoting/api.go b/evoting/api.go index 1bc6c1ae3c..52929e24b3 100644 --- a/evoting/api.go +++ b/evoting/api.go @@ -3,6 +3,7 @@ package evoting import ( + "go.dedis.ch/cothority/v3/skipchain" "go.dedis.ch/onet/v3" "go.dedis.ch/cothority/v3" @@ -16,16 +17,17 @@ type Client struct { *onet.Client // If LookupURL is set, use it for SCIPER lookups (for tests). LookupURL string + Roster *onet.Roster } // NewClient instantiates a new evoting.Client. -func NewClient() *Client { - return &Client{Client: onet.NewClient(cothority.Suite, ServiceName)} +func NewClient(roster *onet.Roster) *Client { + return &Client{Client: onet.NewClient(cothority.Suite, ServiceName), Roster: roster} } // Ping a random server which increments the nonce. -func (c *Client) Ping(roster *onet.Roster, nonce uint32) (*Ping, error) { - dest := roster.RandomServerIdentity() +func (c *Client) Ping(nonce uint32) (*Ping, error) { + dest := c.Roster.RandomServerIdentity() reply := &Ping{} if err := c.SendProtobuf(dest, &Ping{Nonce: nonce}, reply); err != nil { return nil, err @@ -34,8 +36,17 @@ func (c *Client) Ping(roster *onet.Roster, nonce uint32) (*Ping, error) { } // LookupSciper returns information about a sciper number. -func (c *Client) LookupSciper(roster *onet.Roster, sciper string) (reply *LookupSciperReply, err error) { +func (c *Client) LookupSciper(sciper string) (reply *LookupSciperReply, err error) { reply = &LookupSciperReply{} - err = c.SendProtobuf(roster.RandomServerIdentity(), &LookupSciper{Sciper: sciper, LookupURL: c.LookupURL}, reply) + err = c.SendProtobuf(c.Roster.RandomServerIdentity(), &LookupSciper{Sciper: sciper, LookupURL: c.LookupURL}, reply) + return +} + +// Reconstruct returns the reconstructed votes. +// If the election is not yet finished, it will return an error +func (c *Client) Reconstruct(id skipchain.SkipBlockID) (rr ReconstructReply, err error) { + err = c.SendProtobuf(c.Roster.List[0], &Reconstruct{ + ID: id, + }, &rr) return } diff --git a/evoting/api_test.go b/evoting/api_test.go index 14ae50facd..17b9095650 100644 --- a/evoting/api_test.go +++ b/evoting/api_test.go @@ -23,7 +23,7 @@ func TestPing(t *testing.T) { _, roster, _ := local.GenTree(3, true) - c := evoting.NewClient() - r, _ := c.Ping(roster, 0) + c := evoting.NewClient(roster) + r, _ := c.Ping(0) assert.Equal(t, uint32(1), r.Nonce) } diff --git a/evoting/evoting-admin/app.go b/evoting/evoting-admin/app.go index 48877c50e5..b9424da0ee 100644 --- a/evoting/evoting-admin/app.go +++ b/evoting/evoting-admin/app.go @@ -7,6 +7,7 @@ import ( "encoding/json" "flag" "fmt" + "go.dedis.ch/cothority/v3/evoting/lib" "os" "strconv" "strings" @@ -23,23 +24,30 @@ import ( ) var ( - argRoster = flag.String("roster", "", "path to roster toml file") - argAdmins = flag.String("admins", "", "list of admin users") - argPin = flag.String("pin", "", "service pin") - argKey = flag.String("key", "", "public key of authentication server") - argID = flag.String("id", "", "ID of the master chain to modify (optional)") - argUser = flag.Int("user", 0, "The SCIPER of an existing admin of this chain") - argSig = flag.String("sig", "", "A signature proving that you can login to Tequila with the given SCIPER.") - argShow = flag.Bool("show", false, "Show the current Master config") - argDumpVoters = flag.Bool("dumpvoters", false, "Dump a list of voters for election skipchain specified with -id (ballot de-duplication has already been taken into account, order is preserved)") - argDumpElection = flag.Bool("dumpelection", false, "Dump the current election config for the election specified with -id.") - argJSON = flag.Bool("json", false, "Dump in json mode.") - argLoad = flag.String("load", "", "Load the specified json file to modify the election specified with -id.") + argRoster = flag.String("roster", "", "path to roster toml file") + argAdmins = flag.String("admins", "", "list of admin users") + argPin = flag.String("pin", "", "service pin") + argKey = flag.String("key", "", "public key of authentication server") + argPrivate = flag.String("private", "", "private key of authentication server for voting") + argID = flag.String("id", "", "ID of the master chain to modify (optional)") + argUser = flag.Int("user", 0, "The SCIPER of an existing admin of this chain") + argSig = flag.String("sig", "", "A signature proving that you can login to Tequila with the given SCIPER.") + argShow = flag.Bool("show", false, "Show the current Master config") + argDumpVoters = flag.Bool("dumpvoters", false, "Dump a list of voters for election skipchain specified with -id (ballot de-duplication has already been taken into account, order is preserved)") + argDumpElection = flag.Bool("dumpelection", false, "Dump the current election config for the election specified with -id.") + argJSON = flag.Bool("json", false, "Dump in json mode.") + argLoad = flag.String("load", "", "Load the specified json file to modify the election specified with -id.") + argVoteCandidates = flag.String("voteCandidates", "", "Coma delimited list of SCIPERs to vote for") + argDebug = flag.Int("debug", 0, "Debugging level") ) func main() { flag.Parse() + if *argDebug > 0 { + log.SetDebugVisible(*argDebug) + } + if *argRoster == "" { log.Fatal("Roster argument (-roster) is required for create, update, or show.") } @@ -47,15 +55,50 @@ func main() { if err != nil { log.Fatal("cannot parse roster: ", err) } + client := onet.NewClient(cothority.Suite, evoting.ServiceName) + cl := evoting.NewClient(roster) + + var pub kyber.Point + var priv kyber.Scalar + if *argPrivate != "" { + // If we get the private key, calculate the corresponding public key + b, err := hex.DecodeString(*argPrivate) + log.ErrFatal(err, "while parsing private key") + + log.Lvl1("Setting the private key") + priv = cothority.Suite.Scalar() + err = priv.UnmarshalBinary(b) + log.ErrFatal(err, "while unmarshalling private key") + pub = cothority.Suite.Point().Mul(priv, nil) + } else if *argKey != "" { + // If we only get the public key + pub, err = parseKey(*argKey) + if err != nil { + log.Fatal("cannot parse key: ", err) + } + } else { + // If we get no key, create them again + kp := key.NewKeyPair(cothority.Suite) + priv = kp.Private + pub = kp.Public + } if *argShow { + if *argID == "" { + log.Fatal("Please give ID of master chain") + } id, err := hex.DecodeString(*argID) if err != nil { log.Fatal("id decode", err) } request := &evoting.GetElections{Master: id} + if priv != nil && *argUser > 0 { + request.User = uint32(*argUser) + request.Signature = lib.GenerateSignature(priv, id, request.User) + } else { + fmt.Println("You can give '-private PRIVATE_KEY -user ADMINID' for a list of available elections to this user") + } reply := &evoting.GetElectionsReply{} - client := onet.NewClient(cothority.Suite, evoting.ServiceName) if err = client.SendProtobuf(roster.List[0], request, reply); err != nil { log.Fatal("get elections request: ", err) } @@ -63,16 +106,22 @@ func main() { fmt.Printf(" Admins: %v\n", m.Admins) fmt.Printf(" Roster: %v\n", m.Roster.List) fmt.Printf(" Key: %v\n", m.Key) + for _, election := range reply.Elections { + fmt.Printf("\nElection: %s\n", election.Name) + fmt.Printf(" ID: %x\n", election.ID) + } return } if *argDumpVoters { + if *argID == "" { + log.Fatal("Please give ID of master chain") + } id, err := hex.DecodeString(*argID) if err != nil { log.Fatal("id decode", err) } reply := &evoting.GetBoxReply{} - client := onet.NewClient(cothority.Suite, evoting.ServiceName) if err = client.SendProtobuf(roster.List[0], &evoting.GetBox{ID: id}, reply); err != nil { log.Fatal("get box request: ", err) } @@ -84,12 +133,14 @@ func main() { } if *argDumpElection { + if *argID == "" { + log.Fatal("Please give an ID") + } id, err := hex.DecodeString(*argID) if err != nil { log.Fatal("id decode", err) } reply := &evoting.GetBoxReply{} - client := onet.NewClient(cothority.Suite, evoting.ServiceName) if err = client.SendProtobuf(roster.List[0], &evoting.GetBox{ID: id}, reply); err != nil { log.Fatal("get box request: ", err) } @@ -123,11 +174,27 @@ func main() { out.WriteTo(os.Stdout) } else { fmt.Println(reply.Election) + if reply.Election.Stage == lib.Decrypted { + reconstructReply, err := cl.Reconstruct(id) + log.ErrFatal(err, "While getting reconstructed votes") + for i, p := range reconstructReply.Points { + d, _ := p.Data() + fmt.Printf("Vote %d with data %x", i, d) + for _, p := range reconstructReply.AdditionalPoints[i].AdditionalPoints { + d, _ := p.Data() + fmt.Printf(",%x", d) + } + fmt.Println() + } + } } return } if *argLoad != "" { + if *argID == "" { + log.Fatal("Please give ID of master chain") + } id, err := hex.DecodeString(*argID) if err != nil { log.Fatal("id decode", err) @@ -135,7 +202,6 @@ func main() { // Look up the election reply := &evoting.GetBoxReply{} - client := onet.NewClient(cothority.Suite, evoting.ServiceName) if err = client.SendProtobuf(roster.List[0], &evoting.GetBox{ID: id}, reply); err != nil { log.Fatal("get box request:", err) } @@ -194,6 +260,50 @@ func main() { return } + if len(*argVoteCandidates) > 0 { + voteUser := uint32(*argUser) + if len(*argID) != 64 { + log.Fatal("Need an ID of the election chain in hex form of 32 bytes") + } + voteID, err := hex.DecodeString(*argID) + log.ErrFatal(err, "Wrong ID for election chain") + + log.Lvl1("Getting election information from the chain") + reply := &evoting.GetBoxReply{} + if err = client.SendProtobuf(roster.List[0], &evoting.GetBox{ID: voteID}, reply); err != nil { + log.Fatal("get box request:", err) + } + + if len(*argVoteCandidates) < 6 { + log.Fatal("Need at least one candidate to vote for") + } + voteCandidatesStrings := strings.Split(*argVoteCandidates, ",") + voteCandidates := make([]uint32, len(voteCandidatesStrings)) + for i, c := range voteCandidatesStrings { + cand, err := strconv.Atoi(c) + log.ErrFatal(err, "Wrong SCIPER ID for candidate") + voteCandidates[i] = uint32(cand) + } + + if priv == nil { + log.Fatal("Need the private key to vote") + } + + fmt.Printf("Votes are: %+v\n", voteCandidates) + + ballot := lib.CreateBallot(reply.Election.MaxChoices, reply.Election.Key, voteUser, voteCandidates) + request := &evoting.Cast{ + ID: voteID, + User: voteUser, + Ballot: &ballot, + Signature: lib.GenerateSignature(priv, reply.Election.Master, voteUser), + } + replyCast := &evoting.CastReply{} + log.ErrFatal(client.SendProtobuf(roster.List[0], request, replyCast)) + log.Info("Successfully cast this vote") + return + } + if *argAdmins == "" { log.Fatal("Admin list (-admins) must have at least one id.") } @@ -207,18 +317,6 @@ func main() { log.Fatal("pin must be set for create and update operations.") } - var pub kyber.Point - if *argKey != "" { - pub, err = parseKey(*argKey) - if err != nil { - log.Fatal("cannot parse key: ", err) - } - } else { - kp := key.NewKeyPair(cothority.Suite) - log.Infof("Auth-server private key: %v", kp.Private) - pub = kp.Public - } - request := &evoting.Link{Pin: *argPin, Roster: roster, Key: pub, Admins: admins} if *argID != "" { id, err := hex.DecodeString(*argID) @@ -241,11 +339,11 @@ func main() { } reply := &evoting.LinkReply{} - client := onet.NewClient(cothority.Suite, evoting.ServiceName) if err = client.SendProtobuf(roster.List[0], request, reply); err != nil { log.Fatal("link request: ", err) } + log.Infof("Auth-server private key: %v", priv) log.Infof("Auth-server public key: %v", pub) log.Infof("Master ID: %x", reply.ID) } diff --git a/evoting/lib/container.go b/evoting/lib/container.go index 42f121b97c..33d63b330a 100644 --- a/evoting/lib/container.go +++ b/evoting/lib/container.go @@ -6,31 +6,24 @@ import ( "go.dedis.ch/kyber/v3/proof" "go.dedis.ch/kyber/v3/share/dkg/rabin" "go.dedis.ch/kyber/v3/shuffle" + "go.dedis.ch/kyber/v3/sign/schnorr" "go.dedis.ch/kyber/v3/util/random" + "go.dedis.ch/onet/v3/log" + "strconv" ) +// CandidatesPerPoint indicates how many candidates fit into an ed25519 Point: +// As each candidate takes 3 bytes, and an ed25519 Point allows to embed 30 bytes, +// there is space for 10 candidates in one ed25519 Point. +// For some obscure reason (off-by-one?) the code checks for 9 candidates, so we +// keep this for not breaking previous elections. +const CandidatesPerPoint = 9 + // Box is a wrapper around a list of encrypted ballots. type Box struct { Ballots []*Ballot } -// genMix generates n mixes with corresponding proofs out of the ballots. -func (b *Box) genMix(key kyber.Point, n int) []*Mix { - mixes := make([]*Mix, n) - - x, y := Split(b.Ballots) - for i := range mixes { - v, w, prover := shuffle.Shuffle(cothority.Suite, nil, key, x, y, random.New()) - proof, _ := proof.HashProve(cothority.Suite, "", prover) - mixes[i] = &Mix{ - Ballots: Combine(v, w), - Proof: proof, - } - x, y = v, w - } - return mixes -} - // genPartials generates partial decryptions for a given list of shared secrets. func (m *Mix) genPartials(dkgs []*dkg.DistKeyGenerator) []*Partial { partials := make([]*Partial, len(dkgs)) @@ -49,21 +42,148 @@ func (m *Mix) genPartials(dkgs []*dkg.DistKeyGenerator) []*Partial { } // Split separates the ElGamal pairs of a list of ballots into separate lists. -func Split(ballots []*Ballot) (alpha, beta []kyber.Point) { - n := len(ballots) - alpha, beta = make([]kyber.Point, n), make([]kyber.Point, n) +func Split(ballots []*Ballot) (alpha, beta [][]kyber.Point) { + nbrBallots := len(ballots) + // Each encrypted point holds protocol.CandidatePerPoint choices of a voter. + // For backward-compatibility, the first point is Ballot.Alpha / Ballot.Beta. + nbrPoints := 1 + if nbrBallots > 0 { + nbrPoints += len(ballots[0].AdditionalAlphas) + } + + // This is to make alpha and beta compatible with the dedis/kyber/shuffle/sequences.go + alpha, beta = make([][]kyber.Point, nbrPoints), make([][]kyber.Point, nbrPoints) + for i := range alpha { + alpha[i] = make([]kyber.Point, nbrBallots) + beta[i] = make([]kyber.Point, nbrBallots) + } + for i := range ballots { - alpha[i] = ballots[i].Alpha - beta[i] = ballots[i].Beta + b := ballots[i] + alpha[0][i] = b.Alpha + beta[0][i] = b.Beta + for j := 1; j < nbrPoints; j++ { + alpha[j][i] = b.AdditionalAlphas[j-1] + beta[j][i] = b.AdditionalBetas[j-1] + } } return } // Combine creates a list of ballots from two lists of points. -func Combine(alpha, beta []kyber.Point) []*Ballot { - ballots := make([]*Ballot, len(alpha)) +func Combine(alpha, beta [][]kyber.Point) []*Ballot { + ballots := make([]*Ballot, len(alpha[0])) for i := range ballots { - ballots[i] = &Ballot{Alpha: alpha[i], Beta: beta[i]} + ballots[i] = &Ballot{Alpha: alpha[0][i], Beta: beta[0][i]} + if len(alpha) > 1 { + ballots[i].AdditionalAlphas = make([]kyber.Point, len(alpha)-1) + ballots[i].AdditionalBetas = make([]kyber.Point, len(alpha)-1) + for j := range ballots[i].AdditionalAlphas { + ballots[i].AdditionalAlphas[j] = alpha[j+1][i] + ballots[i].AdditionalBetas[j] = beta[j+1][i] + } + } } return ballots } + +// CreateShuffleProof takes the alphas and betas of a Ballot, shuffles them, and then returns the result +// as well as a proof. +// If the alphas are of length one, it uses the algorithm before July 2023. +// If the alphas are longer, it uses the shuffle.SequencesShuffle. +func CreateShuffleProof(alphas, betas [][]kyber.Point, pubKey kyber.Point) ([][]kyber.Point, [][]kyber.Point, []byte, error) { + // Protect from missing input. + for i := range alphas { + for j := range alphas[i] { + if alphas[i][j] == nil { + alphas[i][j] = cothority.Suite.Point().Null() + } + } + } + for i := range betas { + for j := range betas[i] { + if betas[i][j] == nil { + betas[i][j] = cothority.Suite.Point().Null() + } + } + } + + // Backward compatible handling of creating the shuffle proof + if len(alphas) == 1 { + g, d, prov := shuffle.Shuffle(cothority.Suite, nil, pubKey, alphas[0], betas[0], random.New()) + shuffleProof, err := proof.HashProve(cothority.Suite, "", prov) + return [][]kyber.Point{g}, [][]kyber.Point{d}, shuffleProof, err + } + + // New shuffle proof using `shuffle.SequencesShuffle` + g, d, provSeq := shuffle.SequencesShuffle(cothority.Suite, nil, pubKey, alphas, betas, random.New()) + // Creating a prover taken from the `shuffle.Shuffle` method + beta := make([]kyber.Scalar, len(alphas)) + for i := 0; i < len(alphas); i++ { + beta[i] = cothority.Suite.Scalar().Pick(random.New()) + } + prov, err := provSeq(beta) + shuffleProof, err := proof.HashProve(cothority.Suite, "", prov) + return g, d, shuffleProof, err +} + +// CreateBallot returns a ballot for a user. It makes sure that enough alphas and betas are initialized, +// even if the user votes for less than maxChoices candidates. +func CreateBallot(maxChoices int, pubKey kyber.Point, user uint32, elected []uint32) Ballot { + totalBufs := (maxChoices-1)/9 + 1 + k := make([]kyber.Point, totalBufs) + c := make([]kyber.Point, totalBufs) + for buf := range k { + end := (buf + 1) * CandidatesPerPoint + if end > maxChoices { + end = maxChoices + } + if end > len(elected) { + end = len(elected) + } + start := buf * CandidatesPerPoint + var electedSlice []uint32 + if start < maxChoices && start < len(elected) { + electedSlice = elected[start:end] + } + log.Printf("electedSlice for buf %d is: %x", buf, electedSlice) + k[buf], c[buf] = Encrypt(pubKey, scipersToBuf(electedSlice)) + } + ballot := Ballot{ + User: user, + Alpha: k[0], + Beta: c[0], + } + if maxChoices > CandidatesPerPoint { + ballot.AdditionalAlphas = k[1:] + ballot.AdditionalBetas = c[1:] + } + log.Printf("ballot is: %+v", ballot) + return ballot +} + +// GenerateSignature creates a USELESS signature which should be replaced for any follow-up implementation. +// It merely signs the ID of the chain, and as such does not provide any guarantee that the user signing +// actually wanted to do anything with regard to the additional data... +// Also, if the signature fails, this method panics. +func GenerateSignature(private kyber.Scalar, ID []byte, sciper uint32) []byte { + message := ID + for _, c := range strconv.Itoa(int(sciper)) { + d, _ := strconv.Atoi(string(c)) + message = append(message, byte(d)) + } + sig, err := schnorr.Sign(cothority.Suite, private, message) + if err != nil { + panic("cannot sign:" + err.Error()) + } + return sig +} + +func scipersToBuf(scipers []uint32) []byte { + var buf = make([]byte, len(scipers)*3) + for i := range buf { + s := scipers[i/3] >> ((i % 3) * 8) + buf[i] = byte(s & 0xff) + } + return buf +} diff --git a/evoting/lib/container_test.go b/evoting/lib/container_test.go index 358834fa09..957f0894e4 100644 --- a/evoting/lib/container_test.go +++ b/evoting/lib/container_test.go @@ -23,21 +23,50 @@ func TestSplit(t *testing.T) { ballots := genBox(X, 2).Ballots a, b := Split(ballots) - assert.Equal(t, ballots[0].Alpha, a[0]) - assert.Equal(t, ballots[0].Beta, b[0]) - assert.Equal(t, ballots[1].Alpha, a[1]) - assert.Equal(t, ballots[1].Beta, b[1]) + assert.Equal(t, ballots[0].Alpha, a[0][0]) + assert.Equal(t, ballots[0].Beta, b[0][0]) + assert.Equal(t, ballots[1].Alpha, a[0][1]) + assert.Equal(t, ballots[1].Beta, b[0][1]) } func TestCombine(t *testing.T) { _, X1 := RandomKeyPair() _, X2 := RandomKeyPair() - a, b := []kyber.Point{X1, X1}, []kyber.Point{X2, X2} + a, b := [][]kyber.Point{{X1, X2}, {X2, X1}}, [][]kyber.Point{{X2, X1}, {X1, X2}} ballots := Combine(a, b) assert.Equal(t, X1, ballots[0].Alpha) - assert.Equal(t, X1, ballots[1].Alpha) + assert.Equal(t, X2, ballots[1].Alpha) assert.Equal(t, X2, ballots[0].Beta) - assert.Equal(t, X2, ballots[1].Beta) + assert.Equal(t, X1, ballots[1].Beta) + assert.Equal(t, X2, ballots[0].AdditionalAlphas[0]) + assert.Equal(t, X1, ballots[1].AdditionalAlphas[0]) + assert.Equal(t, X1, ballots[0].AdditionalBetas[0]) + assert.Equal(t, X2, ballots[1].AdditionalBetas[0]) +} + +func TestScipersToBuf(t *testing.T) { + scipers := []uint32{0x100000, 0x100001, 0x100002} + + buf := scipersToBuf(scipers[0:1]) + assert.Equal(t, 3, len(buf)) + assert.Equal(t, uint8(0x0), buf[0]) + assert.Equal(t, uint8(0x0), buf[1]) + assert.Equal(t, uint8(0x10), buf[2]) + + buf = scipersToBuf(scipers[0:2]) + assert.Equal(t, 6, len(buf)) + + buf = scipersToBuf(scipers) + assert.Equal(t, 9, len(buf)) + assert.Equal(t, uint8(0x0), buf[0]) + assert.Equal(t, uint8(0x0), buf[1]) + assert.Equal(t, uint8(0x10), buf[2]) + assert.Equal(t, uint8(0x1), buf[3]) + assert.Equal(t, uint8(0x0), buf[4]) + assert.Equal(t, uint8(0x10), buf[5]) + assert.Equal(t, uint8(0x2), buf[6]) + assert.Equal(t, uint8(0x0), buf[7]) + assert.Equal(t, uint8(0x10), buf[8]) } diff --git a/evoting/lib/elgamal.go b/evoting/lib/elgamal.go index e8230b26b0..7174074e0c 100644 --- a/evoting/lib/elgamal.go +++ b/evoting/lib/elgamal.go @@ -2,6 +2,7 @@ package lib import ( "errors" + "go.dedis.ch/onet/v3/log" "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/proof" @@ -31,10 +32,17 @@ func Decrypt(private kyber.Scalar, K, C kyber.Point) kyber.Point { } // Verify performs verifies the proof of a Neff shuffle. -func Verify(tag []byte, public kyber.Point, x, y, v, w []kyber.Point) error { - if len(x) < 2 || len(y) < 2 || len(v) < 2 || len(w) < 2 { +func Verify(tag []byte, public kyber.Point, x, y, v, w [][]kyber.Point) error { + if len(x[0]) < 2 || len(y[0]) < 2 || len(v[0]) < 2 || len(w[0]) < 2 { return errors.New("cannot verify less than 2 points") } - verifier := shuffle.Verifier(cothority.Suite, nil, public, x, y, v, w) - return proof.HashVerify(cothority.Suite, "", verifier, tag) + if len(x) == 1 { + verifier := shuffle.Verifier(cothority.Suite, nil, public, x[0], y[0], v[0], w[0]) + return proof.HashVerify(cothority.Suite, "", verifier, tag) + } + + // TODO: This really should be possible. But the current implementation of shuffle.SequencesShuffle doesn't + // implement the verification! Or at least I cannot see how it's done... + log.Warn("Cannot verify mixes for more than 9 candidates!") + return nil } diff --git a/evoting/lib/proto.go b/evoting/lib/proto.go index cb9112d84d..9994fadfad 100644 --- a/evoting/lib/proto.go +++ b/evoting/lib/proto.go @@ -13,6 +13,7 @@ import ( // type :map\[string\]string:map // type :network.ServerIdentityID:bytes // type :ElectionState:uint32 +// type :kyber.Point:bytes // import "onet.proto"; // // option java_package = "ch.epfl.dedis.lib.proto"; @@ -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. @@ -147,4 +154,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 } diff --git a/evoting/lib/transaction.go b/evoting/lib/transaction.go index 063a1f009d..1a50de38f5 100644 --- a/evoting/lib/transaction.go +++ b/evoting/lib/transaction.go @@ -177,7 +177,7 @@ func (t *Transaction) Verify(genesis skipchain.SkipBlockID, s *skipchain.Service return errors.New("alpha and beta must be non-nil") } if t.Ballot.Alpha.Equal(null) || t.Ballot.Beta.Equal(null) { - return errors.New("alpha and beta must be null points") + return errors.New("alpha and beta must be non-null points") } // t.User is trusted at this point, so make sure that they did not try to sneak @@ -211,6 +211,12 @@ func (t *Transaction) Verify(genesis skipchain.SkipBlockID, s *skipchain.Service } else if !election.IsUser(t.User) { return errors.New("cast error: user not part") } + if election.MaxChoices > CandidatesPerPoint { + addLen := (election.MaxChoices - 1) / CandidatesPerPoint + if len(t.Ballot.AdditionalAlphas) != addLen || len(t.Ballot.AdditionalBetas) != addLen { + return errors.New("ballot error: not enough Additional{Alphas,Betas}") + } + } return nil } else if t.Mix != nil { election, err := GetElection(s, genesis, false, t.User) @@ -230,6 +236,8 @@ func (t *Transaction) Verify(genesis skipchain.SkipBlockID, s *skipchain.Service if err != nil { return err } + // BUG: This signature verification doesn't prove anything usable. It should verify that the + // t.Mix is valid. err = schnorr.Verify(cothority.Suite, proposer.Public, data, t.Mix.Signature) if err != nil { return err @@ -256,7 +264,7 @@ func (t *Transaction) Verify(genesis skipchain.SkipBlockID, s *skipchain.Service } // check if Mix is valid - var x, y []kyber.Point + var x, y [][]kyber.Point if len(mixes) == 0 { // verify against Boxes boxes, err := election.Box(s) diff --git a/evoting/proto.go b/evoting/proto.go new file mode 100644 index 0000000000..e15d132395 --- /dev/null +++ b/evoting/proto.go @@ -0,0 +1,40 @@ +package evoting + +import ( + "go.dedis.ch/cothority/v3/skipchain" + "go.dedis.ch/kyber/v3" +) + +// PROTOSTART +// package evoting_api; +// type :skipchain.SkipBlockID:bytes +// type :kyber.Point:bytes +// +// option java_package = "ch.epfl.dedis.lib.proto"; +// option java_outer_classname = "EvotingAPI"; + +// Reconstruct message. +type Reconstruct struct { + // ID of the election skipchain. + ID skipchain.SkipBlockID +} + +// ReconstructReply message. +type ReconstructReply struct { + // Points are the decrypted plaintexts. + Points []kyber.Point + // Eventual additional points - only if more than 9 candidates + AdditionalPoints []AddPoints +} + +// AddPoints if maxChoices > 9 +type AddPoints struct { + // The additional Points + AdditionalPoints []kyber.Point +} + +// Ping message. +type Ping struct { + // Nonce can be any integer. + Nonce uint32 +} diff --git a/evoting/protocol/decrypt.go b/evoting/protocol/decrypt.go index c50cb78227..6dac75e66f 100644 --- a/evoting/protocol/decrypt.go +++ b/evoting/protocol/decrypt.go @@ -73,9 +73,9 @@ func (d *Decrypt) Start() error { // There are three parts now: // 1. Verification of state - if this fails, it's over and `Done` is called // 2. Create decryption block and send it to the leader - if it fails, -// `Done` is called +// `Done` is called // 3. Send the decryption block to the skipchain - also will have `Done` -// called if it fails +// called if it fails func (d *Decrypt) HandlePrompt(prompt MessagePromptDecrypt) error { var mixes []*lib.Mix var partials []*lib.Partial @@ -102,9 +102,16 @@ func (d *Decrypt) HandlePrompt(prompt MessagePromptDecrypt) error { err := func() error { mix := mixes[len(mixes)-1] points := make([]kyber.Point, len(mix.Ballots)) + additionalPoints := make([]lib.PartialAdditional, len(mix.Ballots)) for i := range points { - points[i] = lib.Decrypt(d.Secret.V, mix.Ballots[i].Alpha, mix.Ballots[i].Beta) + ballot := mix.Ballots[i] + points[i] = lib.Decrypt(d.Secret.V, ballot.Alpha, ballot.Beta) + additionalPoints[i].AdditionalPoints = make([]kyber.Point, len(ballot.AdditionalAlphas)) + for j := range additionalPoints[i].AdditionalPoints { + additionalPoints[i].AdditionalPoints[j] = lib.Decrypt(d.Secret.V, ballot.AdditionalAlphas[j], ballot.AdditionalBetas[j]) + } } + index := -1 for i, node := range d.Election.Roster.List { if node.Public.Equal(d.Public()) { @@ -117,13 +124,18 @@ func (d *Decrypt) HandlePrompt(prompt MessagePromptDecrypt) error { } partial = &lib.Partial{ - Points: points, - NodeID: d.ServerIdentity().ID, + Points: points, + NodeID: d.ServerIdentity().ID, + AdditionalPoints: additionalPoints, } data, err := d.ServerIdentity().Public.MarshalBinary() if err != nil { return d.SendTo(d.Root(), &TerminateDecrypt{Error: err.Error()}) } + + // BUG: This signature only proves that at some moment, this node + // was here. But a malicious other node could change the data however it wishes. + // Or an attacking node could simply copy the signature to a new block. sig, err := schnorr.Sign(cothority.Suite, d.Private(), data) if err != nil { return d.SendTo(d.Root(), &TerminateDecrypt{Error: err.Error()}) diff --git a/evoting/protocol/decrypt_test.go b/evoting/protocol/decrypt_test.go index 6984ec69e9..744cd6704b 100644 --- a/evoting/protocol/decrypt_test.go +++ b/evoting/protocol/decrypt_test.go @@ -6,10 +6,7 @@ import ( "time" "go.dedis.ch/kyber/v3" - "go.dedis.ch/kyber/v3/proof" - "go.dedis.ch/kyber/v3/shuffle" "go.dedis.ch/kyber/v3/sign/schnorr" - "go.dedis.ch/kyber/v3/util/random" "go.dedis.ch/onet/v3" "go.dedis.ch/onet/v3/log" "go.dedis.ch/onet/v3/network" @@ -109,19 +106,19 @@ func runDecrypt(t *testing.T, n int) { mixes := make([]*lib.Mix, n) x, y := lib.Split(ballots) for i := range mixes { - v, w, prover := shuffle.Shuffle(cothority.Suite, nil, key, x, y, random.New()) - proof, _ := proof.HashProve(cothority.Suite, "", prover) + v, w, shuffleProof, err := lib.CreateShuffleProof(x, y, key) + require.NoError(t, err) public := roster.Get(i).Public data, _ := public.MarshalBinary() sig, _ := schnorr.Sign(cothority.Suite, local.GetPrivate(nodes[i]), data) mix := &lib.Mix{ Ballots: lib.Combine(v, w), - Proof: proof, + Proof: shuffleProof, NodeID: roster.Get(i).ID, Signature: sig, } tx = lib.NewTransaction(mix, election.Creator) - err := lib.StoreUsingWebsocket(election.ID, election.Roster, tx) + err = lib.StoreUsingWebsocket(election.ID, election.Roster, tx) require.NoError(t, err) x, y = v, w } @@ -194,20 +191,20 @@ func TestDecryptNodeFailure(t *testing.T) { mixes := make([]*lib.Mix, 7) x, y := lib.Split(ballots) for i := range mixes { - v, w, prover := shuffle.Shuffle(cothority.Suite, nil, key, x, y, random.New()) - proof, _ := proof.HashProve(cothority.Suite, "", prover) + v, w, shuffleProof, err := lib.CreateShuffleProof(x, y, key) + require.NoError(t, err) public := roster.Get(i).Public data, _ := public.MarshalBinary() sig, _ := schnorr.Sign(cothority.Suite, local.GetPrivate(nodes[i]), data) mix := &lib.Mix{ Ballots: lib.Combine(v, w), - Proof: proof, + Proof: shuffleProof, NodeID: roster.Get(i).ID, Signature: sig, } mixes[i] = mix tx = lib.NewTransaction(mix, election.Creator) - err := lib.StoreUsingWebsocket(election.ID, election.Roster, tx) + err = lib.StoreUsingWebsocket(election.ID, election.Roster, tx) require.NoError(t, err) x, y = v, w } diff --git a/evoting/protocol/shuffle.go b/evoting/protocol/shuffle.go index 74315a1898..c6b03ccd7e 100644 --- a/evoting/protocol/shuffle.go +++ b/evoting/protocol/shuffle.go @@ -2,12 +2,9 @@ package protocol import ( "errors" - + "fmt" "go.dedis.ch/cothority/v3" - "go.dedis.ch/kyber/v3/proof" - "go.dedis.ch/kyber/v3/shuffle" "go.dedis.ch/kyber/v3/sign/schnorr" - "go.dedis.ch/kyber/v3/util/random" "go.dedis.ch/onet/v3" "go.dedis.ch/onet/v3/log" "go.dedis.ch/onet/v3/network" @@ -18,7 +15,7 @@ import ( /* Each participating node creates a verifiable shuffle with a corresponding proof -of the last last block in election skipchain. This block is either a box of +of the last block in the election skipchain. This block is either a box of encrypted ballot (in case of the root node) or a mix of the previous node. Every newly created shuffle is appended to the chain before the next node is prompted to create its shuffle. The leaf node notifies the root upon storing its shuffle, @@ -70,9 +67,9 @@ func (s *Shuffle) Start() error { // LG: rewrote the function to correctly call Done - probably should be // rewritten even further. There are three `func() error` now with different // error-handling. In case of error: -// 1. we abort and stop processing -// 2. will return the error, but first call 3. -// 3. try to call it and abort if error found +// 1. we abort and stop processing +// 2. will return the error, but first call 3. +// 3. try to call it and abort if error found func (s *Shuffle) HandlePrompt(prompt MessagePrompt) error { added := 0 var mixes []*lib.Mix @@ -102,7 +99,7 @@ func (s *Shuffle) HandlePrompt(prompt MessagePrompt) error { if len(ballots) < 2 { if err := s.SendTo(s.Root(), &TerminateShuffle{ - Error: "shuffle error: not enough (> 2) ballots to shuffle", + Error: "shuffle error: not enough (< 2) ballots to shuffle", }); err != nil { log.Error(err) } @@ -129,28 +126,21 @@ func (s *Shuffle) HandlePrompt(prompt MessagePrompt) error { return nil } - a, b := lib.Split(ballots) - // Protect from missing input. - for i := range a { - if a[i] == nil { - a[i] = cothority.Suite.Point().Null() - } - } - for i := range b { - if b[i] == nil { - b[i] = cothority.Suite.Point().Null() - } - } - g, d, prov := shuffle.Shuffle(cothority.Suite, nil, s.Election.Key, a, b, random.New()) - proof, err := proof.HashProve(cothority.Suite, "", prov) + alphas, betas := lib.Split(ballots) + g, d, shuffleProof, err := lib.CreateShuffleProof(alphas, betas, s.Election.Key) if err != nil { - return err + return fmt.Errorf("while shuffling votes: %v", err) } + mix = &lib.Mix{ Ballots: lib.Combine(g, d), - Proof: proof, + Proof: shuffleProof, NodeID: s.ServerIdentity().ID, } + + // BUG: This signature only proves that at some moment, this node + // was here. But a malicious other node could change the data however it wishes. + // Or an attacking node could simply copy the signature to a new block. data, err := s.ServerIdentity().Public.MarshalBinary() if err != nil { return err diff --git a/evoting/service/service.go b/evoting/service/service.go index 7e1d723f94..3355620733 100644 --- a/evoting/service/service.go +++ b/evoting/service/service.go @@ -135,7 +135,7 @@ func (s *Service) Link(req *evoting.Link) (*evoting.LinkReply, error) { return &evoting.LinkReply{ID: id}, nil } -// Open message hander. Create a new election with accompanying skipchain. +// Open message handler. Create a new election with accompanying skipchain. func (s *Service) Open(req *evoting.Open) (*evoting.OpenReply, error) { master, err := lib.GetMaster(s.skipchain, req.ID) if err != nil { @@ -367,6 +367,8 @@ func (s *Service) LookupSciper(req *evoting.LookupSciper) (*evoting.LookupSciper return reply, nil } +// SECURITY BUG: this authentication is completely bogus and can be replayed by an attacker. +// See https://github.com/dedis/cothority/issues/2507 func auth(u uint32, sig []byte, master skipchain.SkipBlockID, pub kyber.Point) error { var message []byte message = append(message, master...) @@ -664,14 +666,15 @@ func (s *Service) Reconstruct(req *evoting.Reconstruct) (*evoting.ReconstructRep return nil, errors.New("reconstruct error, election not closed yet") } - points := make([]kyber.Point, 0) - n := len(election.Roster.List) - for i := 0; i < len(partials[0].Points); i++ { + + points := make([]kyber.Point, 0) + additionalPoints := make([]evoting.AddPoints, 0) + for i := range partials[0].Points { shares := make([]*share.PubShare, n) for _, partial := range partials { - j, _ := election.Roster.Search(partial.NodeID) - shares[j] = &share.PubShare{I: j, V: partial.Points[i]} + id, _ := election.Roster.Search(partial.NodeID) + shares[id] = &share.PubShare{I: id, V: partial.Points[i]} } log.Lvl3("Recovering commits", i) @@ -680,9 +683,30 @@ func (s *Service) Reconstruct(req *evoting.Reconstruct) (*evoting.ReconstructRep return nil, err } points = append(points, message) + + // Now take care of eventual additional points. + if len(partials[0].AdditionalPoints) == 0 { + continue + } + var ap evoting.AddPoints + for j := range partials[0].AdditionalPoints[i].AdditionalPoints { + shares := make([]*share.PubShare, n) + for _, partial := range partials { + id, _ := election.Roster.Search(partial.NodeID) + shares[id] = &share.PubShare{I: id, V: partial.AdditionalPoints[i].AdditionalPoints[j]} + } + + log.Lvl3("Recovering commits", i) + message, err := share.RecoverCommit(cothority.Suite, shares, 2*n/3+1, n) + if err != nil { + return nil, err + } + ap.AdditionalPoints = append(ap.AdditionalPoints, message) + } + additionalPoints = append(additionalPoints, ap) } - return &evoting.ReconstructReply{Points: points}, nil + return &evoting.ReconstructReply{Points: points, AdditionalPoints: additionalPoints}, nil } // NewProtocol hooks non-root nodes into created protocols. diff --git a/evoting/service/service_test.go b/evoting/service/service_test.go index b1334075a5..ee4ad3161e 100644 --- a/evoting/service/service_test.go +++ b/evoting/service/service_test.go @@ -12,8 +12,6 @@ import ( "go.dedis.ch/cothority/v3/evoting/lib" "go.dedis.ch/cothority/v3/skipchain" "go.dedis.ch/kyber/v3" - "go.dedis.ch/kyber/v3/proof" - "go.dedis.ch/kyber/v3/shuffle" "go.dedis.ch/kyber/v3/sign/schnorr" "go.dedis.ch/kyber/v3/util/key" "go.dedis.ch/kyber/v3/util/random" @@ -56,6 +54,7 @@ var ( bufCand2 = []byte{byte(idCand2 & 0xff), byte((idCand2 >> 8) & 0xff), byte((idCand2 >> 16) & 0xff)} ) +// Tests all parts of the voting procedure, from setting up a node to voting, shuffling, and decryption. func TestService(t *testing.T) { local := onet.NewLocalTest(cothority.Suite) defer local.CloseAll() @@ -307,8 +306,195 @@ func TestService(t *testing.T) { } } +// Tests that the new extension to have more than CandidatesPerPoint candidates works. +func TestManyCandidates(t *testing.T) { + testManyCandidatesFailures(t, 0) +} + +// Tests that the new extension to have more than CandidatesPerPoint candidates works, also in the presence of +// failing nodes. +func TestManyCandidatesWithFailures(t *testing.T) { + testManyCandidatesFailures(t, 2) +} + +// Helper function to test with and without failures. +func testManyCandidatesFailures(t *testing.T, failures int) { + require.True(t, failures >= 0 && failures <= 2) + + local := onet.NewLocalTest(cothority.Suite) + defer local.CloseAll() + + nodeKP := key.NewKeyPair(cothority.Suite) + + nodes, roster, _ := local.GenBigTree(7, 7, 1, true) + s0 := local.GetServices(nodes, serviceID)[0].(*Service) + sc0 := local.GetServices(nodes, onet.ServiceFactory.ServiceID(skipchain.ServiceName))[0].(*skipchain.Service) + // Set a lower timeout for the tests + sc0.SetPropTimeout(defaultTimeout / 8) + + // Creating master skipchain + replyLink, err := s0.Link(&evoting.Link{ + Pin: s0.pin, + Roster: roster, + Key: nodeKP.Public, + Admins: []uint32{idAdmin}, + }) + require.NoError(t, err) + + idAdminSig := generateSignature(nodeKP.Private, replyLink.ID, idAdmin) + + maxChoices := 20 + totalBufs := (maxChoices-1)/lib.CandidatesPerPoint + 1 + manyCandidates := make([]uint32, maxChoices) + for m := range manyCandidates { + manyCandidates[m] = 0x100000 + uint32(m) + } + + elec := &lib.Election{ + Name: map[string]string{ + "en": "name in english", + }, + Subtitle: map[string]string{ + "en": "name in english", + }, + MoreInfoLang: map[string]string{ + "en": "https://epfl.ch/elections", + }, + Creator: idAdmin, + Users: []uint32{idUser1, idUser2, idUser3, idAdmin}, + Roster: roster, + Start: yesterday.Unix(), + End: tomorrow.Unix(), + MaxChoices: maxChoices, + Candidates: manyCandidates, + } + + // Create a new election + replyOpen, err := s0.Open(&evoting.Open{ + ID: replyLink.ID, + Election: elec, + User: idAdmin, + Signature: idAdminSig, + }) + require.NoError(t, err) + elec.ID = replyOpen.ID + + for pause := 1; pause <= failures; pause++ { + nodes[len(nodes)-pause].Pause() + } + + // Cast a vote for only up to nine candidates - should be rejected + log.Lvl1("Casting one empty ballot buffer") + idUser1Sig := generateSignature(nodeKP.Private, replyLink.ID, idUser1) + k0, c0 := lib.Encrypt(replyOpen.Key, []byte{}) + ballot := &lib.Ballot{ + User: idUser1, + Alpha: k0, + Beta: c0, + } + _, err = s0.Cast(&evoting.Cast{ + ID: replyOpen.ID, + Ballot: ballot, + User: idUser1, + Signature: idUser1Sig, + }) + require.Error(t, err) + require.Nil(t, local.WaitDone(time.Second)) + + // Prepare a helper for testing voting. + vote := func(user uint32, elected []uint32) *evoting.CastReply { + ballot := lib.CreateBallot(maxChoices, replyOpen.Key, user, elected) + cast, err := s0.Cast(&evoting.Cast{ + ID: replyOpen.ID, + Ballot: &ballot, + User: user, + Signature: generateSignature(nodeKP.Private, replyLink.ID, user), + }) + require.NoError(t, err) + return cast + } + + // User votes + log.Lvl1("Casting votes for correct users") + vote(idUser1, []uint32{}) + vote(idUser2, manyCandidates[0:lib.CandidatesPerPoint]) + vote(idUser3, manyCandidates) + + if failures > 0 { + log.Lvl1("Unpausing nodes") + for pause := 1; pause <= failures; pause++ { + nodes[len(nodes)-pause].Unpause() + require.NoError(t, nodes[len(nodes)-pause].Service(skipchain.ServiceName).(*skipchain.Service).SyncChain(roster, elec.ID)) + } + log.Lvl1("Should be caught up now") + } + + // Shuffle all votes + log.Lvl1("Shuffling s0") + _, err = s0.Shuffle(&evoting.Shuffle{ + ID: replyOpen.ID, + User: idAdmin, + Signature: idAdminSig, + }) + require.NoError(t, err) + require.Nil(t, local.WaitDone(time.Second)) + + // Check that the mixes have the additional proofs set + log.Lvl1("Check partials in mixes") + mix, err := s0.GetMixes(&evoting.GetMixes{ID: replyOpen.ID}) + require.NoError(t, err) + for i := range nodes[0:5] { + for j := range mix.Mixes[i].Ballots { + require.Equal(t, totalBufs-1, len(mix.Mixes[i].Ballots[j].AdditionalAlphas)) + require.Equal(t, totalBufs-1, len(mix.Mixes[i].Ballots[j].AdditionalBetas)) + } + } + + // Decrypt all votes + _, err = s0.Decrypt(&evoting.Decrypt{ + ID: replyOpen.ID, + User: idAdmin, + Signature: idAdminSig, + }) + require.NoError(t, err) + require.Nil(t, local.WaitDone(time.Second)) + + // Check that the partial decryption have the additional points set + log.Lvl1("Check partials in mixes") + partials, err := s0.GetPartials(&evoting.GetPartials{ID: replyOpen.ID}) + require.NoError(t, err) + for i := range nodes { + require.Equal(t, totalBufs-1, len(partials.Partials[i].AdditionalPoints[0].AdditionalPoints)) + } + + // Reconstruct votes + reconstructReply, err := s0.Reconstruct(&evoting.Reconstruct{ + ID: replyOpen.ID, + }) + require.NoError(t, err) + + for i, p := range reconstructReply.Points { + log.Lvl2("Point is:", p.String()) + data, err := p.Data() + if err != nil { + log.Lvl2("Point-data has error") + } else { + log.Lvlf2("Point-data is: %x", data) + } + for _, a := range reconstructReply.AdditionalPoints[i].AdditionalPoints { + log.Lvl2("And additional points are:", a.String()) + data, err := a.Data() + if err != nil { + log.Lvl2("Additional point-data has error") + } else { + log.Lvlf2("Additional point-data is: %x", data) + } + } + } +} + // This is an end-to end test, just like TestService, so it has a lot of copy-paste -// stuff. It is useful to have this as it's own test because I wanted to investigate +// stuff. It is useful to have this as its own test because I wanted to investigate // the behaviour of decryption of the badly encrypted points. func TestBadEncryption(t *testing.T) { local := onet.NewLocalTest(cothority.Suite) @@ -433,6 +619,7 @@ func TestBadEncryption(t *testing.T) { } } +// Test what happens if a vote is cast once the election is finished. func TestAfterEnd(t *testing.T) { local := onet.NewLocalTest(cothority.Suite) defer local.CloseAll() @@ -506,6 +693,7 @@ func TestAfterEnd(t *testing.T) { require.Error(t, err) } +// Test what happens if a vote is cast before the election is started. func TestBeforeStart(t *testing.T) { local := onet.NewLocalTest(cothority.Suite) defer local.CloseAll() @@ -649,6 +837,7 @@ func runAnElection(t *testing.T, local *onet.LocalTest, s *Service, replyLink *e require.Nil(t, local.WaitDone(time.Second)) } +// Test if we can evolve the roster to modify the list of nodes. func TestEvolveRoster(t *testing.T) { if testing.Short() { t.Skip("not using evolveRoster in travis") @@ -759,6 +948,7 @@ func setupElection(t *testing.T, s0 *Service, rl *evoting.LinkReply, nodeKP *key return replyOpen.ID } +// Make sure shuffling is still possible with two failing nodes out of 7. func TestShuffleBenignNodeFailure(t *testing.T) { if testing.Short() { t.Skip("skipping", t.Name(), " in short mode") @@ -800,6 +990,7 @@ func TestShuffleBenignNodeFailure(t *testing.T) { require.NoError(t, err) } +// Assert that shuffling is not possible with 3 out of 7 nodes failing. func TestShuffleCatastrophicNodeFailure(t *testing.T) { if testing.Short() { t.Skip("not using ShuffleCatastrophic in travis") @@ -838,13 +1029,12 @@ func TestShuffleCatastrophicNodeFailure(t *testing.T) { require.NoError(t, err) genMix := func(ballots []*lib.Ballot, election *lib.Election, serverIdentity *network.ServerIdentity, private kyber.Scalar) *lib.Mix { - a, b := lib.Split(ballots) - g, d, prov := shuffle.Shuffle(cothority.Suite, nil, election.Key, a, b, random.New()) - proof, err := proof.HashProve(cothority.Suite, "", prov) + alphas, betas := lib.Split(ballots) + g, d, shuffleProof, err := lib.CreateShuffleProof(alphas, betas, election.Key) require.NoError(t, err) mix := &lib.Mix{ Ballots: lib.Combine(g, d), - Proof: proof, + Proof: shuffleProof, NodeID: serverIdentity.ID, } data, err := serverIdentity.Public.MarshalBinary() @@ -896,6 +1086,7 @@ func TestShuffleCatastrophicNodeFailure(t *testing.T) { require.NoError(t, err) } +// Assert decryption can happen with 2 out of 7 nodes failing. func TestDecryptBenignNodeFailure(t *testing.T) { if testing.Short() { t.Skip("skipping", t.Name(), " in short mode") @@ -945,6 +1136,7 @@ func TestDecryptBenignNodeFailure(t *testing.T) { require.NoError(t, err) } +// Assert decryption fails with 3 out of 7 nodes failing. func TestDecryptCatastrophicNodeFailure(t *testing.T) { if testing.Short() { t.Skip("not using DecryptCatastrophic in travis") @@ -1017,6 +1209,7 @@ func TestDecryptCatastrophicNodeFailure(t *testing.T) { require.NoError(t, err) } +// Assert that a momentarily offline node during election can join again for shuffling. func TestCastNodeFailureShuffleAllOk(t *testing.T) { if testing.Short() { t.Skip("skipping", t.Name(), " in short mode") @@ -1080,6 +1273,7 @@ func TestCastNodeFailureShuffleAllOk(t *testing.T) { nodes[5].Pause() log.Lvl1("Voting with one node paused") vote(idUser2, bufCand1) + log.Lvl1("Unpausing node again") nodes[5].Unpause() @@ -1095,6 +1289,7 @@ func TestCastNodeFailureShuffleAllOk(t *testing.T) { require.NoError(t, err) } +// Assert that the LookupSciper method works correctly. func TestLookupSciper(t *testing.T) { // Comment this out when you want to run this unit test for dev work. t.Skip("unit tests should not call external servers") diff --git a/evoting/struct.go b/evoting/struct.go index 3f68a89e22..76e2686686 100644 --- a/evoting/struct.go +++ b/evoting/struct.go @@ -1,12 +1,11 @@ package evoting import ( + "go.dedis.ch/cothority/v3/evoting/lib" + "go.dedis.ch/cothority/v3/skipchain" "go.dedis.ch/kyber/v3" "go.dedis.ch/onet/v3" "go.dedis.ch/onet/v3/network" - - "go.dedis.ch/cothority/v3/evoting/lib" - "go.dedis.ch/cothority/v3/skipchain" ) func init() { @@ -152,18 +151,3 @@ type GetPartials struct { type GetPartialsReply struct { Partials []*lib.Partial // Partials from all conodes. } - -// Reconstruct message. -type Reconstruct struct { - ID skipchain.SkipBlockID // ID of the election skipchain. -} - -// ReconstructReply message. -type ReconstructReply struct { - Points []kyber.Point // Points are the decrypted plaintexts. -} - -// Ping message. -type Ping struct { - Nonce uint32 // Nonce can be any integer. -} diff --git a/external/Makefile b/external/Makefile index 0f155d8634..61aefd4799 100644 --- a/external/Makefile +++ b/external/Makefile @@ -15,9 +15,14 @@ do-js: check_protoc check_protoc: - @which protoc || (echo "Install protoc version 3.17.3. On Mac, run \"brew install protobuf@3.17.3\"" && exit 1) - @pv=`protoc --version`; \ + which protoc || $(MAKE) protoc_instructions + pv=`protoc --version`; \ if [ "$$pv" != "libprotoc 3.17.3" ]; then \ echo "Protoc version $$pv is not supported."; \ - exit 1; \ + $(MAKE) protoc_instructions; \ fi + +protoc_instructions: + echo "Please download version 3.17.3 from here:" + echo "https://github.com/protocolbuffers/protobuf/releases/tag/v3.17.3" + exit 1 diff --git a/external/java/src/main/java/ch/epfl/dedis/lib/proto/Evoting.java b/external/java/src/main/java/ch/epfl/dedis/lib/proto/Evoting.java index 1d4c638050..44a700f430 100644 --- a/external/java/src/main/java/ch/epfl/dedis/lib/proto/Evoting.java +++ b/external/java/src/main/java/ch/epfl/dedis/lib/proto/Evoting.java @@ -9650,6 +9650,58 @@ public interface BallotOrBuilder extends * @return The beta. */ com.google.protobuf.ByteString getBeta(); + + /** + *
+     * 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.
+     * 
+ * + * repeated bytes additionalalphas = 4; + * @return A list containing the additionalalphas. + */ + java.util.List getAdditionalalphasList(); + /** + *
+     * 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.
+     * 
+ * + * repeated bytes additionalalphas = 4; + * @return The count of additionalalphas. + */ + int getAdditionalalphasCount(); + /** + *
+     * 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.
+     * 
+ * + * repeated bytes additionalalphas = 4; + * @param index The index of the element to return. + * @return The additionalalphas at the given index. + */ + com.google.protobuf.ByteString getAdditionalalphas(int index); + + /** + * repeated bytes additionalbetas = 5; + * @return A list containing the additionalbetas. + */ + java.util.List getAdditionalbetasList(); + /** + * repeated bytes additionalbetas = 5; + * @return The count of additionalbetas. + */ + int getAdditionalbetasCount(); + /** + * repeated bytes additionalbetas = 5; + * @param index The index of the element to return. + * @return The additionalbetas at the given index. + */ + com.google.protobuf.ByteString getAdditionalbetas(int index); } /** *
@@ -9670,6 +9722,8 @@ private Ballot(com.google.protobuf.GeneratedMessageV3.Builder builder) {
     private Ballot() {
       alpha_ = com.google.protobuf.ByteString.EMPTY;
       beta_ = com.google.protobuf.ByteString.EMPTY;
+      additionalalphas_ = java.util.Collections.emptyList();
+      additionalbetas_ = java.util.Collections.emptyList();
     }
 
     @java.lang.Override
@@ -9718,6 +9772,22 @@ private Ballot(
               beta_ = input.readBytes();
               break;
             }
+            case 34: {
+              if (!((mutable_bitField0_ & 0x00000008) != 0)) {
+                additionalalphas_ = new java.util.ArrayList();
+                mutable_bitField0_ |= 0x00000008;
+              }
+              additionalalphas_.add(input.readBytes());
+              break;
+            }
+            case 42: {
+              if (!((mutable_bitField0_ & 0x00000010) != 0)) {
+                additionalbetas_ = new java.util.ArrayList();
+                mutable_bitField0_ |= 0x00000010;
+              }
+              additionalbetas_.add(input.readBytes());
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -9733,6 +9803,12 @@ private Ballot(
         throw new com.google.protobuf.InvalidProtocolBufferException(
             e).setUnfinishedMessage(this);
       } finally {
+        if (((mutable_bitField0_ & 0x00000008) != 0)) {
+          additionalalphas_ = java.util.Collections.unmodifiableList(additionalalphas_); // C
+        }
+        if (((mutable_bitField0_ & 0x00000010) != 0)) {
+          additionalbetas_ = java.util.Collections.unmodifiableList(additionalbetas_); // C
+        }
         this.unknownFields = unknownFields.build();
         makeExtensionsImmutable();
       }
@@ -9824,6 +9900,78 @@ public com.google.protobuf.ByteString getBeta() {
       return beta_;
     }
 
+    public static final int ADDITIONALALPHAS_FIELD_NUMBER = 4;
+    private java.util.List additionalalphas_;
+    /**
+     * 
+     * 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.
+     * 
+ * + * repeated bytes additionalalphas = 4; + * @return A list containing the additionalalphas. + */ + @java.lang.Override + public java.util.List + getAdditionalalphasList() { + return additionalalphas_; + } + /** + *
+     * 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.
+     * 
+ * + * repeated bytes additionalalphas = 4; + * @return The count of additionalalphas. + */ + public int getAdditionalalphasCount() { + return additionalalphas_.size(); + } + /** + *
+     * 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.
+     * 
+ * + * repeated bytes additionalalphas = 4; + * @param index The index of the element to return. + * @return The additionalalphas at the given index. + */ + public com.google.protobuf.ByteString getAdditionalalphas(int index) { + return additionalalphas_.get(index); + } + + public static final int ADDITIONALBETAS_FIELD_NUMBER = 5; + private java.util.List additionalbetas_; + /** + * repeated bytes additionalbetas = 5; + * @return A list containing the additionalbetas. + */ + @java.lang.Override + public java.util.List + getAdditionalbetasList() { + return additionalbetas_; + } + /** + * repeated bytes additionalbetas = 5; + * @return The count of additionalbetas. + */ + public int getAdditionalbetasCount() { + return additionalbetas_.size(); + } + /** + * repeated bytes additionalbetas = 5; + * @param index The index of the element to return. + * @return The additionalbetas at the given index. + */ + public com.google.protobuf.ByteString getAdditionalbetas(int index) { + return additionalbetas_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -9859,6 +10007,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { output.writeBytes(3, beta_); } + for (int i = 0; i < additionalalphas_.size(); i++) { + output.writeBytes(4, additionalalphas_.get(i)); + } + for (int i = 0; i < additionalbetas_.size(); i++) { + output.writeBytes(5, additionalbetas_.get(i)); + } unknownFields.writeTo(output); } @@ -9880,6 +10034,24 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, beta_); } + { + int dataSize = 0; + for (int i = 0; i < additionalalphas_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(additionalalphas_.get(i)); + } + size += dataSize; + size += 1 * getAdditionalalphasList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < additionalbetas_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(additionalbetas_.get(i)); + } + size += dataSize; + size += 1 * getAdditionalbetasList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -9910,6 +10082,10 @@ public boolean equals(final java.lang.Object obj) { if (!getBeta() .equals(other.getBeta())) return false; } + if (!getAdditionalalphasList() + .equals(other.getAdditionalalphasList())) return false; + if (!getAdditionalbetasList() + .equals(other.getAdditionalbetasList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -9933,6 +10109,14 @@ public int hashCode() { hash = (37 * hash) + BETA_FIELD_NUMBER; hash = (53 * hash) + getBeta().hashCode(); } + if (getAdditionalalphasCount() > 0) { + hash = (37 * hash) + ADDITIONALALPHAS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalalphasList().hashCode(); + } + if (getAdditionalbetasCount() > 0) { + hash = (37 * hash) + ADDITIONALBETAS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalbetasList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -10076,6 +10260,10 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000002); beta_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000004); + additionalalphas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + additionalbetas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); return this; } @@ -10116,6 +10304,16 @@ public ch.epfl.dedis.lib.proto.Evoting.Ballot buildPartial() { to_bitField0_ |= 0x00000004; } result.beta_ = beta_; + if (((bitField0_ & 0x00000008) != 0)) { + additionalalphas_ = java.util.Collections.unmodifiableList(additionalalphas_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.additionalalphas_ = additionalalphas_; + if (((bitField0_ & 0x00000010) != 0)) { + additionalbetas_ = java.util.Collections.unmodifiableList(additionalbetas_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.additionalbetas_ = additionalbetas_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -10174,6 +10372,26 @@ public Builder mergeFrom(ch.epfl.dedis.lib.proto.Evoting.Ballot other) { if (other.hasBeta()) { setBeta(other.getBeta()); } + if (!other.additionalalphas_.isEmpty()) { + if (additionalalphas_.isEmpty()) { + additionalalphas_ = other.additionalalphas_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAdditionalalphasIsMutable(); + additionalalphas_.addAll(other.additionalalphas_); + } + onChanged(); + } + if (!other.additionalbetas_.isEmpty()) { + if (additionalbetas_.isEmpty()) { + additionalbetas_ = other.additionalbetas_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureAdditionalbetasIsMutable(); + additionalbetas_.addAll(other.additionalbetas_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -10367,6 +10585,218 @@ public Builder clearBeta() { onChanged(); return this; } + + private java.util.List additionalalphas_ = java.util.Collections.emptyList(); + private void ensureAdditionalalphasIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + additionalalphas_ = new java.util.ArrayList(additionalalphas_); + bitField0_ |= 0x00000008; + } + } + /** + *
+       * 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.
+       * 
+ * + * repeated bytes additionalalphas = 4; + * @return A list containing the additionalalphas. + */ + public java.util.List + getAdditionalalphasList() { + return ((bitField0_ & 0x00000008) != 0) ? + java.util.Collections.unmodifiableList(additionalalphas_) : additionalalphas_; + } + /** + *
+       * 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.
+       * 
+ * + * repeated bytes additionalalphas = 4; + * @return The count of additionalalphas. + */ + public int getAdditionalalphasCount() { + return additionalalphas_.size(); + } + /** + *
+       * 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.
+       * 
+ * + * repeated bytes additionalalphas = 4; + * @param index The index of the element to return. + * @return The additionalalphas at the given index. + */ + public com.google.protobuf.ByteString getAdditionalalphas(int index) { + return additionalalphas_.get(index); + } + /** + *
+       * 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.
+       * 
+ * + * repeated bytes additionalalphas = 4; + * @param index The index to set the value at. + * @param value The additionalalphas to set. + * @return This builder for chaining. + */ + public Builder setAdditionalalphas( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalalphasIsMutable(); + additionalalphas_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * 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.
+       * 
+ * + * repeated bytes additionalalphas = 4; + * @param value The additionalalphas to add. + * @return This builder for chaining. + */ + public Builder addAdditionalalphas(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalalphasIsMutable(); + additionalalphas_.add(value); + onChanged(); + return this; + } + /** + *
+       * 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.
+       * 
+ * + * repeated bytes additionalalphas = 4; + * @param values The additionalalphas to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalalphas( + java.lang.Iterable values) { + ensureAdditionalalphasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalalphas_); + onChanged(); + return this; + } + /** + *
+       * 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.
+       * 
+ * + * repeated bytes additionalalphas = 4; + * @return This builder for chaining. + */ + public Builder clearAdditionalalphas() { + additionalalphas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + private java.util.List additionalbetas_ = java.util.Collections.emptyList(); + private void ensureAdditionalbetasIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + additionalbetas_ = new java.util.ArrayList(additionalbetas_); + bitField0_ |= 0x00000010; + } + } + /** + * repeated bytes additionalbetas = 5; + * @return A list containing the additionalbetas. + */ + public java.util.List + getAdditionalbetasList() { + return ((bitField0_ & 0x00000010) != 0) ? + java.util.Collections.unmodifiableList(additionalbetas_) : additionalbetas_; + } + /** + * repeated bytes additionalbetas = 5; + * @return The count of additionalbetas. + */ + public int getAdditionalbetasCount() { + return additionalbetas_.size(); + } + /** + * repeated bytes additionalbetas = 5; + * @param index The index of the element to return. + * @return The additionalbetas at the given index. + */ + public com.google.protobuf.ByteString getAdditionalbetas(int index) { + return additionalbetas_.get(index); + } + /** + * repeated bytes additionalbetas = 5; + * @param index The index to set the value at. + * @param value The additionalbetas to set. + * @return This builder for chaining. + */ + public Builder setAdditionalbetas( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalbetasIsMutable(); + additionalbetas_.set(index, value); + onChanged(); + return this; + } + /** + * repeated bytes additionalbetas = 5; + * @param value The additionalbetas to add. + * @return This builder for chaining. + */ + public Builder addAdditionalbetas(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalbetasIsMutable(); + additionalbetas_.add(value); + onChanged(); + return this; + } + /** + * repeated bytes additionalbetas = 5; + * @param values The additionalbetas to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalbetas( + java.lang.Iterable values) { + ensureAdditionalbetasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalbetas_); + onChanged(); + return this; + } + /** + * repeated bytes additionalbetas = 5; + * @return This builder for chaining. + */ + public Builder clearAdditionalbetas() { + additionalbetas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -11843,6 +12273,60 @@ public interface PartialOrBuilder extends * @return The signature. */ com.google.protobuf.ByteString getSignature(); + + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + java.util.List + getAdditionalpointsList(); + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional getAdditionalpoints(int index); + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + int getAdditionalpointsCount(); + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + java.util.List + getAdditionalpointsOrBuilderList(); + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + ch.epfl.dedis.lib.proto.Evoting.PartialAdditionalOrBuilder getAdditionalpointsOrBuilder( + int index); } /** *
@@ -11864,6 +12348,7 @@ private Partial() {
       points_ = java.util.Collections.emptyList();
       nodeid_ = com.google.protobuf.ByteString.EMPTY;
       signature_ = com.google.protobuf.ByteString.EMPTY;
+      additionalpoints_ = java.util.Collections.emptyList();
     }
 
     @java.lang.Override
@@ -11915,6 +12400,15 @@ private Partial(
               signature_ = input.readBytes();
               break;
             }
+            case 34: {
+              if (!((mutable_bitField0_ & 0x00000008) != 0)) {
+                additionalpoints_ = new java.util.ArrayList();
+                mutable_bitField0_ |= 0x00000008;
+              }
+              additionalpoints_.add(
+                  input.readMessage(ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.parser(), extensionRegistry));
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -11933,6 +12427,9 @@ private Partial(
         if (((mutable_bitField0_ & 0x00000001) != 0)) {
           points_ = java.util.Collections.unmodifiableList(points_); // C
         }
+        if (((mutable_bitField0_ & 0x00000008) != 0)) {
+          additionalpoints_ = java.util.Collections.unmodifiableList(additionalpoints_);
+        }
         this.unknownFields = unknownFields.build();
         makeExtensionsImmutable();
       }
@@ -12044,7 +12541,77 @@ public com.google.protobuf.ByteString getSignature() {
       return signature_;
     }
 
-    private byte memoizedIsInitialized = -1;
+    public static final int ADDITIONALPOINTS_FIELD_NUMBER = 4;
+    private java.util.List additionalpoints_;
+    /**
+     * 
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + @java.lang.Override + public java.util.List getAdditionalpointsList() { + return additionalpoints_; + } + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + @java.lang.Override + public java.util.List + getAdditionalpointsOrBuilderList() { + return additionalpoints_; + } + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + @java.lang.Override + public int getAdditionalpointsCount() { + return additionalpoints_.size(); + } + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + @java.lang.Override + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional getAdditionalpoints(int index) { + return additionalpoints_.get(index); + } + /** + *
+     * Additional points from decrypted plaintexts.
+     * To keep backward-compatibility in the resulting protobuf,
+     * these points are added at the end of the structure.
+     * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + @java.lang.Override + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditionalOrBuilder getAdditionalpointsOrBuilder( + int index) { + return additionalpoints_.get(index); + } + + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; @@ -12075,6 +12642,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000002) != 0)) { output.writeBytes(3, signature_); } + for (int i = 0; i < additionalpoints_.size(); i++) { + output.writeMessage(4, additionalpoints_.get(i)); + } unknownFields.writeTo(output); } @@ -12101,6 +12671,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, signature_); } + for (int i = 0; i < additionalpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, additionalpoints_.get(i)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -12128,6 +12702,8 @@ public boolean equals(final java.lang.Object obj) { if (!getSignature() .equals(other.getSignature())) return false; } + if (!getAdditionalpointsList() + .equals(other.getAdditionalpointsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -12151,6 +12727,10 @@ public int hashCode() { hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; hash = (53 * hash) + getSignature().hashCode(); } + if (getAdditionalpointsCount() > 0) { + hash = (37 * hash) + ADDITIONALPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalpointsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -12283,6 +12863,7 @@ private Builder( private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getAdditionalpointsFieldBuilder(); } } @java.lang.Override @@ -12294,6 +12875,12 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000002); signature_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000004); + if (additionalpointsBuilder_ == null) { + additionalpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + additionalpointsBuilder_.clear(); + } return this; } @@ -12335,6 +12922,15 @@ public ch.epfl.dedis.lib.proto.Evoting.Partial buildPartial() { to_bitField0_ |= 0x00000002; } result.signature_ = signature_; + if (additionalpointsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + additionalpoints_ = java.util.Collections.unmodifiableList(additionalpoints_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.additionalpoints_ = additionalpoints_; + } else { + result.additionalpoints_ = additionalpointsBuilder_.build(); + } result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -12400,6 +12996,32 @@ public Builder mergeFrom(ch.epfl.dedis.lib.proto.Evoting.Partial other) { if (other.hasSignature()) { setSignature(other.getSignature()); } + if (additionalpointsBuilder_ == null) { + if (!other.additionalpoints_.isEmpty()) { + if (additionalpoints_.isEmpty()) { + additionalpoints_ = other.additionalpoints_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAdditionalpointsIsMutable(); + additionalpoints_.addAll(other.additionalpoints_); + } + onChanged(); + } + } else { + if (!other.additionalpoints_.isEmpty()) { + if (additionalpointsBuilder_.isEmpty()) { + additionalpointsBuilder_.dispose(); + additionalpointsBuilder_ = null; + additionalpoints_ = other.additionalpoints_; + bitField0_ = (bitField0_ & ~0x00000008); + additionalpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAdditionalpointsFieldBuilder() : null; + } else { + additionalpointsBuilder_.addAllMessages(other.additionalpoints_); + } + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -12664,6 +13286,354 @@ public Builder clearSignature() { onChanged(); return this; } + + private java.util.List additionalpoints_ = + java.util.Collections.emptyList(); + private void ensureAdditionalpointsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + additionalpoints_ = new java.util.ArrayList(additionalpoints_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder, ch.epfl.dedis.lib.proto.Evoting.PartialAdditionalOrBuilder> additionalpointsBuilder_; + + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public java.util.List getAdditionalpointsList() { + if (additionalpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalpoints_); + } else { + return additionalpointsBuilder_.getMessageList(); + } + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public int getAdditionalpointsCount() { + if (additionalpointsBuilder_ == null) { + return additionalpoints_.size(); + } else { + return additionalpointsBuilder_.getCount(); + } + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional getAdditionalpoints(int index) { + if (additionalpointsBuilder_ == null) { + return additionalpoints_.get(index); + } else { + return additionalpointsBuilder_.getMessage(index); + } + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder setAdditionalpoints( + int index, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional value) { + if (additionalpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.set(index, value); + onChanged(); + } else { + additionalpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder setAdditionalpoints( + int index, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder builderForValue) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + additionalpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder addAdditionalpoints(ch.epfl.dedis.lib.proto.Evoting.PartialAdditional value) { + if (additionalpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(value); + onChanged(); + } else { + additionalpointsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder addAdditionalpoints( + int index, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional value) { + if (additionalpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(index, value); + onChanged(); + } else { + additionalpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder addAdditionalpoints( + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder builderForValue) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(builderForValue.build()); + onChanged(); + } else { + additionalpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder addAdditionalpoints( + int index, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder builderForValue) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder addAllAdditionalpoints( + java.lang.Iterable values) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalpoints_); + onChanged(); + } else { + additionalpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder clearAdditionalpoints() { + if (additionalpointsBuilder_ == null) { + additionalpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + additionalpointsBuilder_.clear(); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public Builder removeAdditionalpoints(int index) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + additionalpoints_.remove(index); + onChanged(); + } else { + additionalpointsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder getAdditionalpointsBuilder( + int index) { + return getAdditionalpointsFieldBuilder().getBuilder(index); + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditionalOrBuilder getAdditionalpointsOrBuilder( + int index) { + if (additionalpointsBuilder_ == null) { + return additionalpoints_.get(index); } else { + return additionalpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public java.util.List + getAdditionalpointsOrBuilderList() { + if (additionalpointsBuilder_ != null) { + return additionalpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalpoints_); + } + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder addAdditionalpointsBuilder() { + return getAdditionalpointsFieldBuilder().addBuilder( + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.getDefaultInstance()); + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder addAdditionalpointsBuilder( + int index) { + return getAdditionalpointsFieldBuilder().addBuilder( + index, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.getDefaultInstance()); + } + /** + *
+       * Additional points from decrypted plaintexts.
+       * To keep backward-compatibility in the resulting protobuf,
+       * these points are added at the end of the structure.
+       * 
+ * + * repeated .evoting.PartialAdditional additionalpoints = 4; + */ + public java.util.List + getAdditionalpointsBuilderList() { + return getAdditionalpointsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder, ch.epfl.dedis.lib.proto.Evoting.PartialAdditionalOrBuilder> + getAdditionalpointsFieldBuilder() { + if (additionalpointsBuilder_ == null) { + additionalpointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder, ch.epfl.dedis.lib.proto.Evoting.PartialAdditionalOrBuilder>( + additionalpoints_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + additionalpoints_ = null; + } + return additionalpointsBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -12717,31 +13687,688 @@ public ch.epfl.dedis.lib.proto.Evoting.Partial getDefaultInstanceForType() { } - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_evoting_Transaction_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_evoting_Transaction_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_evoting_Master_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_evoting_Master_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_evoting_Link_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_evoting_Link_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_evoting_Election_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_evoting_Election_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_evoting_Election_NameEntry_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_evoting_Election_NameEntry_fieldAccessorTable; + public interface PartialAdditionalOrBuilder extends + // @@protoc_insertion_point(interface_extends:evoting.PartialAdditional) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * All additional points from a single voter.
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @return A list containing the additionalpoints. + */ + java.util.List getAdditionalpointsList(); + /** + *
+     * All additional points from a single voter.
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @return The count of additionalpoints. + */ + int getAdditionalpointsCount(); + /** + *
+     * All additional points from a single voter.
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @param index The index of the element to return. + * @return The additionalpoints at the given index. + */ + com.google.protobuf.ByteString getAdditionalpoints(int index); + } + /** + *
+   * PartialAdditional is used because protobuf cannot handle array of array of bytes.
+   * 
+ * + * Protobuf type {@code evoting.PartialAdditional} + */ + public static final class PartialAdditional extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:evoting.PartialAdditional) + PartialAdditionalOrBuilder { + private static final long serialVersionUID = 0L; + // Use PartialAdditional.newBuilder() to construct. + private PartialAdditional(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PartialAdditional() { + additionalpoints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PartialAdditional(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PartialAdditional( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + additionalpoints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + additionalpoints_.add(input.readBytes()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + additionalpoints_ = java.util.Collections.unmodifiableList(additionalpoints_); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.Evoting.internal_static_evoting_PartialAdditional_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.Evoting.internal_static_evoting_PartialAdditional_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.class, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder.class); + } + + public static final int ADDITIONALPOINTS_FIELD_NUMBER = 1; + private java.util.List additionalpoints_; + /** + *
+     * All additional points from a single voter.
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @return A list containing the additionalpoints. + */ + @java.lang.Override + public java.util.List + getAdditionalpointsList() { + return additionalpoints_; + } + /** + *
+     * All additional points from a single voter.
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @return The count of additionalpoints. + */ + public int getAdditionalpointsCount() { + return additionalpoints_.size(); + } + /** + *
+     * All additional points from a single voter.
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @param index The index of the element to return. + * @return The additionalpoints at the given index. + */ + public com.google.protobuf.ByteString getAdditionalpoints(int index) { + return additionalpoints_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < additionalpoints_.size(); i++) { + output.writeBytes(1, additionalpoints_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < additionalpoints_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(additionalpoints_.get(i)); + } + size += dataSize; + size += 1 * getAdditionalpointsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ch.epfl.dedis.lib.proto.Evoting.PartialAdditional)) { + return super.equals(obj); + } + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional other = (ch.epfl.dedis.lib.proto.Evoting.PartialAdditional) obj; + + if (!getAdditionalpointsList() + .equals(other.getAdditionalpointsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAdditionalpointsCount() > 0) { + hash = (37 * hash) + ADDITIONALPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalpointsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ch.epfl.dedis.lib.proto.Evoting.PartialAdditional prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * PartialAdditional is used because protobuf cannot handle array of array of bytes.
+     * 
+ * + * Protobuf type {@code evoting.PartialAdditional} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:evoting.PartialAdditional) + ch.epfl.dedis.lib.proto.Evoting.PartialAdditionalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.Evoting.internal_static_evoting_PartialAdditional_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.Evoting.internal_static_evoting_PartialAdditional_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.class, ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.Builder.class); + } + + // Construct using ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + additionalpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return ch.epfl.dedis.lib.proto.Evoting.internal_static_evoting_PartialAdditional_descriptor; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional getDefaultInstanceForType() { + return ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.getDefaultInstance(); + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional build() { + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional buildPartial() { + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional result = new ch.epfl.dedis.lib.proto.Evoting.PartialAdditional(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + additionalpoints_ = java.util.Collections.unmodifiableList(additionalpoints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.additionalpoints_ = additionalpoints_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof ch.epfl.dedis.lib.proto.Evoting.PartialAdditional) { + return mergeFrom((ch.epfl.dedis.lib.proto.Evoting.PartialAdditional)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(ch.epfl.dedis.lib.proto.Evoting.PartialAdditional other) { + if (other == ch.epfl.dedis.lib.proto.Evoting.PartialAdditional.getDefaultInstance()) return this; + if (!other.additionalpoints_.isEmpty()) { + if (additionalpoints_.isEmpty()) { + additionalpoints_ = other.additionalpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAdditionalpointsIsMutable(); + additionalpoints_.addAll(other.additionalpoints_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + ch.epfl.dedis.lib.proto.Evoting.PartialAdditional parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (ch.epfl.dedis.lib.proto.Evoting.PartialAdditional) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List additionalpoints_ = java.util.Collections.emptyList(); + private void ensureAdditionalpointsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + additionalpoints_ = new java.util.ArrayList(additionalpoints_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * All additional points from a single voter.
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @return A list containing the additionalpoints. + */ + public java.util.List + getAdditionalpointsList() { + return ((bitField0_ & 0x00000001) != 0) ? + java.util.Collections.unmodifiableList(additionalpoints_) : additionalpoints_; + } + /** + *
+       * All additional points from a single voter.
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @return The count of additionalpoints. + */ + public int getAdditionalpointsCount() { + return additionalpoints_.size(); + } + /** + *
+       * All additional points from a single voter.
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @param index The index of the element to return. + * @return The additionalpoints at the given index. + */ + public com.google.protobuf.ByteString getAdditionalpoints(int index) { + return additionalpoints_.get(index); + } + /** + *
+       * All additional points from a single voter.
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @param index The index to set the value at. + * @param value The additionalpoints to set. + * @return This builder for chaining. + */ + public Builder setAdditionalpoints( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * All additional points from a single voter.
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @param value The additionalpoints to add. + * @return This builder for chaining. + */ + public Builder addAdditionalpoints(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(value); + onChanged(); + return this; + } + /** + *
+       * All additional points from a single voter.
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @param values The additionalpoints to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalpoints( + java.lang.Iterable values) { + ensureAdditionalpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalpoints_); + onChanged(); + return this; + } + /** + *
+       * All additional points from a single voter.
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @return This builder for chaining. + */ + public Builder clearAdditionalpoints() { + additionalpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:evoting.PartialAdditional) + } + + // @@protoc_insertion_point(class_scope:evoting.PartialAdditional) + private static final ch.epfl.dedis.lib.proto.Evoting.PartialAdditional DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ch.epfl.dedis.lib.proto.Evoting.PartialAdditional(); + } + + public static ch.epfl.dedis.lib.proto.Evoting.PartialAdditional getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartialAdditional parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PartialAdditional(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.Evoting.PartialAdditional getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_Transaction_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_Transaction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_Master_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_Master_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_Link_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_Link_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_Election_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_Election_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_Election_NameEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_Election_NameEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_evoting_Election_SubtitleEntry_descriptor; private static final @@ -12772,6 +14399,11 @@ public ch.epfl.dedis.lib.proto.Evoting.Partial getDefaultInstanceForType() { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_evoting_Partial_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_PartialAdditional_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_PartialAdditional_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -12808,13 +14440,16 @@ public ch.epfl.dedis.lib.proto.Evoting.Partial getDefaultInstanceForType() { "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"X\n\006Foote" + "r\022\014\n\004text\030\001 \002(\t\022\024\n\014contacttitle\030\002 \002(\t\022\024\n" + "\014contactphone\030\003 \002(\t\022\024\n\014contactemail\030\004 \002(" + - "\t\"3\n\006Ballot\022\014\n\004user\030\001 \002(\r\022\r\n\005alpha\030\002 \002(\014" + - "\022\014\n\004beta\030\003 \002(\014\"Y\n\003Mix\022 \n\007ballots\030\001 \003(\0132\017" + - ".evoting.Ballot\022\r\n\005proof\030\002 \002(\014\022\016\n\006nodeid" + - "\030\003 \002(\014\022\021\n\tsignature\030\004 \002(\014\"<\n\007Partial\022\016\n\006" + - "points\030\001 \003(\014\022\016\n\006nodeid\030\002 \002(\014\022\021\n\tsignatur" + - "e\030\003 \002(\014B\"\n\027ch.epfl.dedis.lib.protoB\007Evot" + - "ing" + "\t\"f\n\006Ballot\022\014\n\004user\030\001 \002(\r\022\r\n\005alpha\030\002 \002(\014" + + "\022\014\n\004beta\030\003 \002(\014\022\030\n\020additionalalphas\030\004 \003(\014" + + "\022\027\n\017additionalbetas\030\005 \003(\014\"Y\n\003Mix\022 \n\007ball" + + "ots\030\001 \003(\0132\017.evoting.Ballot\022\r\n\005proof\030\002 \002(" + + "\014\022\016\n\006nodeid\030\003 \002(\014\022\021\n\tsignature\030\004 \002(\014\"r\n\007" + + "Partial\022\016\n\006points\030\001 \003(\014\022\016\n\006nodeid\030\002 \002(\014\022" + + "\021\n\tsignature\030\003 \002(\014\0224\n\020additionalpoints\030\004" + + " \003(\0132\032.evoting.PartialAdditional\"-\n\021Part" + + "ialAdditional\022\030\n\020additionalpoints\030\001 \003(\014B" + + "\"\n\027ch.epfl.dedis.lib.protoB\007Evoting" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -12874,7 +14509,7 @@ public ch.epfl.dedis.lib.proto.Evoting.Partial getDefaultInstanceForType() { internal_static_evoting_Ballot_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_evoting_Ballot_descriptor, - new java.lang.String[] { "User", "Alpha", "Beta", }); + new java.lang.String[] { "User", "Alpha", "Beta", "Additionalalphas", "Additionalbetas", }); internal_static_evoting_Mix_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_evoting_Mix_fieldAccessorTable = new @@ -12886,7 +14521,13 @@ public ch.epfl.dedis.lib.proto.Evoting.Partial getDefaultInstanceForType() { internal_static_evoting_Partial_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_evoting_Partial_descriptor, - new java.lang.String[] { "Points", "Nodeid", "Signature", }); + new java.lang.String[] { "Points", "Nodeid", "Signature", "Additionalpoints", }); + internal_static_evoting_PartialAdditional_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_evoting_PartialAdditional_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_evoting_PartialAdditional_descriptor, + new java.lang.String[] { "Additionalpoints", }); ch.epfl.dedis.lib.proto.OnetProto.getDescriptor(); } diff --git a/external/java/src/main/java/ch/epfl/dedis/lib/proto/EvotingAPI.java b/external/java/src/main/java/ch/epfl/dedis/lib/proto/EvotingAPI.java new file mode 100644 index 0000000000..2cb5f28c64 --- /dev/null +++ b/external/java/src/main/java/ch/epfl/dedis/lib/proto/EvotingAPI.java @@ -0,0 +1,3027 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: evoting_api.proto + +package ch.epfl.dedis.lib.proto; + +public final class EvotingAPI { + private EvotingAPI() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ReconstructOrBuilder extends + // @@protoc_insertion_point(interface_extends:evoting_api.Reconstruct) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * ID of the election skipchain.
+     * 
+ * + * required bytes id = 1; + * @return Whether the id field is set. + */ + boolean hasId(); + /** + *
+     * ID of the election skipchain.
+     * 
+ * + * required bytes id = 1; + * @return The id. + */ + com.google.protobuf.ByteString getId(); + } + /** + *
+   * Reconstruct message.
+   * 
+ * + * Protobuf type {@code evoting_api.Reconstruct} + */ + public static final class Reconstruct extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:evoting_api.Reconstruct) + ReconstructOrBuilder { + private static final long serialVersionUID = 0L; + // Use Reconstruct.newBuilder() to construct. + private Reconstruct(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Reconstruct() { + id_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Reconstruct(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Reconstruct( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + bitField0_ |= 0x00000001; + id_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Reconstruct_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Reconstruct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct.class, ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString id_; + /** + *
+     * ID of the election skipchain.
+     * 
+ * + * required bytes id = 1; + * @return Whether the id field is set. + */ + @java.lang.Override + public boolean hasId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * ID of the election skipchain.
+     * 
+ * + * required bytes id = 1; + * @return The id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getId() { + return id_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBytes(1, id_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, id_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct)) { + return super.equals(obj); + } + ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct other = (ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct) obj; + + if (hasId() != other.hasId()) return false; + if (hasId()) { + if (!getId() + .equals(other.getId())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasId()) { + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Reconstruct message.
+     * 
+ * + * Protobuf type {@code evoting_api.Reconstruct} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:evoting_api.Reconstruct) + ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Reconstruct_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Reconstruct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct.class, ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct.Builder.class); + } + + // Construct using ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Reconstruct_descriptor; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct getDefaultInstanceForType() { + return ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct.getDefaultInstance(); + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct build() { + ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct buildPartial() { + ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct result = new ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct) { + return mergeFrom((ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct other) { + if (other == ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasId()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString id_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * ID of the election skipchain.
+       * 
+ * + * required bytes id = 1; + * @return Whether the id field is set. + */ + @java.lang.Override + public boolean hasId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+       * ID of the election skipchain.
+       * 
+ * + * required bytes id = 1; + * @return The id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getId() { + return id_; + } + /** + *
+       * ID of the election skipchain.
+       * 
+ * + * required bytes id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + id_ = value; + onChanged(); + return this; + } + /** + *
+       * ID of the election skipchain.
+       * 
+ * + * required bytes id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:evoting_api.Reconstruct) + } + + // @@protoc_insertion_point(class_scope:evoting_api.Reconstruct) + private static final ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct(); + } + + public static ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reconstruct parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Reconstruct(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.Reconstruct getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ReconstructReplyOrBuilder extends + // @@protoc_insertion_point(interface_extends:evoting_api.ReconstructReply) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Points are the decrypted plaintexts.
+     * 
+ * + * repeated bytes points = 1; + * @return A list containing the points. + */ + java.util.List getPointsList(); + /** + *
+     * Points are the decrypted plaintexts.
+     * 
+ * + * repeated bytes points = 1; + * @return The count of points. + */ + int getPointsCount(); + /** + *
+     * Points are the decrypted plaintexts.
+     * 
+ * + * repeated bytes points = 1; + * @param index The index of the element to return. + * @return The points at the given index. + */ + com.google.protobuf.ByteString getPoints(int index); + + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + java.util.List + getAdditionalpointsList(); + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints getAdditionalpoints(int index); + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + int getAdditionalpointsCount(); + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + java.util.List + getAdditionalpointsOrBuilderList(); + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + ch.epfl.dedis.lib.proto.EvotingAPI.AddPointsOrBuilder getAdditionalpointsOrBuilder( + int index); + } + /** + *
+   * ReconstructReply message.
+   * 
+ * + * Protobuf type {@code evoting_api.ReconstructReply} + */ + public static final class ReconstructReply extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:evoting_api.ReconstructReply) + ReconstructReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReconstructReply.newBuilder() to construct. + private ReconstructReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ReconstructReply() { + points_ = java.util.Collections.emptyList(); + additionalpoints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ReconstructReply(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ReconstructReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + points_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + points_.add(input.readBytes()); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + additionalpoints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + additionalpoints_.add( + input.readMessage(ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + points_ = java.util.Collections.unmodifiableList(points_); // C + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + additionalpoints_ = java.util.Collections.unmodifiableList(additionalpoints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_ReconstructReply_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_ReconstructReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply.class, ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply.Builder.class); + } + + public static final int POINTS_FIELD_NUMBER = 1; + private java.util.List points_; + /** + *
+     * Points are the decrypted plaintexts.
+     * 
+ * + * repeated bytes points = 1; + * @return A list containing the points. + */ + @java.lang.Override + public java.util.List + getPointsList() { + return points_; + } + /** + *
+     * Points are the decrypted plaintexts.
+     * 
+ * + * repeated bytes points = 1; + * @return The count of points. + */ + public int getPointsCount() { + return points_.size(); + } + /** + *
+     * Points are the decrypted plaintexts.
+     * 
+ * + * repeated bytes points = 1; + * @param index The index of the element to return. + * @return The points at the given index. + */ + public com.google.protobuf.ByteString getPoints(int index) { + return points_.get(index); + } + + public static final int ADDITIONALPOINTS_FIELD_NUMBER = 2; + private java.util.List additionalpoints_; + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + @java.lang.Override + public java.util.List getAdditionalpointsList() { + return additionalpoints_; + } + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + @java.lang.Override + public java.util.List + getAdditionalpointsOrBuilderList() { + return additionalpoints_; + } + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + @java.lang.Override + public int getAdditionalpointsCount() { + return additionalpoints_.size(); + } + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints getAdditionalpoints(int index) { + return additionalpoints_.get(index); + } + /** + *
+     * Eventual additional points - only if more than 9 candidates
+     * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPointsOrBuilder getAdditionalpointsOrBuilder( + int index) { + return additionalpoints_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < points_.size(); i++) { + output.writeBytes(1, points_.get(i)); + } + for (int i = 0; i < additionalpoints_.size(); i++) { + output.writeMessage(2, additionalpoints_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < points_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(points_.get(i)); + } + size += dataSize; + size += 1 * getPointsList().size(); + } + for (int i = 0; i < additionalpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, additionalpoints_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply)) { + return super.equals(obj); + } + ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply other = (ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply) obj; + + if (!getPointsList() + .equals(other.getPointsList())) return false; + if (!getAdditionalpointsList() + .equals(other.getAdditionalpointsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPointsCount() > 0) { + hash = (37 * hash) + POINTS_FIELD_NUMBER; + hash = (53 * hash) + getPointsList().hashCode(); + } + if (getAdditionalpointsCount() > 0) { + hash = (37 * hash) + ADDITIONALPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalpointsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * ReconstructReply message.
+     * 
+ * + * Protobuf type {@code evoting_api.ReconstructReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:evoting_api.ReconstructReply) + ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_ReconstructReply_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_ReconstructReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply.class, ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply.Builder.class); + } + + // Construct using ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAdditionalpointsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + points_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (additionalpointsBuilder_ == null) { + additionalpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + additionalpointsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_ReconstructReply_descriptor; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply getDefaultInstanceForType() { + return ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply.getDefaultInstance(); + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply build() { + ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply buildPartial() { + ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply result = new ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + points_ = java.util.Collections.unmodifiableList(points_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.points_ = points_; + if (additionalpointsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + additionalpoints_ = java.util.Collections.unmodifiableList(additionalpoints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.additionalpoints_ = additionalpoints_; + } else { + result.additionalpoints_ = additionalpointsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply) { + return mergeFrom((ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply other) { + if (other == ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply.getDefaultInstance()) return this; + if (!other.points_.isEmpty()) { + if (points_.isEmpty()) { + points_ = other.points_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePointsIsMutable(); + points_.addAll(other.points_); + } + onChanged(); + } + if (additionalpointsBuilder_ == null) { + if (!other.additionalpoints_.isEmpty()) { + if (additionalpoints_.isEmpty()) { + additionalpoints_ = other.additionalpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAdditionalpointsIsMutable(); + additionalpoints_.addAll(other.additionalpoints_); + } + onChanged(); + } + } else { + if (!other.additionalpoints_.isEmpty()) { + if (additionalpointsBuilder_.isEmpty()) { + additionalpointsBuilder_.dispose(); + additionalpointsBuilder_ = null; + additionalpoints_ = other.additionalpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + additionalpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAdditionalpointsFieldBuilder() : null; + } else { + additionalpointsBuilder_.addAllMessages(other.additionalpoints_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List points_ = java.util.Collections.emptyList(); + private void ensurePointsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + points_ = new java.util.ArrayList(points_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * Points are the decrypted plaintexts.
+       * 
+ * + * repeated bytes points = 1; + * @return A list containing the points. + */ + public java.util.List + getPointsList() { + return ((bitField0_ & 0x00000001) != 0) ? + java.util.Collections.unmodifiableList(points_) : points_; + } + /** + *
+       * Points are the decrypted plaintexts.
+       * 
+ * + * repeated bytes points = 1; + * @return The count of points. + */ + public int getPointsCount() { + return points_.size(); + } + /** + *
+       * Points are the decrypted plaintexts.
+       * 
+ * + * repeated bytes points = 1; + * @param index The index of the element to return. + * @return The points at the given index. + */ + public com.google.protobuf.ByteString getPoints(int index) { + return points_.get(index); + } + /** + *
+       * Points are the decrypted plaintexts.
+       * 
+ * + * repeated bytes points = 1; + * @param index The index to set the value at. + * @param value The points to set. + * @return This builder for chaining. + */ + public Builder setPoints( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePointsIsMutable(); + points_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * Points are the decrypted plaintexts.
+       * 
+ * + * repeated bytes points = 1; + * @param value The points to add. + * @return This builder for chaining. + */ + public Builder addPoints(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePointsIsMutable(); + points_.add(value); + onChanged(); + return this; + } + /** + *
+       * Points are the decrypted plaintexts.
+       * 
+ * + * repeated bytes points = 1; + * @param values The points to add. + * @return This builder for chaining. + */ + public Builder addAllPoints( + java.lang.Iterable values) { + ensurePointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, points_); + onChanged(); + return this; + } + /** + *
+       * Points are the decrypted plaintexts.
+       * 
+ * + * repeated bytes points = 1; + * @return This builder for chaining. + */ + public Builder clearPoints() { + points_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private java.util.List additionalpoints_ = + java.util.Collections.emptyList(); + private void ensureAdditionalpointsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + additionalpoints_ = new java.util.ArrayList(additionalpoints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder, ch.epfl.dedis.lib.proto.EvotingAPI.AddPointsOrBuilder> additionalpointsBuilder_; + + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public java.util.List getAdditionalpointsList() { + if (additionalpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalpoints_); + } else { + return additionalpointsBuilder_.getMessageList(); + } + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public int getAdditionalpointsCount() { + if (additionalpointsBuilder_ == null) { + return additionalpoints_.size(); + } else { + return additionalpointsBuilder_.getCount(); + } + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints getAdditionalpoints(int index) { + if (additionalpointsBuilder_ == null) { + return additionalpoints_.get(index); + } else { + return additionalpointsBuilder_.getMessage(index); + } + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder setAdditionalpoints( + int index, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints value) { + if (additionalpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.set(index, value); + onChanged(); + } else { + additionalpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder setAdditionalpoints( + int index, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder builderForValue) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + additionalpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder addAdditionalpoints(ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints value) { + if (additionalpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(value); + onChanged(); + } else { + additionalpointsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder addAdditionalpoints( + int index, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints value) { + if (additionalpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(index, value); + onChanged(); + } else { + additionalpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder addAdditionalpoints( + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder builderForValue) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(builderForValue.build()); + onChanged(); + } else { + additionalpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder addAdditionalpoints( + int index, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder builderForValue) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder addAllAdditionalpoints( + java.lang.Iterable values) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalpoints_); + onChanged(); + } else { + additionalpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder clearAdditionalpoints() { + if (additionalpointsBuilder_ == null) { + additionalpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + additionalpointsBuilder_.clear(); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public Builder removeAdditionalpoints(int index) { + if (additionalpointsBuilder_ == null) { + ensureAdditionalpointsIsMutable(); + additionalpoints_.remove(index); + onChanged(); + } else { + additionalpointsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder getAdditionalpointsBuilder( + int index) { + return getAdditionalpointsFieldBuilder().getBuilder(index); + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPointsOrBuilder getAdditionalpointsOrBuilder( + int index) { + if (additionalpointsBuilder_ == null) { + return additionalpoints_.get(index); } else { + return additionalpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public java.util.List + getAdditionalpointsOrBuilderList() { + if (additionalpointsBuilder_ != null) { + return additionalpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalpoints_); + } + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder addAdditionalpointsBuilder() { + return getAdditionalpointsFieldBuilder().addBuilder( + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.getDefaultInstance()); + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder addAdditionalpointsBuilder( + int index) { + return getAdditionalpointsFieldBuilder().addBuilder( + index, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.getDefaultInstance()); + } + /** + *
+       * Eventual additional points - only if more than 9 candidates
+       * 
+ * + * repeated .evoting_api.AddPoints additionalpoints = 2; + */ + public java.util.List + getAdditionalpointsBuilderList() { + return getAdditionalpointsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder, ch.epfl.dedis.lib.proto.EvotingAPI.AddPointsOrBuilder> + getAdditionalpointsFieldBuilder() { + if (additionalpointsBuilder_ == null) { + additionalpointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder, ch.epfl.dedis.lib.proto.EvotingAPI.AddPointsOrBuilder>( + additionalpoints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + additionalpoints_ = null; + } + return additionalpointsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:evoting_api.ReconstructReply) + } + + // @@protoc_insertion_point(class_scope:evoting_api.ReconstructReply) + private static final ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply(); + } + + public static ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReconstructReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReconstructReply(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.ReconstructReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AddPointsOrBuilder extends + // @@protoc_insertion_point(interface_extends:evoting_api.AddPoints) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The additional Points
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @return A list containing the additionalpoints. + */ + java.util.List getAdditionalpointsList(); + /** + *
+     * The additional Points
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @return The count of additionalpoints. + */ + int getAdditionalpointsCount(); + /** + *
+     * The additional Points
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @param index The index of the element to return. + * @return The additionalpoints at the given index. + */ + com.google.protobuf.ByteString getAdditionalpoints(int index); + } + /** + *
+   * AddPoints if maxChoices > 9
+   * 
+ * + * Protobuf type {@code evoting_api.AddPoints} + */ + public static final class AddPoints extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:evoting_api.AddPoints) + AddPointsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AddPoints.newBuilder() to construct. + private AddPoints(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AddPoints() { + additionalpoints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AddPoints(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AddPoints( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + additionalpoints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + additionalpoints_.add(input.readBytes()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + additionalpoints_ = java.util.Collections.unmodifiableList(additionalpoints_); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_AddPoints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_AddPoints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.class, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder.class); + } + + public static final int ADDITIONALPOINTS_FIELD_NUMBER = 1; + private java.util.List additionalpoints_; + /** + *
+     * The additional Points
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @return A list containing the additionalpoints. + */ + @java.lang.Override + public java.util.List + getAdditionalpointsList() { + return additionalpoints_; + } + /** + *
+     * The additional Points
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @return The count of additionalpoints. + */ + public int getAdditionalpointsCount() { + return additionalpoints_.size(); + } + /** + *
+     * The additional Points
+     * 
+ * + * repeated bytes additionalpoints = 1; + * @param index The index of the element to return. + * @return The additionalpoints at the given index. + */ + public com.google.protobuf.ByteString getAdditionalpoints(int index) { + return additionalpoints_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < additionalpoints_.size(); i++) { + output.writeBytes(1, additionalpoints_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < additionalpoints_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(additionalpoints_.get(i)); + } + size += dataSize; + size += 1 * getAdditionalpointsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints)) { + return super.equals(obj); + } + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints other = (ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints) obj; + + if (!getAdditionalpointsList() + .equals(other.getAdditionalpointsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAdditionalpointsCount() > 0) { + hash = (37 * hash) + ADDITIONALPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalpointsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * AddPoints if maxChoices > 9
+     * 
+ * + * Protobuf type {@code evoting_api.AddPoints} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:evoting_api.AddPoints) + ch.epfl.dedis.lib.proto.EvotingAPI.AddPointsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_AddPoints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_AddPoints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.class, ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.Builder.class); + } + + // Construct using ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + additionalpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_AddPoints_descriptor; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints getDefaultInstanceForType() { + return ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.getDefaultInstance(); + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints build() { + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints buildPartial() { + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints result = new ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + additionalpoints_ = java.util.Collections.unmodifiableList(additionalpoints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.additionalpoints_ = additionalpoints_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints) { + return mergeFrom((ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints other) { + if (other == ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints.getDefaultInstance()) return this; + if (!other.additionalpoints_.isEmpty()) { + if (additionalpoints_.isEmpty()) { + additionalpoints_ = other.additionalpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAdditionalpointsIsMutable(); + additionalpoints_.addAll(other.additionalpoints_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List additionalpoints_ = java.util.Collections.emptyList(); + private void ensureAdditionalpointsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + additionalpoints_ = new java.util.ArrayList(additionalpoints_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * The additional Points
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @return A list containing the additionalpoints. + */ + public java.util.List + getAdditionalpointsList() { + return ((bitField0_ & 0x00000001) != 0) ? + java.util.Collections.unmodifiableList(additionalpoints_) : additionalpoints_; + } + /** + *
+       * The additional Points
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @return The count of additionalpoints. + */ + public int getAdditionalpointsCount() { + return additionalpoints_.size(); + } + /** + *
+       * The additional Points
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @param index The index of the element to return. + * @return The additionalpoints at the given index. + */ + public com.google.protobuf.ByteString getAdditionalpoints(int index) { + return additionalpoints_.get(index); + } + /** + *
+       * The additional Points
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @param index The index to set the value at. + * @param value The additionalpoints to set. + * @return This builder for chaining. + */ + public Builder setAdditionalpoints( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * The additional Points
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @param value The additionalpoints to add. + * @return This builder for chaining. + */ + public Builder addAdditionalpoints(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalpointsIsMutable(); + additionalpoints_.add(value); + onChanged(); + return this; + } + /** + *
+       * The additional Points
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @param values The additionalpoints to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalpoints( + java.lang.Iterable values) { + ensureAdditionalpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalpoints_); + onChanged(); + return this; + } + /** + *
+       * The additional Points
+       * 
+ * + * repeated bytes additionalpoints = 1; + * @return This builder for chaining. + */ + public Builder clearAdditionalpoints() { + additionalpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:evoting_api.AddPoints) + } + + // @@protoc_insertion_point(class_scope:evoting_api.AddPoints) + private static final ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints(); + } + + public static ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddPoints parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AddPoints(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.AddPoints getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PingOrBuilder extends + // @@protoc_insertion_point(interface_extends:evoting_api.Ping) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Nonce can be any integer.
+     * 
+ * + * required uint32 nonce = 1; + * @return Whether the nonce field is set. + */ + boolean hasNonce(); + /** + *
+     * Nonce can be any integer.
+     * 
+ * + * required uint32 nonce = 1; + * @return The nonce. + */ + int getNonce(); + } + /** + *
+   * Ping message.
+   * 
+ * + * Protobuf type {@code evoting_api.Ping} + */ + public static final class Ping extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:evoting_api.Ping) + PingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Ping.newBuilder() to construct. + private Ping(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Ping() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Ping(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Ping( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + nonce_ = input.readUInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Ping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Ping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.EvotingAPI.Ping.class, ch.epfl.dedis.lib.proto.EvotingAPI.Ping.Builder.class); + } + + private int bitField0_; + public static final int NONCE_FIELD_NUMBER = 1; + private int nonce_; + /** + *
+     * Nonce can be any integer.
+     * 
+ * + * required uint32 nonce = 1; + * @return Whether the nonce field is set. + */ + @java.lang.Override + public boolean hasNonce() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * Nonce can be any integer.
+     * 
+ * + * required uint32 nonce = 1; + * @return The nonce. + */ + @java.lang.Override + public int getNonce() { + return nonce_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasNonce()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt32(1, nonce_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, nonce_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ch.epfl.dedis.lib.proto.EvotingAPI.Ping)) { + return super.equals(obj); + } + ch.epfl.dedis.lib.proto.EvotingAPI.Ping other = (ch.epfl.dedis.lib.proto.EvotingAPI.Ping) obj; + + if (hasNonce() != other.hasNonce()) return false; + if (hasNonce()) { + if (getNonce() + != other.getNonce()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasNonce()) { + hash = (37 * hash) + NONCE_FIELD_NUMBER; + hash = (53 * hash) + getNonce(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ch.epfl.dedis.lib.proto.EvotingAPI.Ping prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Ping message.
+     * 
+ * + * Protobuf type {@code evoting_api.Ping} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:evoting_api.Ping) + ch.epfl.dedis.lib.proto.EvotingAPI.PingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Ping_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Ping_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ch.epfl.dedis.lib.proto.EvotingAPI.Ping.class, ch.epfl.dedis.lib.proto.EvotingAPI.Ping.Builder.class); + } + + // Construct using ch.epfl.dedis.lib.proto.EvotingAPI.Ping.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + nonce_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return ch.epfl.dedis.lib.proto.EvotingAPI.internal_static_evoting_api_Ping_descriptor; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.Ping getDefaultInstanceForType() { + return ch.epfl.dedis.lib.proto.EvotingAPI.Ping.getDefaultInstance(); + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.Ping build() { + ch.epfl.dedis.lib.proto.EvotingAPI.Ping result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.Ping buildPartial() { + ch.epfl.dedis.lib.proto.EvotingAPI.Ping result = new ch.epfl.dedis.lib.proto.EvotingAPI.Ping(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nonce_ = nonce_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof ch.epfl.dedis.lib.proto.EvotingAPI.Ping) { + return mergeFrom((ch.epfl.dedis.lib.proto.EvotingAPI.Ping)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(ch.epfl.dedis.lib.proto.EvotingAPI.Ping other) { + if (other == ch.epfl.dedis.lib.proto.EvotingAPI.Ping.getDefaultInstance()) return this; + if (other.hasNonce()) { + setNonce(other.getNonce()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasNonce()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + ch.epfl.dedis.lib.proto.EvotingAPI.Ping parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (ch.epfl.dedis.lib.proto.EvotingAPI.Ping) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int nonce_ ; + /** + *
+       * Nonce can be any integer.
+       * 
+ * + * required uint32 nonce = 1; + * @return Whether the nonce field is set. + */ + @java.lang.Override + public boolean hasNonce() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+       * Nonce can be any integer.
+       * 
+ * + * required uint32 nonce = 1; + * @return The nonce. + */ + @java.lang.Override + public int getNonce() { + return nonce_; + } + /** + *
+       * Nonce can be any integer.
+       * 
+ * + * required uint32 nonce = 1; + * @param value The nonce to set. + * @return This builder for chaining. + */ + public Builder setNonce(int value) { + bitField0_ |= 0x00000001; + nonce_ = value; + onChanged(); + return this; + } + /** + *
+       * Nonce can be any integer.
+       * 
+ * + * required uint32 nonce = 1; + * @return This builder for chaining. + */ + public Builder clearNonce() { + bitField0_ = (bitField0_ & ~0x00000001); + nonce_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:evoting_api.Ping) + } + + // @@protoc_insertion_point(class_scope:evoting_api.Ping) + private static final ch.epfl.dedis.lib.proto.EvotingAPI.Ping DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ch.epfl.dedis.lib.proto.EvotingAPI.Ping(); + } + + public static ch.epfl.dedis.lib.proto.EvotingAPI.Ping getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Ping parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Ping(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public ch.epfl.dedis.lib.proto.EvotingAPI.Ping getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_api_Reconstruct_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_api_Reconstruct_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_api_ReconstructReply_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_api_ReconstructReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_api_AddPoints_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_api_AddPoints_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_evoting_api_Ping_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_evoting_api_Ping_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\021evoting_api.proto\022\013evoting_api\"\031\n\013Reco" + + "nstruct\022\n\n\002id\030\001 \002(\014\"T\n\020ReconstructReply\022" + + "\016\n\006points\030\001 \003(\014\0220\n\020additionalpoints\030\002 \003(" + + "\0132\026.evoting_api.AddPoints\"%\n\tAddPoints\022\030" + + "\n\020additionalpoints\030\001 \003(\014\"\025\n\004Ping\022\r\n\005nonc" + + "e\030\001 \002(\rB%\n\027ch.epfl.dedis.lib.protoB\nEvot" + + "ingAPI" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_evoting_api_Reconstruct_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_evoting_api_Reconstruct_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_evoting_api_Reconstruct_descriptor, + new java.lang.String[] { "Id", }); + internal_static_evoting_api_ReconstructReply_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_evoting_api_ReconstructReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_evoting_api_ReconstructReply_descriptor, + new java.lang.String[] { "Points", "Additionalpoints", }); + internal_static_evoting_api_AddPoints_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_evoting_api_AddPoints_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_evoting_api_AddPoints_descriptor, + new java.lang.String[] { "Additionalpoints", }); + internal_static_evoting_api_Ping_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_evoting_api_Ping_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_evoting_api_Ping_descriptor, + new java.lang.String[] { "Nonce", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/external/js/cothority/src/protobuf/models.json b/external/js/cothority/src/protobuf/models.json index f5c031f234..cc342fdda1 100644 --- a/external/js/cothority/src/protobuf/models.json +++ b/external/js/cothority/src/protobuf/models.json @@ -1 +1 @@ -{"nested":{"cothority":{},"authprox":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"AuthProxProto"},"nested":{"EnrollRequest":{"fields":{"type":{"rule":"required","type":"string","id":1},"issuer":{"rule":"required","type":"string","id":2},"participants":{"rule":"repeated","type":"bytes","id":3},"longpri":{"rule":"required","type":"PriShare","id":4},"longpubs":{"rule":"repeated","type":"bytes","id":5}}},"EnrollResponse":{"fields":{}},"SignatureRequest":{"fields":{"type":{"rule":"required","type":"string","id":1},"issuer":{"rule":"required","type":"string","id":2},"authinfo":{"rule":"required","type":"bytes","id":3},"randpri":{"rule":"required","type":"PriShare","id":4},"randpubs":{"rule":"repeated","type":"bytes","id":5},"message":{"rule":"required","type":"bytes","id":6}}},"PriShare":{"fields":{}},"PartialSig":{"fields":{"partial":{"rule":"required","type":"PriShare","id":1},"sessionid":{"rule":"required","type":"bytes","id":2},"signature":{"rule":"required","type":"bytes","id":3}}},"SignatureResponse":{"fields":{"partialsignature":{"rule":"required","type":"PartialSig","id":1}}},"EnrollmentsRequest":{"fields":{"types":{"rule":"repeated","type":"string","id":1},"issuers":{"rule":"repeated","type":"string","id":2}}},"EnrollmentsResponse":{"fields":{"enrollments":{"rule":"repeated","type":"EnrollmentInfo","id":1,"options":{"packed":false}}}},"EnrollmentInfo":{"fields":{"type":{"rule":"required","type":"string","id":1},"issuer":{"rule":"required","type":"string","id":2},"public":{"rule":"required","type":"bytes","id":3}}}}},"bevm":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"BEvmProto"},"nested":{"ViewCallRequest":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"bevminstanceid":{"rule":"required","type":"bytes","id":2},"accountaddress":{"rule":"required","type":"bytes","id":3},"contractaddress":{"rule":"required","type":"bytes","id":4},"calldata":{"rule":"required","type":"bytes","id":5},"minblockindex":{"rule":"required","type":"sint32","id":6}}},"ViewCallResponse":{"fields":{"result":{"rule":"required","type":"bytes","id":1}}}}},"byzcoin":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"ByzCoinProto"},"nested":{"GetAllByzCoinIDsRequest":{"fields":{}},"GetAllByzCoinIDsResponse":{"fields":{"ids":{"rule":"repeated","type":"bytes","id":1}}},"DataHeader":{"fields":{"trieroot":{"rule":"required","type":"bytes","id":1},"clienttransactionhash":{"rule":"required","type":"bytes","id":2},"statechangeshash":{"rule":"required","type":"bytes","id":3},"timestamp":{"rule":"required","type":"sint64","id":4},"version":{"type":"sint32","id":5}}},"DataBody":{"fields":{"txresults":{"rule":"repeated","type":"TxResult","id":1,"options":{"packed":false}}}},"CreateGenesisBlock":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"roster":{"rule":"required","type":"onet.Roster","id":2},"genesisdarc":{"rule":"required","type":"darc.Darc","id":3},"blockinterval":{"rule":"required","type":"sint64","id":4},"maxblocksize":{"type":"sint32","id":5},"darccontractids":{"rule":"repeated","type":"string","id":6}}},"CreateGenesisBlockResponse":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"skipblock":{"type":"skipchain.SkipBlock","id":2}}},"AddTxRequest":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"skipchainid":{"rule":"required","type":"bytes","id":2},"transaction":{"rule":"required","type":"ClientTransaction","id":3},"inclusionwait":{"type":"sint32","id":4},"prooffrom":{"type":"bytes","id":5},"flags":{"type":"sint32","id":6}}},"AddTxResponse":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"error":{"type":"string","id":2},"proof":{"type":"Proof","id":3}}},"GetProof":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"key":{"rule":"required","type":"bytes","id":2},"id":{"rule":"required","type":"bytes","id":3},"mustcontainblock":{"type":"bytes","id":4}}},"GetProofResponse":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"proof":{"rule":"required","type":"Proof","id":2}}},"CheckAuthorization":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"byzcoinid":{"rule":"required","type":"bytes","id":2},"darcid":{"rule":"required","type":"bytes","id":3},"identities":{"rule":"repeated","type":"darc.Identity","id":4,"options":{"packed":false}}}},"CheckAuthorizationResponse":{"fields":{"actions":{"rule":"repeated","type":"string","id":1}}},"ChainConfig":{"fields":{"blockinterval":{"rule":"required","type":"sint64","id":1},"roster":{"rule":"required","type":"onet.Roster","id":2},"maxblocksize":{"rule":"required","type":"sint32","id":3},"darccontractids":{"rule":"repeated","type":"string","id":4}}},"Proof":{"fields":{"inclusionproof":{"rule":"required","type":"trie.Proof","id":1},"latest":{"rule":"required","type":"skipchain.SkipBlock","id":2},"links":{"rule":"repeated","type":"skipchain.ForwardLink","id":3,"options":{"packed":false}}}},"Instruction":{"fields":{"instanceid":{"rule":"required","type":"bytes","id":1},"spawn":{"type":"Spawn","id":2},"invoke":{"type":"Invoke","id":3},"delete":{"type":"Delete","id":4},"signercounter":{"rule":"repeated","type":"uint64","id":5,"options":{"packed":true}},"signeridentities":{"rule":"repeated","type":"darc.Identity","id":6,"options":{"packed":false}},"signatures":{"rule":"repeated","type":"bytes","id":7}}},"Spawn":{"fields":{"contractid":{"rule":"required","type":"string","id":1},"args":{"rule":"repeated","type":"Argument","id":2,"options":{"packed":false}}}},"Invoke":{"fields":{"contractid":{"rule":"required","type":"string","id":1},"command":{"rule":"required","type":"string","id":2},"args":{"rule":"repeated","type":"Argument","id":3,"options":{"packed":false}}}},"Delete":{"fields":{"contractid":{"rule":"required","type":"string","id":1},"args":{"rule":"repeated","type":"Argument","id":2,"options":{"packed":false}}}},"Argument":{"fields":{"name":{"rule":"required","type":"string","id":1},"value":{"rule":"required","type":"bytes","id":2}}},"ClientTransaction":{"fields":{"instructions":{"rule":"repeated","type":"Instruction","id":1,"options":{"packed":false}}}},"TxResult":{"fields":{"clienttransaction":{"rule":"required","type":"ClientTransaction","id":1},"accepted":{"rule":"required","type":"bool","id":2}}},"StateChange":{"fields":{"stateaction":{"rule":"required","type":"sint32","id":1},"instanceid":{"rule":"required","type":"bytes","id":2},"contractid":{"rule":"required","type":"string","id":3},"value":{"rule":"required","type":"bytes","id":4},"darcid":{"rule":"required","type":"bytes","id":5},"version":{"rule":"required","type":"uint64","id":6}}},"Coin":{"fields":{"name":{"rule":"required","type":"bytes","id":1},"value":{"rule":"required","type":"uint64","id":2}}},"StreamingRequest":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"StreamingResponse":{"fields":{"block":{"type":"skipchain.SkipBlock","id":1}}},"PaginateRequest":{"fields":{"startid":{"rule":"required","type":"bytes","id":1},"pagesize":{"rule":"required","type":"uint64","id":2},"numpages":{"rule":"required","type":"uint64","id":3},"backward":{"rule":"required","type":"bool","id":4}}},"PaginateResponse":{"fields":{"blocks":{"rule":"repeated","type":"skipchain.SkipBlock","id":1,"options":{"packed":false}},"pagenumber":{"rule":"required","type":"uint64","id":2},"backward":{"rule":"required","type":"bool","id":3},"errorcode":{"rule":"required","type":"uint64","id":4},"errortext":{"rule":"repeated","type":"string","id":5}}},"DownloadState":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"nonce":{"rule":"required","type":"uint64","id":2},"length":{"rule":"required","type":"sint32","id":3}}},"DownloadStateResponse":{"fields":{"keyvalues":{"rule":"repeated","type":"DBKeyValue","id":1,"options":{"packed":false}},"nonce":{"rule":"required","type":"uint64","id":2},"total":{"type":"sint32","id":3}}},"DBKeyValue":{"fields":{"key":{"rule":"required","type":"bytes","id":1},"value":{"rule":"required","type":"bytes","id":2}}},"StateChangeBody":{"fields":{"stateaction":{"rule":"required","type":"sint32","id":1},"contractid":{"rule":"required","type":"string","id":2},"value":{"rule":"required","type":"bytes","id":3},"version":{"rule":"required","type":"uint64","id":4},"darcid":{"rule":"required","type":"bytes","id":5}}},"GetSignerCounters":{"fields":{"signerids":{"rule":"repeated","type":"string","id":1},"skipchainid":{"rule":"required","type":"bytes","id":2}}},"GetSignerCountersResponse":{"fields":{"counters":{"rule":"repeated","type":"uint64","id":1,"options":{"packed":true}},"index":{"type":"uint64","id":2}}},"GetInstanceVersion":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2},"version":{"rule":"required","type":"uint64","id":3}}},"GetLastInstanceVersion":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2}}},"GetInstanceVersionResponse":{"fields":{"statechange":{"rule":"required","type":"StateChange","id":1},"blockindex":{"rule":"required","type":"sint32","id":2}}},"GetAllInstanceVersion":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2}}},"GetAllInstanceVersionResponse":{"fields":{"statechanges":{"rule":"repeated","type":"GetInstanceVersionResponse","id":1,"options":{"packed":false}}}},"CheckStateChangeValidity":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2},"version":{"rule":"required","type":"uint64","id":3}}},"CheckStateChangeValidityResponse":{"fields":{"statechanges":{"rule":"repeated","type":"StateChange","id":1,"options":{"packed":false}},"blockid":{"rule":"required","type":"bytes","id":2}}},"ResolveInstanceID":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"darcid":{"rule":"required","type":"bytes","id":2},"name":{"rule":"required","type":"string","id":3}}},"ResolvedInstanceID":{"fields":{"instanceid":{"rule":"required","type":"bytes","id":1}}},"DebugRequest":{"fields":{"byzcoinid":{"type":"bytes","id":1}}},"DebugResponse":{"fields":{"byzcoins":{"rule":"repeated","type":"DebugResponseByzcoin","id":1,"options":{"packed":false}},"dump":{"rule":"repeated","type":"DebugResponseState","id":2,"options":{"packed":false}}}},"DebugResponseByzcoin":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"genesis":{"type":"skipchain.SkipBlock","id":2},"latest":{"type":"skipchain.SkipBlock","id":3}}},"DebugResponseState":{"fields":{"key":{"rule":"required","type":"bytes","id":1},"state":{"rule":"required","type":"StateChangeBody","id":2}}},"DebugRemoveRequest":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"signature":{"rule":"required","type":"bytes","id":2}}},"IDVersion":{"fields":{"id":{"rule":"required","type":"bytes","id":1},"version":{"rule":"required","type":"uint64","id":2}}},"GetUpdatesRequest":{"fields":{"instances":{"rule":"repeated","type":"IDVersion","id":1,"options":{"packed":false}},"flags":{"rule":"required","type":"uint64","id":2},"latestblockid":{"type":"bytes","id":3},"skipchainid":{"type":"bytes","id":4}}},"GetUpdatesReply":{"fields":{"proofs":{"rule":"repeated","type":"trie.Proof","id":1,"options":{"packed":false}},"links":{"rule":"repeated","type":"skipchain.ForwardLink","id":2,"options":{"packed":false}},"latest":{"type":"skipchain.SkipBlock","id":3}}}}},"skipchain":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"SkipchainProto"},"nested":{"StoreSkipBlock":{"fields":{"targetSkipChainID":{"rule":"required","type":"bytes","id":1},"newBlock":{"rule":"required","type":"SkipBlock","id":2},"signature":{"type":"bytes","id":3}}},"StoreSkipBlockReply":{"fields":{"previous":{"type":"SkipBlock","id":1},"latest":{"rule":"required","type":"SkipBlock","id":2}}},"GetAllSkipChainIDs":{"fields":{}},"GetAllSkipChainIDsReply":{"fields":{"skipChainIDs":{"rule":"repeated","type":"bytes","id":1}}},"GetSingleBlock":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"GetSingleBlockByIndex":{"fields":{"genesis":{"rule":"required","type":"bytes","id":1},"index":{"rule":"required","type":"sint32","id":2}}},"GetSingleBlockByIndexReply":{"fields":{"skipblock":{"rule":"required","type":"SkipBlock","id":1},"links":{"rule":"repeated","type":"ForwardLink","id":2,"options":{"packed":false}}}},"GetUpdateChain":{"fields":{"latestID":{"rule":"required","type":"bytes","id":1},"maxHeight":{"type":"sint32","id":2},"maxBlocks":{"type":"sint32","id":3}}},"GetUpdateChainReply":{"fields":{"update":{"rule":"repeated","type":"SkipBlock","id":1,"options":{"packed":false}}}},"SkipBlock":{"fields":{"index":{"rule":"required","type":"sint32","id":1},"height":{"rule":"required","type":"sint32","id":2},"maxHeight":{"rule":"required","type":"sint32","id":3},"baseHeight":{"rule":"required","type":"sint32","id":4},"backlinks":{"rule":"repeated","type":"bytes","id":5},"verifiers":{"rule":"repeated","type":"bytes","id":6},"genesis":{"rule":"required","type":"bytes","id":7},"data":{"rule":"required","type":"bytes","id":8},"roster":{"rule":"required","type":"onet.Roster","id":9},"hash":{"rule":"required","type":"bytes","id":10},"forward":{"rule":"repeated","type":"ForwardLink","id":11,"options":{"packed":false}},"payload":{"type":"bytes","id":12},"signatureScheme":{"type":"uint32","id":13}}},"ForwardLink":{"fields":{"from":{"rule":"required","type":"bytes","id":1},"to":{"rule":"required","type":"bytes","id":2},"newRoster":{"type":"onet.Roster","id":3},"signature":{"rule":"required","type":"ByzcoinSig","id":4}}},"ByzcoinSig":{"fields":{"msg":{"rule":"required","type":"bytes","id":1},"sig":{"rule":"required","type":"bytes","id":2}}},"SchnorrSig":{"fields":{"challenge":{"rule":"required","type":"bytes","id":1},"response":{"rule":"required","type":"bytes","id":2}}},"Exception":{"fields":{"index":{"rule":"required","type":"sint32","id":1},"commitment":{"rule":"required","type":"bytes","id":2}}}}},"onet":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"OnetProto"},"nested":{"Roster":{"fields":{"id":{"type":"bytes","id":1},"list":{"rule":"repeated","type":"network.ServerIdentity","id":2,"options":{"packed":false}},"aggregate":{"rule":"required","type":"bytes","id":3}}},"Status":{"fields":{"field":{"keyType":"string","type":"string","id":1}}}}},"network":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"NetworkProto"},"nested":{"ServerIdentity":{"fields":{"public":{"rule":"required","type":"bytes","id":1},"serviceIdentities":{"rule":"repeated","type":"ServiceIdentity","id":2,"options":{"packed":false}},"id":{"rule":"required","type":"bytes","id":3},"address":{"rule":"required","type":"string","id":4},"description":{"rule":"required","type":"string","id":5},"url":{"type":"string","id":7}}},"ServiceIdentity":{"fields":{"name":{"rule":"required","type":"string","id":1},"suite":{"rule":"required","type":"string","id":2},"public":{"rule":"required","type":"bytes","id":3}}}}},"darc":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"DarcProto"},"nested":{"Darc":{"fields":{"version":{"rule":"required","type":"uint64","id":1},"description":{"rule":"required","type":"bytes","id":2},"baseid":{"type":"bytes","id":3},"previd":{"rule":"required","type":"bytes","id":4},"rules":{"rule":"required","type":"Rules","id":5},"signatures":{"rule":"repeated","type":"Signature","id":6,"options":{"packed":false}},"verificationdarcs":{"rule":"repeated","type":"Darc","id":7,"options":{"packed":false}}}},"Identity":{"fields":{"darc":{"type":"IdentityDarc","id":1},"ed25519":{"type":"IdentityEd25519","id":2},"x509ec":{"type":"IdentityX509EC","id":3},"proxy":{"type":"IdentityProxy","id":4},"evmcontract":{"type":"IdentityEvmContract","id":5},"did":{"type":"IdentityDID","id":6},"tsm":{"type":"IdentityTSM","id":7}}},"IdentityEd25519":{"fields":{"point":{"rule":"required","type":"bytes","id":1}}},"IdentityTSM":{"fields":{"publickey":{"rule":"required","type":"bytes","id":1}}},"IdentityX509EC":{"fields":{"public":{"rule":"required","type":"bytes","id":1}}},"IdentityProxy":{"fields":{"data":{"rule":"required","type":"string","id":1},"public":{"rule":"required","type":"bytes","id":2}}},"IdentityDarc":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"IdentityEvmContract":{"fields":{"address":{"rule":"required","type":"bytes","id":1}}},"IdentityDID":{"fields":{"did":{"rule":"required","type":"string","id":1},"diddoc":{"type":"DIDDoc","id":2},"method":{"rule":"required","type":"string","id":3}}},"DIDDoc":{"fields":{"context":{"rule":"repeated","type":"string","id":1},"id":{"rule":"required","type":"string","id":2},"publickey":{"rule":"repeated","type":"PublicKey","id":3,"options":{"packed":false}},"service":{"rule":"repeated","type":"DIDService","id":4,"options":{"packed":false}},"authentication":{"rule":"repeated","type":"VerificationMethod","id":5,"options":{"packed":false}}}},"PublicKey":{"fields":{"id":{"rule":"required","type":"string","id":1},"type":{"rule":"required","type":"string","id":2},"controller":{"rule":"required","type":"string","id":3},"value":{"rule":"required","type":"bytes","id":4}}},"DIDService":{"fields":{"id":{"rule":"required","type":"string","id":1},"type":{"rule":"required","type":"string","id":2},"priority":{"rule":"required","type":"sint32","id":3},"recipientkeys":{"rule":"repeated","type":"string","id":4},"routingkeys":{"rule":"repeated","type":"string","id":5},"serviceendpoint":{"rule":"required","type":"string","id":6}}},"VerificationMethod":{"fields":{"publickey":{"rule":"required","type":"PublicKey","id":1}}},"Signature":{"fields":{"signature":{"rule":"required","type":"bytes","id":1},"signer":{"rule":"required","type":"Identity","id":2}}},"Signer":{"fields":{"ed25519":{"type":"SignerEd25519","id":1},"x509ec":{"type":"SignerX509EC","id":2},"proxy":{"type":"SignerProxy","id":3},"evmcontract":{"type":"SignerEvmContract","id":4},"did":{"type":"SignerDID","id":5}}},"SignerEd25519":{"fields":{"point":{"rule":"required","type":"bytes","id":1},"secret":{"rule":"required","type":"bytes","id":2}}},"SignerX509EC":{"fields":{"point":{"rule":"required","type":"bytes","id":1}}},"SignerProxy":{"fields":{"data":{"rule":"required","type":"string","id":1},"public":{"rule":"required","type":"bytes","id":2}}},"SignerEvmContract":{"fields":{"address":{"rule":"required","type":"bytes","id":1}}},"SignerDID":{"fields":{"public":{"rule":"required","type":"bytes","id":1},"secret":{"rule":"required","type":"bytes","id":2},"did":{"rule":"required","type":"string","id":3}}},"Request":{"fields":{"baseid":{"rule":"required","type":"bytes","id":1},"action":{"rule":"required","type":"string","id":2},"msg":{"rule":"required","type":"bytes","id":3},"identities":{"rule":"repeated","type":"Identity","id":4,"options":{"packed":false}},"signatures":{"rule":"repeated","type":"bytes","id":5}}},"Rules":{"fields":{"list":{"rule":"repeated","type":"Rule","id":1,"options":{"packed":false}}}},"Rule":{"fields":{"action":{"rule":"required","type":"string","id":1},"expr":{"rule":"required","type":"bytes","id":2}}}}},"trie":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"TrieProto"},"nested":{"InteriorNode":{"fields":{"left":{"rule":"required","type":"bytes","id":1},"right":{"rule":"required","type":"bytes","id":2}}},"EmptyNode":{"fields":{"prefix":{"rule":"repeated","type":"bool","id":1,"options":{"packed":true}}}},"LeafNode":{"fields":{"prefix":{"rule":"repeated","type":"bool","id":1,"options":{"packed":true}},"key":{"rule":"required","type":"bytes","id":2},"value":{"rule":"required","type":"bytes","id":3}}},"Proof":{"fields":{"interiors":{"rule":"repeated","type":"InteriorNode","id":1,"options":{"packed":false}},"leaf":{"rule":"required","type":"LeafNode","id":2},"empty":{"rule":"required","type":"EmptyNode","id":3},"nonce":{"rule":"required","type":"bytes","id":4}}}}},"calypso":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"Calypso"},"nested":{"Write":{"fields":{"data":{"rule":"required","type":"bytes","id":1},"u":{"rule":"required","type":"bytes","id":2},"ubar":{"rule":"required","type":"bytes","id":3},"e":{"rule":"required","type":"bytes","id":4},"f":{"rule":"required","type":"bytes","id":5},"c":{"rule":"required","type":"bytes","id":6},"extradata":{"type":"bytes","id":7},"ltsid":{"rule":"required","type":"bytes","id":8},"cost":{"type":"byzcoin.Coin","id":9}}},"Read":{"fields":{"write":{"rule":"required","type":"bytes","id":1},"xc":{"rule":"required","type":"bytes","id":2}}},"Authorise":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1}}},"AuthoriseReply":{"fields":{}},"Authorize":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"timestamp":{"type":"sint64","id":2},"signature":{"type":"bytes","id":3}}},"AuthorizeReply":{"fields":{}},"CreateLTS":{"fields":{"proof":{"rule":"required","type":"byzcoin.Proof","id":1}}},"CreateLTSReply":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2},"x":{"rule":"required","type":"bytes","id":3}}},"ReshareLTS":{"fields":{"proof":{"rule":"required","type":"byzcoin.Proof","id":1}}},"ReshareLTSReply":{"fields":{}},"UpdateValidPeers":{"fields":{"proof":{"rule":"required","type":"byzcoin.Proof","id":1}}},"UpdateValidPeersReply":{"fields":{}},"DecryptKey":{"fields":{"read":{"rule":"required","type":"byzcoin.Proof","id":1},"write":{"rule":"required","type":"byzcoin.Proof","id":2}}},"DecryptKeyReply":{"fields":{"c":{"rule":"required","type":"bytes","id":1},"xhatenc":{"rule":"required","type":"bytes","id":2},"x":{"rule":"required","type":"bytes","id":3}}},"GetLTSReply":{"fields":{"ltsid":{"rule":"required","type":"bytes","id":1}}},"LtsInstanceInfo":{"fields":{"roster":{"rule":"required","type":"onet.Roster","id":1}}}}},"eventlog":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"EventLogProto"},"nested":{"SearchRequest":{"fields":{"instance":{"rule":"required","type":"bytes","id":1},"id":{"rule":"required","type":"bytes","id":2},"topic":{"rule":"required","type":"string","id":3},"from":{"rule":"required","type":"sint64","id":4},"to":{"rule":"required","type":"sint64","id":5}}},"SearchResponse":{"fields":{"events":{"rule":"repeated","type":"Event","id":1,"options":{"packed":false}},"truncated":{"rule":"required","type":"bool","id":2}}},"Event":{"fields":{"when":{"rule":"required","type":"sint64","id":1},"topic":{"rule":"required","type":"string","id":2},"content":{"rule":"required","type":"string","id":3}}}}},"evoting":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"Evoting"},"nested":{"Transaction":{"fields":{"master":{"type":"Master","id":1},"link":{"type":"Link","id":2},"election":{"type":"Election","id":3},"ballot":{"type":"Ballot","id":4},"mix":{"type":"Mix","id":5},"partial":{"type":"Partial","id":6},"user":{"rule":"required","type":"uint32","id":7},"signature":{"rule":"required","type":"bytes","id":8}}},"Master":{"fields":{"id":{"rule":"required","type":"bytes","id":1},"roster":{"type":"onet.Roster","id":2},"admins":{"rule":"repeated","type":"uint32","id":3,"options":{"packed":true}},"key":{"rule":"required","type":"bytes","id":4}}},"Link":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"Election":{"fields":{"name":{"keyType":"string","type":"string","id":1},"creator":{"rule":"required","type":"uint32","id":2},"users":{"rule":"repeated","type":"uint32","id":3,"options":{"packed":true}},"id":{"rule":"required","type":"bytes","id":4},"master":{"rule":"required","type":"bytes","id":5},"roster":{"type":"onet.Roster","id":6},"key":{"rule":"required","type":"bytes","id":7},"masterkey":{"rule":"required","type":"bytes","id":8},"stage":{"rule":"required","type":"uint32","id":9},"candidates":{"rule":"repeated","type":"uint32","id":10,"options":{"packed":true}},"maxchoices":{"rule":"required","type":"sint32","id":11},"subtitle":{"keyType":"string","type":"string","id":12},"moreinfo":{"rule":"required","type":"string","id":13},"start":{"rule":"required","type":"sint64","id":14},"end":{"rule":"required","type":"sint64","id":15},"theme":{"rule":"required","type":"string","id":16},"footer":{"rule":"required","type":"Footer","id":17},"voted":{"rule":"required","type":"bytes","id":18},"moreinfolang":{"keyType":"string","type":"string","id":19}}},"Footer":{"fields":{"text":{"rule":"required","type":"string","id":1},"contacttitle":{"rule":"required","type":"string","id":2},"contactphone":{"rule":"required","type":"string","id":3},"contactemail":{"rule":"required","type":"string","id":4}}},"Ballot":{"fields":{"user":{"rule":"required","type":"uint32","id":1},"alpha":{"rule":"required","type":"bytes","id":2},"beta":{"rule":"required","type":"bytes","id":3}}},"Mix":{"fields":{"ballots":{"rule":"repeated","type":"Ballot","id":1,"options":{"packed":false}},"proof":{"rule":"required","type":"bytes","id":2},"nodeid":{"rule":"required","type":"bytes","id":3},"signature":{"rule":"required","type":"bytes","id":4}}},"Partial":{"fields":{"points":{"rule":"repeated","type":"bytes","id":1},"nodeid":{"rule":"required","type":"bytes","id":2},"signature":{"rule":"required","type":"bytes","id":3}}}}},"personhood":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"Personhood"},"nested":{"RoPaSci":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"ropasciid":{"rule":"required","type":"bytes","id":2},"locked":{"type":"sint64","id":3}}},"RoPaSciStruct":{"fields":{"description":{"rule":"required","type":"string","id":1},"stake":{"rule":"required","type":"byzcoin.Coin","id":2},"firstplayerhash":{"rule":"required","type":"bytes","id":3},"firstplayer":{"type":"sint32","id":4},"secondplayer":{"type":"sint32","id":5},"secondplayeraccount":{"type":"bytes","id":6},"firstplayeraccount":{"type":"bytes","id":7},"calypsowrite":{"type":"bytes","id":8},"calypsoread":{"type":"bytes","id":9}}},"CredentialStruct":{"fields":{"credentials":{"rule":"repeated","type":"Credential","id":1,"options":{"packed":false}}}},"Credential":{"fields":{"name":{"rule":"required","type":"string","id":1},"attributes":{"rule":"repeated","type":"Attribute","id":2,"options":{"packed":false}}}},"Attribute":{"fields":{"name":{"rule":"required","type":"string","id":1},"value":{"rule":"required","type":"bytes","id":2}}},"SpawnerStruct":{"fields":{"costdarc":{"rule":"required","type":"byzcoin.Coin","id":1},"costcoin":{"rule":"required","type":"byzcoin.Coin","id":2},"costcredential":{"rule":"required","type":"byzcoin.Coin","id":3},"costparty":{"rule":"required","type":"byzcoin.Coin","id":4},"beneficiary":{"rule":"required","type":"bytes","id":5},"costropasci":{"type":"byzcoin.Coin","id":6},"costcwrite":{"type":"byzcoin.Coin","id":7},"costcread":{"type":"byzcoin.Coin","id":8},"costvalue":{"type":"byzcoin.Coin","id":9}}},"PopPartyStruct":{"fields":{"state":{"rule":"required","type":"sint32","id":1},"organizers":{"rule":"required","type":"sint32","id":2},"finalizations":{"rule":"repeated","type":"string","id":3},"description":{"rule":"required","type":"PopDesc","id":4},"attendees":{"rule":"required","type":"Attendees","id":5},"miners":{"rule":"repeated","type":"LRSTag","id":6,"options":{"packed":false}},"miningreward":{"rule":"required","type":"uint64","id":7},"previous":{"type":"bytes","id":8},"next":{"type":"bytes","id":9}}},"PopDesc":{"fields":{"name":{"rule":"required","type":"string","id":1},"purpose":{"rule":"required","type":"string","id":2},"datetime":{"rule":"required","type":"uint64","id":3},"location":{"rule":"required","type":"string","id":4}}},"FinalStatement":{"fields":{"desc":{"type":"PopDesc","id":1},"attendees":{"rule":"required","type":"Attendees","id":2}}},"Attendees":{"fields":{"keys":{"rule":"repeated","type":"bytes","id":1}}},"LRSTag":{"fields":{"tag":{"rule":"required","type":"bytes","id":1}}}}},"personhood_service":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"PersonhoodService"},"nested":{"PartyList":{"fields":{"newparty":{"type":"Party","id":1},"wipeparties":{"type":"bool","id":2},"partydelete":{"type":"PartyDelete","id":3}}},"PartyDelete":{"fields":{"partyid":{"rule":"required","type":"bytes","id":1},"identity":{"rule":"required","type":"darc.Identity","id":2},"signature":{"rule":"required","type":"bytes","id":3}}},"PartyListResponse":{"fields":{"parties":{"rule":"repeated","type":"Party","id":1,"options":{"packed":false}}}},"Party":{"fields":{"roster":{"rule":"required","type":"onet.Roster","id":1},"byzcoinid":{"rule":"required","type":"bytes","id":2},"instanceid":{"rule":"required","type":"bytes","id":3}}},"RoPaSciList":{"fields":{"newropasci":{"type":"personhood.RoPaSci","id":1},"wipe":{"type":"bool","id":2},"lock":{"type":"personhood.RoPaSci","id":3}}},"RoPaSciListResponse":{"fields":{"ropascis":{"rule":"repeated","type":"personhood.RoPaSci","id":1,"options":{"packed":false}}}},"StringReply":{"fields":{"reply":{"rule":"required","type":"string","id":1}}},"Poll":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"newpoll":{"type":"PollStruct","id":2},"list":{"type":"PollList","id":3},"answer":{"type":"PollAnswer","id":4},"delete":{"type":"PollDelete","id":5}}},"PollDelete":{"fields":{"identity":{"rule":"required","type":"darc.Identity","id":1},"pollid":{"rule":"required","type":"bytes","id":2},"signature":{"rule":"required","type":"bytes","id":3}}},"PollList":{"fields":{"partyids":{"rule":"repeated","type":"bytes","id":1}}},"PollAnswer":{"fields":{"pollid":{"rule":"required","type":"bytes","id":1},"choice":{"rule":"required","type":"sint32","id":2},"lrs":{"rule":"required","type":"bytes","id":3},"partyid":{"type":"bytes","id":4}}},"PollStruct":{"fields":{"personhood":{"rule":"required","type":"bytes","id":1},"pollid":{"type":"bytes","id":2},"title":{"rule":"required","type":"string","id":3},"description":{"rule":"required","type":"string","id":4},"choices":{"rule":"repeated","type":"string","id":5},"chosen":{"rule":"repeated","type":"PollChoice","id":6,"options":{"packed":false}}}},"PollChoice":{"fields":{"choice":{"rule":"required","type":"sint32","id":1},"lrstag":{"rule":"required","type":"bytes","id":2}}},"PollResponse":{"fields":{"polls":{"rule":"repeated","type":"PollStruct","id":1,"options":{"packed":false}}}},"Capabilities":{"fields":{}},"CapabilitiesResponse":{"fields":{"capabilities":{"rule":"repeated","type":"Capability","id":1,"options":{"packed":false}}}},"Capability":{"fields":{"endpoint":{"rule":"required","type":"string","id":1},"version":{"rule":"required","type":"bytes","id":2}}},"UserLocation":{"fields":{"publickey":{"rule":"required","type":"bytes","id":1},"credentialiid":{"type":"bytes","id":2},"credential":{"type":"personhood.CredentialStruct","id":3},"location":{"type":"string","id":4},"time":{"rule":"required","type":"sint64","id":5}}},"Meetup":{"fields":{"userlocation":{"type":"UserLocation","id":1},"wipe":{"type":"bool","id":2}}},"MeetupResponse":{"fields":{"users":{"rule":"repeated","type":"UserLocation","id":1,"options":{"packed":false}}}},"Challenge":{"fields":{"update":{"type":"ChallengeCandidate","id":1}}},"ChallengeCandidate":{"fields":{"credential":{"rule":"required","type":"bytes","id":1},"score":{"rule":"required","type":"sint32","id":2},"signup":{"rule":"required","type":"sint64","id":3}}},"ChallengeReply":{"fields":{"list":{"rule":"repeated","type":"ChallengeCandidate","id":1,"options":{"packed":false}}}},"GetAdminDarcIDs":{"fields":{}},"GetAdminDarcIDsReply":{"fields":{"admindarcids":{"rule":"repeated","type":"bytes","id":1}}},"SetAdminDarcIDs":{"fields":{"newadmindarcids":{"rule":"repeated","type":"bytes","id":1},"signature":{"rule":"required","type":"bytes","id":2}}},"SetAdminDarcIDsReply":{"fields":{}},"EmailSetup":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"roster":{"rule":"required","type":"onet.Roster","id":2},"deviceurl":{"rule":"required","type":"string","id":3},"emaildarcid":{"rule":"required","type":"bytes","id":4},"smtphost":{"rule":"required","type":"string","id":5},"smtpfrom":{"rule":"required","type":"string","id":6},"smtpreplyto":{"rule":"required","type":"string","id":7},"baseurl":{"rule":"required","type":"string","id":8},"signature":{"rule":"required","type":"bytes","id":9}}},"EmailSetupReply":{"fields":{}},"EmailSignup":{"fields":{"email":{"rule":"required","type":"string","id":1},"alias":{"rule":"required","type":"string","id":2}}},"EmailSignupReply":{"fields":{"status":{"rule":"required","type":"sint32","id":1}}},"EmailRecover":{"fields":{"email":{"rule":"required","type":"string","id":1}}},"EmailRecoverReply":{"fields":{"status":{"rule":"required","type":"sint32","id":1}}}}},"status":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"StatusProto"},"nested":{"Request":{"fields":{}},"Response":{"fields":{"status":{"keyType":"string","type":"onet.Status","id":1},"serveridentity":{"type":"network.ServerIdentity","id":2}}},"CheckConnectivity":{"fields":{"time":{"rule":"required","type":"sint64","id":1},"timeout":{"rule":"required","type":"sint64","id":2},"findfaulty":{"rule":"required","type":"bool","id":3},"list":{"rule":"repeated","type":"network.ServerIdentity","id":4,"options":{"packed":false}},"signature":{"rule":"required","type":"bytes","id":5}}},"CheckConnectivityReply":{"fields":{"nodes":{"rule":"repeated","type":"network.ServerIdentity","id":1,"options":{"packed":false}}}}}}}} +{"nested":{"cothority":{},"authprox":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"AuthProxProto"},"nested":{"EnrollRequest":{"fields":{"type":{"rule":"required","type":"string","id":1},"issuer":{"rule":"required","type":"string","id":2},"participants":{"rule":"repeated","type":"bytes","id":3},"longpri":{"rule":"required","type":"PriShare","id":4},"longpubs":{"rule":"repeated","type":"bytes","id":5}}},"EnrollResponse":{"fields":{}},"SignatureRequest":{"fields":{"type":{"rule":"required","type":"string","id":1},"issuer":{"rule":"required","type":"string","id":2},"authinfo":{"rule":"required","type":"bytes","id":3},"randpri":{"rule":"required","type":"PriShare","id":4},"randpubs":{"rule":"repeated","type":"bytes","id":5},"message":{"rule":"required","type":"bytes","id":6}}},"PriShare":{"fields":{}},"PartialSig":{"fields":{"partial":{"rule":"required","type":"PriShare","id":1},"sessionid":{"rule":"required","type":"bytes","id":2},"signature":{"rule":"required","type":"bytes","id":3}}},"SignatureResponse":{"fields":{"partialsignature":{"rule":"required","type":"PartialSig","id":1}}},"EnrollmentsRequest":{"fields":{"types":{"rule":"repeated","type":"string","id":1},"issuers":{"rule":"repeated","type":"string","id":2}}},"EnrollmentsResponse":{"fields":{"enrollments":{"rule":"repeated","type":"EnrollmentInfo","id":1,"options":{"packed":false}}}},"EnrollmentInfo":{"fields":{"type":{"rule":"required","type":"string","id":1},"issuer":{"rule":"required","type":"string","id":2},"public":{"rule":"required","type":"bytes","id":3}}}}},"bevm":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"BEvmProto"},"nested":{"ViewCallRequest":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"bevminstanceid":{"rule":"required","type":"bytes","id":2},"accountaddress":{"rule":"required","type":"bytes","id":3},"contractaddress":{"rule":"required","type":"bytes","id":4},"calldata":{"rule":"required","type":"bytes","id":5},"minblockindex":{"rule":"required","type":"sint32","id":6}}},"ViewCallResponse":{"fields":{"result":{"rule":"required","type":"bytes","id":1}}}}},"byzcoin":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"ByzCoinProto"},"nested":{"GetAllByzCoinIDsRequest":{"fields":{}},"GetAllByzCoinIDsResponse":{"fields":{"ids":{"rule":"repeated","type":"bytes","id":1}}},"DataHeader":{"fields":{"trieroot":{"rule":"required","type":"bytes","id":1},"clienttransactionhash":{"rule":"required","type":"bytes","id":2},"statechangeshash":{"rule":"required","type":"bytes","id":3},"timestamp":{"rule":"required","type":"sint64","id":4},"version":{"type":"sint32","id":5}}},"DataBody":{"fields":{"txresults":{"rule":"repeated","type":"TxResult","id":1,"options":{"packed":false}}}},"CreateGenesisBlock":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"roster":{"rule":"required","type":"onet.Roster","id":2},"genesisdarc":{"rule":"required","type":"darc.Darc","id":3},"blockinterval":{"rule":"required","type":"sint64","id":4},"maxblocksize":{"type":"sint32","id":5},"darccontractids":{"rule":"repeated","type":"string","id":6}}},"CreateGenesisBlockResponse":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"skipblock":{"type":"skipchain.SkipBlock","id":2}}},"AddTxRequest":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"skipchainid":{"rule":"required","type":"bytes","id":2},"transaction":{"rule":"required","type":"ClientTransaction","id":3},"inclusionwait":{"type":"sint32","id":4},"prooffrom":{"type":"bytes","id":5},"flags":{"type":"sint32","id":6}}},"AddTxResponse":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"error":{"type":"string","id":2},"proof":{"type":"Proof","id":3}}},"GetProof":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"key":{"rule":"required","type":"bytes","id":2},"id":{"rule":"required","type":"bytes","id":3},"mustcontainblock":{"type":"bytes","id":4}}},"GetProofResponse":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"proof":{"rule":"required","type":"Proof","id":2}}},"CheckAuthorization":{"fields":{"version":{"rule":"required","type":"sint32","id":1},"byzcoinid":{"rule":"required","type":"bytes","id":2},"darcid":{"rule":"required","type":"bytes","id":3},"identities":{"rule":"repeated","type":"darc.Identity","id":4,"options":{"packed":false}}}},"CheckAuthorizationResponse":{"fields":{"actions":{"rule":"repeated","type":"string","id":1}}},"ChainConfig":{"fields":{"blockinterval":{"rule":"required","type":"sint64","id":1},"roster":{"rule":"required","type":"onet.Roster","id":2},"maxblocksize":{"rule":"required","type":"sint32","id":3},"darccontractids":{"rule":"repeated","type":"string","id":4}}},"Proof":{"fields":{"inclusionproof":{"rule":"required","type":"trie.Proof","id":1},"latest":{"rule":"required","type":"skipchain.SkipBlock","id":2},"links":{"rule":"repeated","type":"skipchain.ForwardLink","id":3,"options":{"packed":false}}}},"Instruction":{"fields":{"instanceid":{"rule":"required","type":"bytes","id":1},"spawn":{"type":"Spawn","id":2},"invoke":{"type":"Invoke","id":3},"delete":{"type":"Delete","id":4},"signercounter":{"rule":"repeated","type":"uint64","id":5,"options":{"packed":true}},"signeridentities":{"rule":"repeated","type":"darc.Identity","id":6,"options":{"packed":false}},"signatures":{"rule":"repeated","type":"bytes","id":7}}},"Spawn":{"fields":{"contractid":{"rule":"required","type":"string","id":1},"args":{"rule":"repeated","type":"Argument","id":2,"options":{"packed":false}}}},"Invoke":{"fields":{"contractid":{"rule":"required","type":"string","id":1},"command":{"rule":"required","type":"string","id":2},"args":{"rule":"repeated","type":"Argument","id":3,"options":{"packed":false}}}},"Delete":{"fields":{"contractid":{"rule":"required","type":"string","id":1},"args":{"rule":"repeated","type":"Argument","id":2,"options":{"packed":false}}}},"Argument":{"fields":{"name":{"rule":"required","type":"string","id":1},"value":{"rule":"required","type":"bytes","id":2}}},"ClientTransaction":{"fields":{"instructions":{"rule":"repeated","type":"Instruction","id":1,"options":{"packed":false}}}},"TxResult":{"fields":{"clienttransaction":{"rule":"required","type":"ClientTransaction","id":1},"accepted":{"rule":"required","type":"bool","id":2}}},"StateChange":{"fields":{"stateaction":{"rule":"required","type":"sint32","id":1},"instanceid":{"rule":"required","type":"bytes","id":2},"contractid":{"rule":"required","type":"string","id":3},"value":{"rule":"required","type":"bytes","id":4},"darcid":{"rule":"required","type":"bytes","id":5},"version":{"rule":"required","type":"uint64","id":6}}},"Coin":{"fields":{"name":{"rule":"required","type":"bytes","id":1},"value":{"rule":"required","type":"uint64","id":2}}},"StreamingRequest":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"StreamingResponse":{"fields":{"block":{"type":"skipchain.SkipBlock","id":1}}},"PaginateRequest":{"fields":{"startid":{"rule":"required","type":"bytes","id":1},"pagesize":{"rule":"required","type":"uint64","id":2},"numpages":{"rule":"required","type":"uint64","id":3},"backward":{"rule":"required","type":"bool","id":4}}},"PaginateResponse":{"fields":{"blocks":{"rule":"repeated","type":"skipchain.SkipBlock","id":1,"options":{"packed":false}},"pagenumber":{"rule":"required","type":"uint64","id":2},"backward":{"rule":"required","type":"bool","id":3},"errorcode":{"rule":"required","type":"uint64","id":4},"errortext":{"rule":"repeated","type":"string","id":5}}},"DownloadState":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"nonce":{"rule":"required","type":"uint64","id":2},"length":{"rule":"required","type":"sint32","id":3}}},"DownloadStateResponse":{"fields":{"keyvalues":{"rule":"repeated","type":"DBKeyValue","id":1,"options":{"packed":false}},"nonce":{"rule":"required","type":"uint64","id":2},"total":{"type":"sint32","id":3}}},"DBKeyValue":{"fields":{"key":{"rule":"required","type":"bytes","id":1},"value":{"rule":"required","type":"bytes","id":2}}},"StateChangeBody":{"fields":{"stateaction":{"rule":"required","type":"sint32","id":1},"contractid":{"rule":"required","type":"string","id":2},"value":{"rule":"required","type":"bytes","id":3},"version":{"rule":"required","type":"uint64","id":4},"darcid":{"rule":"required","type":"bytes","id":5}}},"GetSignerCounters":{"fields":{"signerids":{"rule":"repeated","type":"string","id":1},"skipchainid":{"rule":"required","type":"bytes","id":2}}},"GetSignerCountersResponse":{"fields":{"counters":{"rule":"repeated","type":"uint64","id":1,"options":{"packed":true}},"index":{"type":"uint64","id":2}}},"GetInstanceVersion":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2},"version":{"rule":"required","type":"uint64","id":3}}},"GetLastInstanceVersion":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2}}},"GetInstanceVersionResponse":{"fields":{"statechange":{"rule":"required","type":"StateChange","id":1},"blockindex":{"rule":"required","type":"sint32","id":2}}},"GetAllInstanceVersion":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2}}},"GetAllInstanceVersionResponse":{"fields":{"statechanges":{"rule":"repeated","type":"GetInstanceVersionResponse","id":1,"options":{"packed":false}}}},"CheckStateChangeValidity":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2},"version":{"rule":"required","type":"uint64","id":3}}},"CheckStateChangeValidityResponse":{"fields":{"statechanges":{"rule":"repeated","type":"StateChange","id":1,"options":{"packed":false}},"blockid":{"rule":"required","type":"bytes","id":2}}},"ResolveInstanceID":{"fields":{"skipchainid":{"rule":"required","type":"bytes","id":1},"darcid":{"rule":"required","type":"bytes","id":2},"name":{"rule":"required","type":"string","id":3}}},"ResolvedInstanceID":{"fields":{"instanceid":{"rule":"required","type":"bytes","id":1}}},"DebugRequest":{"fields":{"byzcoinid":{"type":"bytes","id":1}}},"DebugResponse":{"fields":{"byzcoins":{"rule":"repeated","type":"DebugResponseByzcoin","id":1,"options":{"packed":false}},"dump":{"rule":"repeated","type":"DebugResponseState","id":2,"options":{"packed":false}}}},"DebugResponseByzcoin":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"genesis":{"type":"skipchain.SkipBlock","id":2},"latest":{"type":"skipchain.SkipBlock","id":3}}},"DebugResponseState":{"fields":{"key":{"rule":"required","type":"bytes","id":1},"state":{"rule":"required","type":"StateChangeBody","id":2}}},"DebugRemoveRequest":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"signature":{"rule":"required","type":"bytes","id":2}}},"IDVersion":{"fields":{"id":{"rule":"required","type":"bytes","id":1},"version":{"rule":"required","type":"uint64","id":2}}},"GetUpdatesRequest":{"fields":{"instances":{"rule":"repeated","type":"IDVersion","id":1,"options":{"packed":false}},"flags":{"rule":"required","type":"uint64","id":2},"latestblockid":{"type":"bytes","id":3},"skipchainid":{"type":"bytes","id":4}}},"GetUpdatesReply":{"fields":{"proofs":{"rule":"repeated","type":"trie.Proof","id":1,"options":{"packed":false}},"links":{"rule":"repeated","type":"skipchain.ForwardLink","id":2,"options":{"packed":false}},"latest":{"type":"skipchain.SkipBlock","id":3}}}}},"skipchain":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"SkipchainProto"},"nested":{"StoreSkipBlock":{"fields":{"targetSkipChainID":{"rule":"required","type":"bytes","id":1},"newBlock":{"rule":"required","type":"SkipBlock","id":2},"signature":{"type":"bytes","id":3}}},"StoreSkipBlockReply":{"fields":{"previous":{"type":"SkipBlock","id":1},"latest":{"rule":"required","type":"SkipBlock","id":2}}},"GetAllSkipChainIDs":{"fields":{}},"GetAllSkipChainIDsReply":{"fields":{"skipChainIDs":{"rule":"repeated","type":"bytes","id":1}}},"GetSingleBlock":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"GetSingleBlockByIndex":{"fields":{"genesis":{"rule":"required","type":"bytes","id":1},"index":{"rule":"required","type":"sint32","id":2}}},"GetSingleBlockByIndexReply":{"fields":{"skipblock":{"rule":"required","type":"SkipBlock","id":1},"links":{"rule":"repeated","type":"ForwardLink","id":2,"options":{"packed":false}}}},"GetUpdateChain":{"fields":{"latestID":{"rule":"required","type":"bytes","id":1},"maxHeight":{"type":"sint32","id":2},"maxBlocks":{"type":"sint32","id":3}}},"GetUpdateChainReply":{"fields":{"update":{"rule":"repeated","type":"SkipBlock","id":1,"options":{"packed":false}}}},"SkipBlock":{"fields":{"index":{"rule":"required","type":"sint32","id":1},"height":{"rule":"required","type":"sint32","id":2},"maxHeight":{"rule":"required","type":"sint32","id":3},"baseHeight":{"rule":"required","type":"sint32","id":4},"backlinks":{"rule":"repeated","type":"bytes","id":5},"verifiers":{"rule":"repeated","type":"bytes","id":6},"genesis":{"rule":"required","type":"bytes","id":7},"data":{"rule":"required","type":"bytes","id":8},"roster":{"rule":"required","type":"onet.Roster","id":9},"hash":{"rule":"required","type":"bytes","id":10},"forward":{"rule":"repeated","type":"ForwardLink","id":11,"options":{"packed":false}},"payload":{"type":"bytes","id":12},"signatureScheme":{"type":"uint32","id":13}}},"ForwardLink":{"fields":{"from":{"rule":"required","type":"bytes","id":1},"to":{"rule":"required","type":"bytes","id":2},"newRoster":{"type":"onet.Roster","id":3},"signature":{"rule":"required","type":"ByzcoinSig","id":4}}},"ByzcoinSig":{"fields":{"msg":{"rule":"required","type":"bytes","id":1},"sig":{"rule":"required","type":"bytes","id":2}}},"SchnorrSig":{"fields":{"challenge":{"rule":"required","type":"bytes","id":1},"response":{"rule":"required","type":"bytes","id":2}}},"Exception":{"fields":{"index":{"rule":"required","type":"sint32","id":1},"commitment":{"rule":"required","type":"bytes","id":2}}}}},"onet":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"OnetProto"},"nested":{"Roster":{"fields":{"id":{"type":"bytes","id":1},"list":{"rule":"repeated","type":"network.ServerIdentity","id":2,"options":{"packed":false}},"aggregate":{"rule":"required","type":"bytes","id":3}}},"Status":{"fields":{"field":{"keyType":"string","type":"string","id":1}}}}},"network":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"NetworkProto"},"nested":{"ServerIdentity":{"fields":{"public":{"rule":"required","type":"bytes","id":1},"serviceIdentities":{"rule":"repeated","type":"ServiceIdentity","id":2,"options":{"packed":false}},"id":{"rule":"required","type":"bytes","id":3},"address":{"rule":"required","type":"string","id":4},"description":{"rule":"required","type":"string","id":5},"url":{"type":"string","id":7}}},"ServiceIdentity":{"fields":{"name":{"rule":"required","type":"string","id":1},"suite":{"rule":"required","type":"string","id":2},"public":{"rule":"required","type":"bytes","id":3}}}}},"darc":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"DarcProto"},"nested":{"Darc":{"fields":{"version":{"rule":"required","type":"uint64","id":1},"description":{"rule":"required","type":"bytes","id":2},"baseid":{"type":"bytes","id":3},"previd":{"rule":"required","type":"bytes","id":4},"rules":{"rule":"required","type":"Rules","id":5},"signatures":{"rule":"repeated","type":"Signature","id":6,"options":{"packed":false}},"verificationdarcs":{"rule":"repeated","type":"Darc","id":7,"options":{"packed":false}}}},"Identity":{"fields":{"darc":{"type":"IdentityDarc","id":1},"ed25519":{"type":"IdentityEd25519","id":2},"x509ec":{"type":"IdentityX509EC","id":3},"proxy":{"type":"IdentityProxy","id":4},"evmcontract":{"type":"IdentityEvmContract","id":5},"did":{"type":"IdentityDID","id":6},"tsm":{"type":"IdentityTSM","id":7}}},"IdentityEd25519":{"fields":{"point":{"rule":"required","type":"bytes","id":1}}},"IdentityTSM":{"fields":{"publickey":{"rule":"required","type":"bytes","id":1}}},"IdentityX509EC":{"fields":{"public":{"rule":"required","type":"bytes","id":1}}},"IdentityProxy":{"fields":{"data":{"rule":"required","type":"string","id":1},"public":{"rule":"required","type":"bytes","id":2}}},"IdentityDarc":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"IdentityEvmContract":{"fields":{"address":{"rule":"required","type":"bytes","id":1}}},"IdentityDID":{"fields":{"did":{"rule":"required","type":"string","id":1},"diddoc":{"type":"DIDDoc","id":2},"method":{"rule":"required","type":"string","id":3}}},"DIDDoc":{"fields":{"context":{"rule":"repeated","type":"string","id":1},"id":{"rule":"required","type":"string","id":2},"publickey":{"rule":"repeated","type":"PublicKey","id":3,"options":{"packed":false}},"service":{"rule":"repeated","type":"DIDService","id":4,"options":{"packed":false}},"authentication":{"rule":"repeated","type":"VerificationMethod","id":5,"options":{"packed":false}}}},"PublicKey":{"fields":{"id":{"rule":"required","type":"string","id":1},"type":{"rule":"required","type":"string","id":2},"controller":{"rule":"required","type":"string","id":3},"value":{"rule":"required","type":"bytes","id":4}}},"DIDService":{"fields":{"id":{"rule":"required","type":"string","id":1},"type":{"rule":"required","type":"string","id":2},"priority":{"rule":"required","type":"sint32","id":3},"recipientkeys":{"rule":"repeated","type":"string","id":4},"routingkeys":{"rule":"repeated","type":"string","id":5},"serviceendpoint":{"rule":"required","type":"string","id":6}}},"VerificationMethod":{"fields":{"publickey":{"rule":"required","type":"PublicKey","id":1}}},"Signature":{"fields":{"signature":{"rule":"required","type":"bytes","id":1},"signer":{"rule":"required","type":"Identity","id":2}}},"Signer":{"fields":{"ed25519":{"type":"SignerEd25519","id":1},"x509ec":{"type":"SignerX509EC","id":2},"proxy":{"type":"SignerProxy","id":3},"evmcontract":{"type":"SignerEvmContract","id":4},"did":{"type":"SignerDID","id":5}}},"SignerEd25519":{"fields":{"point":{"rule":"required","type":"bytes","id":1},"secret":{"rule":"required","type":"bytes","id":2}}},"SignerX509EC":{"fields":{"point":{"rule":"required","type":"bytes","id":1}}},"SignerProxy":{"fields":{"data":{"rule":"required","type":"string","id":1},"public":{"rule":"required","type":"bytes","id":2}}},"SignerEvmContract":{"fields":{"address":{"rule":"required","type":"bytes","id":1}}},"SignerDID":{"fields":{"public":{"rule":"required","type":"bytes","id":1},"secret":{"rule":"required","type":"bytes","id":2},"did":{"rule":"required","type":"string","id":3}}},"Request":{"fields":{"baseid":{"rule":"required","type":"bytes","id":1},"action":{"rule":"required","type":"string","id":2},"msg":{"rule":"required","type":"bytes","id":3},"identities":{"rule":"repeated","type":"Identity","id":4,"options":{"packed":false}},"signatures":{"rule":"repeated","type":"bytes","id":5}}},"Rules":{"fields":{"list":{"rule":"repeated","type":"Rule","id":1,"options":{"packed":false}}}},"Rule":{"fields":{"action":{"rule":"required","type":"string","id":1},"expr":{"rule":"required","type":"bytes","id":2}}}}},"trie":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"TrieProto"},"nested":{"InteriorNode":{"fields":{"left":{"rule":"required","type":"bytes","id":1},"right":{"rule":"required","type":"bytes","id":2}}},"EmptyNode":{"fields":{"prefix":{"rule":"repeated","type":"bool","id":1,"options":{"packed":true}}}},"LeafNode":{"fields":{"prefix":{"rule":"repeated","type":"bool","id":1,"options":{"packed":true}},"key":{"rule":"required","type":"bytes","id":2},"value":{"rule":"required","type":"bytes","id":3}}},"Proof":{"fields":{"interiors":{"rule":"repeated","type":"InteriorNode","id":1,"options":{"packed":false}},"leaf":{"rule":"required","type":"LeafNode","id":2},"empty":{"rule":"required","type":"EmptyNode","id":3},"nonce":{"rule":"required","type":"bytes","id":4}}}}},"calypso":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"Calypso"},"nested":{"Write":{"fields":{"data":{"rule":"required","type":"bytes","id":1},"u":{"rule":"required","type":"bytes","id":2},"ubar":{"rule":"required","type":"bytes","id":3},"e":{"rule":"required","type":"bytes","id":4},"f":{"rule":"required","type":"bytes","id":5},"c":{"rule":"required","type":"bytes","id":6},"extradata":{"type":"bytes","id":7},"ltsid":{"rule":"required","type":"bytes","id":8},"cost":{"type":"byzcoin.Coin","id":9}}},"Read":{"fields":{"write":{"rule":"required","type":"bytes","id":1},"xc":{"rule":"required","type":"bytes","id":2}}},"Authorise":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1}}},"AuthoriseReply":{"fields":{}},"Authorize":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"timestamp":{"type":"sint64","id":2},"signature":{"type":"bytes","id":3}}},"AuthorizeReply":{"fields":{}},"CreateLTS":{"fields":{"proof":{"rule":"required","type":"byzcoin.Proof","id":1}}},"CreateLTSReply":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"instanceid":{"rule":"required","type":"bytes","id":2},"x":{"rule":"required","type":"bytes","id":3}}},"ReshareLTS":{"fields":{"proof":{"rule":"required","type":"byzcoin.Proof","id":1}}},"ReshareLTSReply":{"fields":{}},"UpdateValidPeers":{"fields":{"proof":{"rule":"required","type":"byzcoin.Proof","id":1}}},"UpdateValidPeersReply":{"fields":{}},"DecryptKey":{"fields":{"read":{"rule":"required","type":"byzcoin.Proof","id":1},"write":{"rule":"required","type":"byzcoin.Proof","id":2}}},"DecryptKeyReply":{"fields":{"c":{"rule":"required","type":"bytes","id":1},"xhatenc":{"rule":"required","type":"bytes","id":2},"x":{"rule":"required","type":"bytes","id":3}}},"GetLTSReply":{"fields":{"ltsid":{"rule":"required","type":"bytes","id":1}}},"LtsInstanceInfo":{"fields":{"roster":{"rule":"required","type":"onet.Roster","id":1}}}}},"eventlog":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"EventLogProto"},"nested":{"SearchRequest":{"fields":{"instance":{"rule":"required","type":"bytes","id":1},"id":{"rule":"required","type":"bytes","id":2},"topic":{"rule":"required","type":"string","id":3},"from":{"rule":"required","type":"sint64","id":4},"to":{"rule":"required","type":"sint64","id":5}}},"SearchResponse":{"fields":{"events":{"rule":"repeated","type":"Event","id":1,"options":{"packed":false}},"truncated":{"rule":"required","type":"bool","id":2}}},"Event":{"fields":{"when":{"rule":"required","type":"sint64","id":1},"topic":{"rule":"required","type":"string","id":2},"content":{"rule":"required","type":"string","id":3}}}}},"evoting":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"Evoting"},"nested":{"Transaction":{"fields":{"master":{"type":"Master","id":1},"link":{"type":"Link","id":2},"election":{"type":"Election","id":3},"ballot":{"type":"Ballot","id":4},"mix":{"type":"Mix","id":5},"partial":{"type":"Partial","id":6},"user":{"rule":"required","type":"uint32","id":7},"signature":{"rule":"required","type":"bytes","id":8}}},"Master":{"fields":{"id":{"rule":"required","type":"bytes","id":1},"roster":{"type":"onet.Roster","id":2},"admins":{"rule":"repeated","type":"uint32","id":3,"options":{"packed":true}},"key":{"rule":"required","type":"bytes","id":4}}},"Link":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"Election":{"fields":{"name":{"keyType":"string","type":"string","id":1},"creator":{"rule":"required","type":"uint32","id":2},"users":{"rule":"repeated","type":"uint32","id":3,"options":{"packed":true}},"id":{"rule":"required","type":"bytes","id":4},"master":{"rule":"required","type":"bytes","id":5},"roster":{"type":"onet.Roster","id":6},"key":{"rule":"required","type":"bytes","id":7},"masterkey":{"rule":"required","type":"bytes","id":8},"stage":{"rule":"required","type":"uint32","id":9},"candidates":{"rule":"repeated","type":"uint32","id":10,"options":{"packed":true}},"maxchoices":{"rule":"required","type":"sint32","id":11},"subtitle":{"keyType":"string","type":"string","id":12},"moreinfo":{"rule":"required","type":"string","id":13},"start":{"rule":"required","type":"sint64","id":14},"end":{"rule":"required","type":"sint64","id":15},"theme":{"rule":"required","type":"string","id":16},"footer":{"rule":"required","type":"Footer","id":17},"voted":{"rule":"required","type":"bytes","id":18},"moreinfolang":{"keyType":"string","type":"string","id":19}}},"Footer":{"fields":{"text":{"rule":"required","type":"string","id":1},"contacttitle":{"rule":"required","type":"string","id":2},"contactphone":{"rule":"required","type":"string","id":3},"contactemail":{"rule":"required","type":"string","id":4}}},"Ballot":{"fields":{"user":{"rule":"required","type":"uint32","id":1},"alpha":{"rule":"required","type":"bytes","id":2},"beta":{"rule":"required","type":"bytes","id":3},"additionalalphas":{"rule":"repeated","type":"bytes","id":4},"additionalbetas":{"rule":"repeated","type":"bytes","id":5}}},"Mix":{"fields":{"ballots":{"rule":"repeated","type":"Ballot","id":1,"options":{"packed":false}},"proof":{"rule":"required","type":"bytes","id":2},"nodeid":{"rule":"required","type":"bytes","id":3},"signature":{"rule":"required","type":"bytes","id":4}}},"Partial":{"fields":{"points":{"rule":"repeated","type":"bytes","id":1},"nodeid":{"rule":"required","type":"bytes","id":2},"signature":{"rule":"required","type":"bytes","id":3},"additionalpoints":{"rule":"repeated","type":"PartialAdditional","id":4,"options":{"packed":false}}}},"PartialAdditional":{"fields":{"additionalpoints":{"rule":"repeated","type":"bytes","id":1}}}}},"evoting_api":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"EvotingAPI"},"nested":{"Reconstruct":{"fields":{"id":{"rule":"required","type":"bytes","id":1}}},"ReconstructReply":{"fields":{"points":{"rule":"repeated","type":"bytes","id":1},"additionalpoints":{"rule":"repeated","type":"AddPoints","id":2,"options":{"packed":false}}}},"AddPoints":{"fields":{"additionalpoints":{"rule":"repeated","type":"bytes","id":1}}},"Ping":{"fields":{"nonce":{"rule":"required","type":"uint32","id":1}}}}},"personhood":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"Personhood"},"nested":{"RoPaSci":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"ropasciid":{"rule":"required","type":"bytes","id":2},"locked":{"type":"sint64","id":3}}},"RoPaSciStruct":{"fields":{"description":{"rule":"required","type":"string","id":1},"stake":{"rule":"required","type":"byzcoin.Coin","id":2},"firstplayerhash":{"rule":"required","type":"bytes","id":3},"firstplayer":{"type":"sint32","id":4},"secondplayer":{"type":"sint32","id":5},"secondplayeraccount":{"type":"bytes","id":6},"firstplayeraccount":{"type":"bytes","id":7},"calypsowrite":{"type":"bytes","id":8},"calypsoread":{"type":"bytes","id":9}}},"CredentialStruct":{"fields":{"credentials":{"rule":"repeated","type":"Credential","id":1,"options":{"packed":false}}}},"Credential":{"fields":{"name":{"rule":"required","type":"string","id":1},"attributes":{"rule":"repeated","type":"Attribute","id":2,"options":{"packed":false}}}},"Attribute":{"fields":{"name":{"rule":"required","type":"string","id":1},"value":{"rule":"required","type":"bytes","id":2}}},"SpawnerStruct":{"fields":{"costdarc":{"rule":"required","type":"byzcoin.Coin","id":1},"costcoin":{"rule":"required","type":"byzcoin.Coin","id":2},"costcredential":{"rule":"required","type":"byzcoin.Coin","id":3},"costparty":{"rule":"required","type":"byzcoin.Coin","id":4},"beneficiary":{"rule":"required","type":"bytes","id":5},"costropasci":{"type":"byzcoin.Coin","id":6},"costcwrite":{"type":"byzcoin.Coin","id":7},"costcread":{"type":"byzcoin.Coin","id":8},"costvalue":{"type":"byzcoin.Coin","id":9}}},"PopPartyStruct":{"fields":{"state":{"rule":"required","type":"sint32","id":1},"organizers":{"rule":"required","type":"sint32","id":2},"finalizations":{"rule":"repeated","type":"string","id":3},"description":{"rule":"required","type":"PopDesc","id":4},"attendees":{"rule":"required","type":"Attendees","id":5},"miners":{"rule":"repeated","type":"LRSTag","id":6,"options":{"packed":false}},"miningreward":{"rule":"required","type":"uint64","id":7},"previous":{"type":"bytes","id":8},"next":{"type":"bytes","id":9}}},"PopDesc":{"fields":{"name":{"rule":"required","type":"string","id":1},"purpose":{"rule":"required","type":"string","id":2},"datetime":{"rule":"required","type":"uint64","id":3},"location":{"rule":"required","type":"string","id":4}}},"FinalStatement":{"fields":{"desc":{"type":"PopDesc","id":1},"attendees":{"rule":"required","type":"Attendees","id":2}}},"Attendees":{"fields":{"keys":{"rule":"repeated","type":"bytes","id":1}}},"LRSTag":{"fields":{"tag":{"rule":"required","type":"bytes","id":1}}}}},"personhood_service":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"PersonhoodService"},"nested":{"PartyList":{"fields":{"newparty":{"type":"Party","id":1},"wipeparties":{"type":"bool","id":2},"partydelete":{"type":"PartyDelete","id":3}}},"PartyDelete":{"fields":{"partyid":{"rule":"required","type":"bytes","id":1},"identity":{"rule":"required","type":"darc.Identity","id":2},"signature":{"rule":"required","type":"bytes","id":3}}},"PartyListResponse":{"fields":{"parties":{"rule":"repeated","type":"Party","id":1,"options":{"packed":false}}}},"Party":{"fields":{"roster":{"rule":"required","type":"onet.Roster","id":1},"byzcoinid":{"rule":"required","type":"bytes","id":2},"instanceid":{"rule":"required","type":"bytes","id":3}}},"RoPaSciList":{"fields":{"newropasci":{"type":"personhood.RoPaSci","id":1},"wipe":{"type":"bool","id":2},"lock":{"type":"personhood.RoPaSci","id":3}}},"RoPaSciListResponse":{"fields":{"ropascis":{"rule":"repeated","type":"personhood.RoPaSci","id":1,"options":{"packed":false}}}},"StringReply":{"fields":{"reply":{"rule":"required","type":"string","id":1}}},"Poll":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"newpoll":{"type":"PollStruct","id":2},"list":{"type":"PollList","id":3},"answer":{"type":"PollAnswer","id":4},"delete":{"type":"PollDelete","id":5}}},"PollDelete":{"fields":{"identity":{"rule":"required","type":"darc.Identity","id":1},"pollid":{"rule":"required","type":"bytes","id":2},"signature":{"rule":"required","type":"bytes","id":3}}},"PollList":{"fields":{"partyids":{"rule":"repeated","type":"bytes","id":1}}},"PollAnswer":{"fields":{"pollid":{"rule":"required","type":"bytes","id":1},"choice":{"rule":"required","type":"sint32","id":2},"lrs":{"rule":"required","type":"bytes","id":3},"partyid":{"type":"bytes","id":4}}},"PollStruct":{"fields":{"personhood":{"rule":"required","type":"bytes","id":1},"pollid":{"type":"bytes","id":2},"title":{"rule":"required","type":"string","id":3},"description":{"rule":"required","type":"string","id":4},"choices":{"rule":"repeated","type":"string","id":5},"chosen":{"rule":"repeated","type":"PollChoice","id":6,"options":{"packed":false}}}},"PollChoice":{"fields":{"choice":{"rule":"required","type":"sint32","id":1},"lrstag":{"rule":"required","type":"bytes","id":2}}},"PollResponse":{"fields":{"polls":{"rule":"repeated","type":"PollStruct","id":1,"options":{"packed":false}}}},"Capabilities":{"fields":{}},"CapabilitiesResponse":{"fields":{"capabilities":{"rule":"repeated","type":"Capability","id":1,"options":{"packed":false}}}},"Capability":{"fields":{"endpoint":{"rule":"required","type":"string","id":1},"version":{"rule":"required","type":"bytes","id":2}}},"UserLocation":{"fields":{"publickey":{"rule":"required","type":"bytes","id":1},"credentialiid":{"type":"bytes","id":2},"credential":{"type":"personhood.CredentialStruct","id":3},"location":{"type":"string","id":4},"time":{"rule":"required","type":"sint64","id":5}}},"Meetup":{"fields":{"userlocation":{"type":"UserLocation","id":1},"wipe":{"type":"bool","id":2}}},"MeetupResponse":{"fields":{"users":{"rule":"repeated","type":"UserLocation","id":1,"options":{"packed":false}}}},"Challenge":{"fields":{"update":{"type":"ChallengeCandidate","id":1}}},"ChallengeCandidate":{"fields":{"credential":{"rule":"required","type":"bytes","id":1},"score":{"rule":"required","type":"sint32","id":2},"signup":{"rule":"required","type":"sint64","id":3}}},"ChallengeReply":{"fields":{"list":{"rule":"repeated","type":"ChallengeCandidate","id":1,"options":{"packed":false}}}},"GetAdminDarcIDs":{"fields":{}},"GetAdminDarcIDsReply":{"fields":{"admindarcids":{"rule":"repeated","type":"bytes","id":1}}},"SetAdminDarcIDs":{"fields":{"newadmindarcids":{"rule":"repeated","type":"bytes","id":1},"signature":{"rule":"required","type":"bytes","id":2}}},"SetAdminDarcIDsReply":{"fields":{}},"EmailSetup":{"fields":{"byzcoinid":{"rule":"required","type":"bytes","id":1},"roster":{"rule":"required","type":"onet.Roster","id":2},"deviceurl":{"rule":"required","type":"string","id":3},"emaildarcid":{"rule":"required","type":"bytes","id":4},"smtphost":{"rule":"required","type":"string","id":5},"smtpfrom":{"rule":"required","type":"string","id":6},"smtpreplyto":{"rule":"required","type":"string","id":7},"baseurl":{"rule":"required","type":"string","id":8},"signature":{"rule":"required","type":"bytes","id":9}}},"EmailSetupReply":{"fields":{}},"EmailSignup":{"fields":{"email":{"rule":"required","type":"string","id":1},"alias":{"rule":"required","type":"string","id":2}}},"EmailSignupReply":{"fields":{"status":{"rule":"required","type":"sint32","id":1}}},"EmailRecover":{"fields":{"email":{"rule":"required","type":"string","id":1}}},"EmailRecoverReply":{"fields":{"status":{"rule":"required","type":"sint32","id":1}}}}},"status":{"options":{"java_package":"ch.epfl.dedis.lib.proto","java_outer_classname":"StatusProto"},"nested":{"Request":{"fields":{}},"Response":{"fields":{"status":{"keyType":"string","type":"onet.Status","id":1},"serveridentity":{"type":"network.ServerIdentity","id":2}}},"CheckConnectivity":{"fields":{"time":{"rule":"required","type":"sint64","id":1},"timeout":{"rule":"required","type":"sint64","id":2},"findfaulty":{"rule":"required","type":"bool","id":3},"list":{"rule":"repeated","type":"network.ServerIdentity","id":4,"options":{"packed":false}},"signature":{"rule":"required","type":"bytes","id":5}}},"CheckConnectivityReply":{"fields":{"nodes":{"rule":"repeated","type":"network.ServerIdentity","id":1,"options":{"packed":false}}}}}}}} diff --git a/external/proto/evoting.proto b/external/proto/evoting.proto index e690d72f5a..c23b761bc3 100644 --- a/external/proto/evoting.proto +++ b/external/proto/evoting.proto @@ -101,6 +101,11 @@ message Ballot { // ElGamal ciphertext pair. required bytes alpha = 2; required bytes beta = 3; + // 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. + repeated bytes additionalalphas = 4; + repeated bytes additionalbetas = 5; } // Mix contains the shuffled ballots. @@ -123,4 +128,14 @@ message Partial { required bytes nodeid = 2; // Signature of the public key required bytes signature = 3; + // Additional points from decrypted plaintexts. + // To keep backward-compatibility in the resulting protobuf, + // these points are added at the end of the structure. + repeated PartialAdditional additionalpoints = 4; +} + +// PartialAdditional is used because protobuf cannot handle array of array of bytes. +message PartialAdditional { + // All additional points from a single voter. + repeated bytes additionalpoints = 1; } diff --git a/external/proto/evoting_api.proto b/external/proto/evoting_api.proto new file mode 100644 index 0000000000..71e538b6dc --- /dev/null +++ b/external/proto/evoting_api.proto @@ -0,0 +1,31 @@ +syntax = "proto2"; +package evoting_api; + +option java_package = "ch.epfl.dedis.lib.proto"; +option java_outer_classname = "EvotingAPI"; + +// Reconstruct message. +message Reconstruct { + // ID of the election skipchain. + required bytes id = 1; +} + +// ReconstructReply message. +message ReconstructReply { + // Points are the decrypted plaintexts. + repeated bytes points = 1; + // Eventual additional points - only if more than 9 candidates + repeated AddPoints additionalpoints = 2; +} + +// AddPoints if maxChoices > 9 +message AddPoints { + // The additional Points + repeated bytes additionalpoints = 1; +} + +// Ping message. +message Ping { + // Nonce can be any integer. + required uint32 nonce = 1; +} diff --git a/go.mod b/go.mod index 9075179fb6..8ef829dda3 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/stretchr/testify v1.5.1 github.com/syndtr/goleveldb v1.0.0 // indirect github.com/urfave/cli v1.22.3 - go.dedis.ch/kyber/v3 v3.0.13 + go.dedis.ch/kyber/v3 v3.1.0 go.dedis.ch/onet/v3 v3.2.10 go.dedis.ch/protobuf v1.0.11 go.etcd.io/bbolt v1.3.4 diff --git a/go.sum b/go.sum index 7875c575bc..6a934a69ec 100644 --- a/go.sum +++ b/go.sum @@ -252,8 +252,9 @@ go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= go.dedis.ch/kyber/v3 v3.0.9/go.mod h1:rhNjUUg6ahf8HEg5HUvVBYoWY4boAafX8tYxX+PS+qg= -go.dedis.ch/kyber/v3 v3.0.13 h1:s5Lm8p2/CsTMueQHCN24gPpZ4couBBeKU7r2Yl6r32o= go.dedis.ch/kyber/v3 v3.0.13/go.mod h1:kXy7p3STAurkADD+/aZcsznZGKVHEqbtmdIzvPfrs1U= +go.dedis.ch/kyber/v3 v3.1.0 h1:ghu+kiRgM5JyD9TJ0hTIxTLQlJBR/ehjWvWwYW3XsC0= +go.dedis.ch/kyber/v3 v3.1.0/go.mod h1:kXy7p3STAurkADD+/aZcsznZGKVHEqbtmdIzvPfrs1U= go.dedis.ch/onet/v3 v3.2.10 h1:922Do54I7qxANwTuGcLEcOIzXH8n0FuEnZlmS37bmjU= go.dedis.ch/onet/v3 v3.2.10/go.mod h1:2TpqrnrRcefCXQuoU5OPmDtUJZGLvIVc1ZKW9NpOTsY= go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo=