Added encrypted message protobuf, and updated encryption API.

signature-implementation
Tal Moran 2015-11-16 14:44:06 +02:00
parent 025eabcfd1
commit c3e651e34b
5 changed files with 23 additions and 20 deletions

View File

@ -7,6 +7,14 @@ import static meerkat.protobuf.Crypto.*;
* Created by talm on 11/2/15.
*/
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);
}

View File

@ -1,8 +1,7 @@
package meerkat.crypto.mixnet;
import meerkat.voting.EncryptedBallot;
import java.util.List;
import static meerkat.protobuf.Voting.*;
/**
* Created by talm on 25/10/15.

View File

@ -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();
}

View File

@ -41,4 +41,10 @@ message EncryptionRandomness {
// A proof that randomness is correctly generated
message RandomnessGenerationProof {
bytes data = 1;
}
}
// An encrypted message (rerandomizable)
message RerandomizableEncryptedMessage {
bytes data = 1;
}

View File

@ -49,6 +49,12 @@ message PlaintextBallot {
repeated BallotAnswer answers = 2;
}
message EncryptedBallot {
uint64 serialNumber = 1; // Ballot serial number
RerandomizableEncryptedMessage data = 2;
}
message BallotSecrets {
PlaintextBallot plaintext_ballot = 1;