Added encrypted message protobuf, and updated encryption API.
parent
025eabcfd1
commit
c3e651e34b
|
@ -7,6 +7,14 @@ import static meerkat.protobuf.Crypto.*;
|
||||||
* Created by talm on 11/2/15.
|
* Created by talm on 11/2/15.
|
||||||
*/
|
*/
|
||||||
public interface Encryption {
|
public interface Encryption {
|
||||||
Message encrypt(Message plaintext, EncryptionRandomness rnd);
|
/**
|
||||||
|
* Encrypt the serialized form of a message plaintext.
|
||||||
|
* @param plaintext
|
||||||
|
* @param rnd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
RerandomizableEncryptedMessage encrypt(Message plaintext, EncryptionRandomness rnd); // TODO: type of exception; throws
|
||||||
|
|
||||||
|
RerandomizableEncryptedMessage rerandomize(RerandomizableEncryptedMessage msg, EncryptionRandomness rnd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package meerkat.crypto.mixnet;
|
package meerkat.crypto.mixnet;
|
||||||
|
|
||||||
import meerkat.voting.EncryptedBallot;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import static meerkat.protobuf.Voting.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by talm on 25/10/15.
|
* Created by talm on 25/10/15.
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
package meerkat.voting;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by talm on 25/10/15.
|
|
||||||
*/
|
|
||||||
public interface EncryptedBallot {
|
|
||||||
/**
|
|
||||||
* Return the public portion of the ballot (this can be published to the bulletin board without violating privacy).
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Message getPublicPortion();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -41,4 +41,10 @@ message EncryptionRandomness {
|
||||||
// A proof that randomness is correctly generated
|
// A proof that randomness is correctly generated
|
||||||
message RandomnessGenerationProof {
|
message RandomnessGenerationProof {
|
||||||
bytes data = 1;
|
bytes data = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// An encrypted message (rerandomizable)
|
||||||
|
message RerandomizableEncryptedMessage {
|
||||||
|
bytes data = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,12 @@ message PlaintextBallot {
|
||||||
repeated BallotAnswer answers = 2;
|
repeated BallotAnswer answers = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message EncryptedBallot {
|
||||||
|
uint64 serialNumber = 1; // Ballot serial number
|
||||||
|
|
||||||
|
RerandomizableEncryptedMessage data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
message BallotSecrets {
|
message BallotSecrets {
|
||||||
PlaintextBallot plaintext_ballot = 1;
|
PlaintextBallot plaintext_ballot = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue