diff options
author | Florian Dold <florian.dold@gmail.com> | 2014-02-25 11:15:15 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2014-02-25 11:15:15 +0000 |
commit | 85d0048c22271fac371729ba7b14417a28bb6b48 (patch) | |
tree | de231f5453baed5b406bb88b19496d16530f3850 /src/main/java/org/gnunet/voting/messages | |
parent | 989f297285b843cb631836bf42e47f25fb567418 (diff) | |
download | gnunet-java-85d0048c22271fac371729ba7b14417a28bb6b48.tar.gz gnunet-java-85d0048c22271fac371729ba7b14417a28bb6b48.zip |
- support mesh's new NACK message
- remove
- python test skeleton for voting
- encrypted votes
- establish threshold key during ballot registration
- ballot tool can request threshold public keys from authorities
Diffstat (limited to 'src/main/java/org/gnunet/voting/messages')
8 files changed, 149 insertions, 7 deletions
diff --git a/src/main/java/org/gnunet/voting/messages/KeyQueryFailureMessage.java b/src/main/java/org/gnunet/voting/messages/KeyQueryFailureMessage.java new file mode 100644 index 0000000..ae48bad --- /dev/null +++ b/src/main/java/org/gnunet/voting/messages/KeyQueryFailureMessage.java | |||
@@ -0,0 +1,11 @@ | |||
1 | package org.gnunet.voting.messages; | ||
2 | |||
3 | import org.gnunet.construct.UnionCase; | ||
4 | import org.gnunet.construct.ZeroTerminatedString; | ||
5 | import org.gnunet.util.GnunetMessage; | ||
6 | |||
7 | @UnionCase(42015) | ||
8 | public class KeyQueryFailureMessage implements GnunetMessage.Body { | ||
9 | @ZeroTerminatedString | ||
10 | public String reason; | ||
11 | } | ||
diff --git a/src/main/java/org/gnunet/voting/messages/KeyQueryMessage.java b/src/main/java/org/gnunet/voting/messages/KeyQueryMessage.java new file mode 100644 index 0000000..37da763 --- /dev/null +++ b/src/main/java/org/gnunet/voting/messages/KeyQueryMessage.java | |||
@@ -0,0 +1,12 @@ | |||
1 | package org.gnunet.voting.messages; | ||
2 | |||
3 | import org.gnunet.construct.NestedMessage; | ||
4 | import org.gnunet.construct.UnionCase; | ||
5 | import org.gnunet.util.GnunetMessage; | ||
6 | import org.gnunet.util.HashCode; | ||
7 | |||
8 | @UnionCase(42013) | ||
9 | public class KeyQueryMessage implements GnunetMessage.Body { | ||
10 | @NestedMessage | ||
11 | public HashCode ballotGuid; | ||
12 | } | ||
diff --git a/src/main/java/org/gnunet/voting/messages/KeyQueryResponseMessage.java b/src/main/java/org/gnunet/voting/messages/KeyQueryResponseMessage.java new file mode 100644 index 0000000..c94332a --- /dev/null +++ b/src/main/java/org/gnunet/voting/messages/KeyQueryResponseMessage.java | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2014 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | package org.gnunet.voting.messages; | ||
22 | |||
23 | import org.gnunet.construct.Message; | ||
24 | import org.gnunet.construct.NestedMessage; | ||
25 | import org.gnunet.construct.UInt32; | ||
26 | import org.gnunet.construct.UnionCase; | ||
27 | import org.gnunet.secretsharing.ThresholdPublicKey; | ||
28 | import org.gnunet.util.GnunetMessage; | ||
29 | import org.gnunet.util.HashCode; | ||
30 | import org.gnunet.util.crypto.EddsaSignature; | ||
31 | |||
32 | @UnionCase(42014) | ||
33 | public class KeyQueryResponseMessage implements GnunetMessage.Body { | ||
34 | |||
35 | public static class BallotPublicKey implements Message { | ||
36 | @NestedMessage | ||
37 | public HashCode ballotGuid; | ||
38 | |||
39 | @NestedMessage | ||
40 | public ThresholdPublicKey publicKey; | ||
41 | } | ||
42 | |||
43 | @NestedMessage | ||
44 | public EddsaSignature signature; | ||
45 | |||
46 | @UInt32 | ||
47 | public int purpose; | ||
48 | |||
49 | @NestedMessage | ||
50 | public BallotPublicKey signedGuidKey; | ||
51 | } | ||
diff --git a/src/main/java/org/gnunet/voting/messages/ResultQueryFailureMessage.java b/src/main/java/org/gnunet/voting/messages/ResultQueryFailureMessage.java new file mode 100644 index 0000000..9b9ef49 --- /dev/null +++ b/src/main/java/org/gnunet/voting/messages/ResultQueryFailureMessage.java | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2012, 2013 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | package org.gnunet.voting.messages; | ||
22 | |||
23 | import org.gnunet.construct.UnionCase; | ||
24 | import org.gnunet.construct.ZeroTerminatedString; | ||
25 | import org.gnunet.util.GnunetMessage; | ||
26 | |||
27 | @UnionCase(42009) | ||
28 | public class ResultQueryFailureMessage implements GnunetMessage.Body { | ||
29 | @ZeroTerminatedString | ||
30 | public String reason; | ||
31 | } | ||
diff --git a/src/main/java/org/gnunet/voting/messages/ResultQueryMessage.java b/src/main/java/org/gnunet/voting/messages/ResultQueryMessage.java new file mode 100644 index 0000000..13f0b04 --- /dev/null +++ b/src/main/java/org/gnunet/voting/messages/ResultQueryMessage.java | |||
@@ -0,0 +1,12 @@ | |||
1 | package org.gnunet.voting.messages; | ||
2 | |||
3 | import org.gnunet.construct.NestedMessage; | ||
4 | import org.gnunet.construct.UnionCase; | ||
5 | import org.gnunet.util.GnunetMessage; | ||
6 | import org.gnunet.util.HashCode; | ||
7 | |||
8 | @UnionCase(42005) | ||
9 | public class ResultQueryMessage implements GnunetMessage.Body { | ||
10 | @NestedMessage | ||
11 | public HashCode ballotGuid; | ||
12 | } | ||
diff --git a/src/main/java/org/gnunet/voting/messages/ResultQueryResponseMessage.java b/src/main/java/org/gnunet/voting/messages/ResultQueryResponseMessage.java new file mode 100644 index 0000000..96ad4b5 --- /dev/null +++ b/src/main/java/org/gnunet/voting/messages/ResultQueryResponseMessage.java | |||
@@ -0,0 +1,12 @@ | |||
1 | package org.gnunet.voting.messages; | ||
2 | |||
3 | |||
4 | import org.gnunet.construct.*; | ||
5 | import org.gnunet.util.GnunetMessage; | ||
6 | import org.gnunet.util.HashCode; | ||
7 | |||
8 | @UnionCase(42006) | ||
9 | public class ResultQueryResponseMessage implements GnunetMessage.Body { | ||
10 | @IntegerFill(signed = false, bitSize = 32) | ||
11 | public long[] results; | ||
12 | } | ||
diff --git a/src/main/java/org/gnunet/voting/messages/SubmitFailureMessage.java b/src/main/java/org/gnunet/voting/messages/SubmitFailureMessage.java index 50751fb..9aec8b2 100644 --- a/src/main/java/org/gnunet/voting/messages/SubmitFailureMessage.java +++ b/src/main/java/org/gnunet/voting/messages/SubmitFailureMessage.java | |||
@@ -22,17 +22,27 @@ package org.gnunet.voting.messages; | |||
22 | 22 | ||
23 | 23 | ||
24 | import org.gnunet.construct.NestedMessage; | 24 | import org.gnunet.construct.NestedMessage; |
25 | import org.gnunet.construct.UInt32; | ||
25 | import org.gnunet.construct.UnionCase; | 26 | import org.gnunet.construct.UnionCase; |
26 | import org.gnunet.construct.ZeroTerminatedString; | 27 | import org.gnunet.construct.ZeroTerminatedString; |
27 | import org.gnunet.util.AbsoluteTimeMessage; | 28 | import org.gnunet.util.AbsoluteTimeMessage; |
28 | import org.gnunet.util.GnunetMessage; | 29 | import org.gnunet.util.GnunetMessage; |
29 | import org.gnunet.util.crypto.EcdsaSignedMessage; | 30 | import org.gnunet.util.crypto.EddsaSignature; |
30 | import org.gnunet.util.crypto.EddsaSignedMessage; | ||
31 | 31 | ||
32 | @UnionCase(42010) | 32 | @UnionCase(42010) |
33 | public class SubmitFailureMessage implements GnunetMessage.Body { | 33 | public class SubmitFailureMessage implements GnunetMessage.Body { |
34 | public static class SignedAuthorityTime { | ||
35 | @NestedMessage | ||
36 | public EddsaSignature signature; | ||
37 | @UInt32 | ||
38 | public int purpose; | ||
39 | @NestedMessage | ||
40 | public AbsoluteTimeMessage time; | ||
41 | } | ||
42 | |||
34 | @ZeroTerminatedString | 43 | @ZeroTerminatedString |
35 | public String reason; | 44 | public String reason; |
45 | |||
36 | @NestedMessage(optional = true) | 46 | @NestedMessage(optional = true) |
37 | public EddsaSignedMessage<AbsoluteTimeMessage> authorityTime; | 47 | public SignedAuthorityTime signedAuthorityTime; |
38 | } | 48 | } |
diff --git a/src/main/java/org/gnunet/voting/messages/SubmitMessage.java b/src/main/java/org/gnunet/voting/messages/SubmitMessage.java index 52bf894..342aa0b 100644 --- a/src/main/java/org/gnunet/voting/messages/SubmitMessage.java +++ b/src/main/java/org/gnunet/voting/messages/SubmitMessage.java | |||
@@ -7,6 +7,7 @@ import org.gnunet.util.*; | |||
7 | import org.gnunet.util.crypto.EcdsaPublicKey; | 7 | import org.gnunet.util.crypto.EcdsaPublicKey; |
8 | import org.gnunet.util.crypto.EcdsaSignature; | 8 | import org.gnunet.util.crypto.EcdsaSignature; |
9 | import org.gnunet.util.crypto.EddsaSignature; | 9 | import org.gnunet.util.crypto.EddsaSignature; |
10 | import org.gnunet.voting.EncryptedVote; | ||
10 | 11 | ||
11 | /** | 12 | /** |
12 | * Message send by the voter to the election authority to submit a vote. | 13 | * Message send by the voter to the election authority to submit a vote. |
@@ -33,10 +34,12 @@ public class SubmitMessage implements GnunetMessage.Body { | |||
33 | */ | 34 | */ |
34 | @NestedMessage | 35 | @NestedMessage |
35 | public AbsoluteTimeMessage groupCertExpiration; | 36 | public AbsoluteTimeMessage groupCertExpiration; |
37 | |||
36 | /** | 38 | /** |
37 | * The actual vote. | 39 | * The encrypted vote, including zero knowledge proofs |
38 | * FIXME: this will be encrypted! | 40 | * for correctness. |
41 | * FIXME: wrap in a signature container | ||
39 | */ | 42 | */ |
40 | @UInt32 | 43 | @NestedMessage |
41 | public int choiceId; | 44 | public EncryptedVote encryptedVote; |
42 | } | 45 | } |