mixing test passed

mixer
tzlil.gon 2016-03-20 19:18:23 +02:00
parent b7e543e5e8
commit e27fddcf0c
25 changed files with 45 additions and 55 deletions

View File

@ -146,4 +146,8 @@ public class ECElGamalEncryption extends GlobalCryptoSetup implements Encryption
return retval; return retval;
} }
public BigInteger extractRandomness(Crypto.EncryptionRandomness encryptionRandomness){
return new BigInteger(1,encryptionRandomness.getData().toByteArray());
}
} }

View File

@ -7,7 +7,7 @@ import meerkat.protobuf.Mixing;
* Created by Tzlil on 1/18/2016. * Created by Tzlil on 1/18/2016.
*/ */
public interface MixerOutput { public interface MixerOutput {
public Mixing.ZeroKnowledgeProof[][] gerProofs(); public Mixing.ZeroKnowledgeProof[][] getProofs();
public Crypto.RerandomizableEncryptedMessage[][] getEncryptedMessages(); public Crypto.RerandomizableEncryptedMessage[][] getEncryptedMessages();
public int getN(); public int getN();
} }

View File

@ -38,7 +38,7 @@ public class BatchConverter {
.setData(Integer2ByteString(n)) .setData(Integer2ByteString(n))
.build()); .build());
for (Mixing.ZeroKnowledgeProof[] zkpLayer : mixerOutput.gerProofs()) { for (Mixing.ZeroKnowledgeProof[] zkpLayer : mixerOutput.getProofs()) {
for (Mixing.ZeroKnowledgeProof zkp : zkpLayer) { for (Mixing.ZeroKnowledgeProof zkp : zkpLayer) {
result.add(BulletinBoardAPI.BatchData.newBuilder() result.add(BulletinBoardAPI.BatchData.newBuilder()
.setData(zkp.toByteString()) .setData(zkp.toByteString())

View File

@ -100,11 +100,13 @@ public class Mixer implements meerkat.crypto.mixnet.Mixer {
protected ZeroKnowledgeProof[][] createZKPTable(int n,int layers,MixNetwork mixNetwork, RerandomizableEncryptedMessage[][] encryptionTable protected ZeroKnowledgeProof[][] createZKPTable(int n,int layers,MixNetwork mixNetwork, RerandomizableEncryptedMessage[][] encryptionTable
,EncryptionRandomness[][] randomnesses) throws InvalidProtocolBufferException { ,EncryptionRandomness[][] randomnesses) throws InvalidProtocolBufferException {
ZeroKnowledgeProof[][] proofsTable = new ZeroKnowledgeProof[layers][n];
Switch[] switchesLayer; Switch[] switchesLayer;
int index1,index2; int index1,index2;
int switchIndex = 0; int switchIndex = 0;
int nDiv2 = n >> 1; int nDiv2 = n >> 1;
ZeroKnowledgeProof[][] proofsTable = new ZeroKnowledgeProof[layers][nDiv2];
RerandomizableEncryptedMessage e1,e2; RerandomizableEncryptedMessage e1,e2;
EncryptionRandomness r1,r2; EncryptionRandomness r1,r2;
for (int layer = 0; layer < layers; layer++) for (int layer = 0; layer < layers; layer++)
@ -132,7 +134,6 @@ public class Mixer implements meerkat.crypto.mixnet.Mixer {
public MixerOutput mix(List<RerandomizableEncryptedMessage> ciphertexts) throws InvalidProtocolBufferException { public MixerOutput mix(List<RerandomizableEncryptedMessage> ciphertexts) throws InvalidProtocolBufferException {
int n = ciphertexts.size(); int n = ciphertexts.size();
int nDiv2 = n >> 1;
if (!inputBasicCheckSum(n)) if (!inputBasicCheckSum(n))
return null; return null;

View File

@ -3,12 +3,9 @@ package mixer;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.protobuf.Mixing; import meerkat.protobuf.Mixing;
import java.awt.*;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files;
/** /**
@ -28,7 +25,7 @@ public class MixerOutput implements meerkat.crypto.mixnet.MixerOutput{
} }
public MixerOutput(meerkat.crypto.mixnet.MixerOutput mixerOutput) { public MixerOutput(meerkat.crypto.mixnet.MixerOutput mixerOutput) {
this.proofs = mixerOutput.gerProofs(); this.proofs = mixerOutput.getProofs();
this.encryptedMessages = mixerOutput.getEncryptedMessages(); this.encryptedMessages = mixerOutput.getEncryptedMessages();
this.n = mixerOutput.getN(); this.n = mixerOutput.getN();
this.layers = (int) (2 * Math.log(n) / Math.log(2)) - 1; // layers = 2logn -1; this.layers = (int) (2 * Math.log(n) / Math.log(2)) - 1; // layers = 2logn -1;
@ -36,7 +33,7 @@ public class MixerOutput implements meerkat.crypto.mixnet.MixerOutput{
@Override @Override
public Mixing.ZeroKnowledgeProof[][] gerProofs() { public Mixing.ZeroKnowledgeProof[][] getProofs() {
return proofs; return proofs;
} }

View File

@ -99,7 +99,7 @@ public class Prover implements Mix2ZeroKnowledgeProver {
*/ */
private BigInteger hash(Mixing.ZeroKnowledgeProof.OrProof.ForRandomOracle input) { private BigInteger hash(Mixing.ZeroKnowledgeProof.OrProof.ForRandomOracle input) {
byte[] arr = input.toByteArray(); byte[] arr = input.toByteArray();
return new BigInteger(this.randomOracle.hash(arr,arr.length)); return new BigInteger(1,this.randomOracle.hash(arr,arr.length));
} }
@ -120,7 +120,7 @@ public class Prover implements Mix2ZeroKnowledgeProver {
ECPoint g2Tag = orProofInput.g2Tag; ECPoint g2Tag = orProofInput.g2Tag;
ECPoint h2Tag = orProofInput.h2Tag; ECPoint h2Tag = orProofInput.h2Tag;
BigInteger r = new BigInteger(encryptor.generateRandomness(rand).getData().toByteArray()).mod(groupOrderUpperBound); BigInteger r = encryptor.extractRandomness(encryptor.generateRandomness(rand)).mod(groupOrderUpperBound);
BigInteger c1,c2,z,zTag; BigInteger c1,c2,z,zTag;
ECPoint u,v,uTag,vTag; ECPoint u,v,uTag,vTag;
Mixing.ZeroKnowledgeProof.OrProof.ForRandomOracle forRandomOracle; Mixing.ZeroKnowledgeProof.OrProof.ForRandomOracle forRandomOracle;
@ -128,8 +128,8 @@ public class Prover implements Mix2ZeroKnowledgeProver {
switch (orProofInput.flag) { switch (orProofInput.flag) {
case left: case left:
c2 = new BigInteger(encryptor.generateRandomness(rand).getData().toByteArray()).mod(groupOrderUpperBound); c2 = encryptor.extractRandomness(encryptor.generateRandomness(rand)).mod(groupOrderUpperBound);
zTag = new BigInteger(encryptor.generateRandomness(rand).getData().toByteArray()).mod(groupOrderUpperBound); zTag = encryptor.extractRandomness(encryptor.generateRandomness(rand)).mod(groupOrderUpperBound);
//step 1 //step 1
u = group.multiply(g1, r); u = group.multiply(g1, r);
v = group.multiply(g2, r); v = group.multiply(g2, r);
@ -155,11 +155,11 @@ public class Prover implements Mix2ZeroKnowledgeProver {
c1 = hash(forRandomOracle).add(group.orderUpperBound().subtract(c2)).mod(groupOrderUpperBound); c1 = hash(forRandomOracle).add(group.orderUpperBound().subtract(c2)).mod(groupOrderUpperBound);
//step 3 //step 3
//z = (r + c1 * x) % group size; //z = (r + c1 * x) % group size;
z = r.add(c1.multiply(new BigInteger(orProofInput.x.getData().toByteArray()))).mod(groupOrderUpperBound); z = r.add(c1.multiply(encryptor.extractRandomness(orProofInput.x))).mod(groupOrderUpperBound);
break; break;
case right: case right:
c1 = new BigInteger(encryptor.generateRandomness(rand).getData().toByteArray()).mod(groupOrderUpperBound); c1 = encryptor.extractRandomness(encryptor.generateRandomness(rand)).mod(groupOrderUpperBound);
z = new BigInteger(encryptor.generateRandomness(rand).getData().toByteArray()).mod(groupOrderUpperBound); z = encryptor.extractRandomness(encryptor.generateRandomness(rand)).mod(groupOrderUpperBound);
//step 1 //step 1
uTag = group.multiply(g1Tag, r); uTag = group.multiply(g1Tag, r);
vTag = group.multiply(g2Tag, r); vTag = group.multiply(g2Tag, r);
@ -185,7 +185,7 @@ public class Prover implements Mix2ZeroKnowledgeProver {
c2 = hash(forRandomOracle).add(group.orderUpperBound().subtract(c1)).mod(groupOrderUpperBound); c2 = hash(forRandomOracle).add(group.orderUpperBound().subtract(c1)).mod(groupOrderUpperBound);
//step 3 //step 3
//zTag = (r + c2 * x) % group size; //zTag = (r + c2 * x) % group size;
zTag = r.add(c2.multiply(new BigInteger(orProofInput.x.getData().toByteArray()))).mod(groupOrderUpperBound); zTag = r.add(c2.multiply(encryptor.extractRandomness(orProofInput.x))).mod(groupOrderUpperBound);
break; break;
default: default:
return null; return null;

View File

@ -37,7 +37,7 @@ public class Verifier implements Mix2ZeroKnowledgeVerifier {
public BigInteger hash(Mixing.ZeroKnowledgeProof.OrProof.ForRandomOracle input) { public BigInteger hash(Mixing.ZeroKnowledgeProof.OrProof.ForRandomOracle input) {
byte[] arr = input.toByteArray(); byte[] arr = input.toByteArray();
return new BigInteger(this.randomOracle.hash(arr,arr.length)); return new BigInteger(1,this.randomOracle.hash(arr,arr.length));
} }
/** /**
* @return true iff the proof is valid * @return true iff the proof is valid

View File

@ -5,7 +5,6 @@ import meerkat.crypto.mixnet.Mix2ZeroKnowledgeVerifier;
import meerkat.crypto.mixnet.MixerOutput; import meerkat.crypto.mixnet.MixerOutput;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.protobuf.Mixing; import meerkat.protobuf.Mixing;
import qilin.util.Pair;
import java.util.Arrays; import java.util.Arrays;
@ -30,11 +29,16 @@ public final class VerifyTable {
Arrays.fill(locationChecksumLayer,false); Arrays.fill(locationChecksumLayer,false);
} }
Mixing.ZeroKnowledgeProof[][] zeroKnowledgeProofs = mixerOutput.gerProofs(); Mixing.ZeroKnowledgeProof[][] zeroKnowledgeProofs = mixerOutput.getProofs();
Crypto.RerandomizableEncryptedMessage[][] rerandomizableEncryptedMessages = mixerOutput.getEncryptedMessages(); Crypto.RerandomizableEncryptedMessage[][] rerandomizableEncryptedMessages = mixerOutput.getEncryptedMessages();
for (Mixing.ZeroKnowledgeProof[] zkpLayer: zeroKnowledgeProofs) { for (int i = 0; i < zeroKnowledgeProofs.length ; i++){
for (Mixing.ZeroKnowledgeProof zkp: zkpLayer) { for (int j = 0; j < zeroKnowledgeProofs[i].length ; j ++){
Mixing.ZeroKnowledgeProof zkp = zeroKnowledgeProofs[i][j];
if(zkp == null){
int ttt = 1;
ttt++;
}
Mixing.ZeroKnowledgeProof.Location location = zkp.getLocation(); Mixing.ZeroKnowledgeProof.Location location = zkp.getLocation();
index1 = location.getI(); index1 = location.getI();
index2 = location.getJ(); index2 = location.getJ();

View File

@ -53,7 +53,7 @@ public class MixingText {
mixer = new Mixer(randomMixer,prover,encryptor); mixer = new Mixer(randomMixer,prover,encryptor);
// generate n // generate n
int logN = 10; // + random.nextInt(8) int logN = 8; // + random.nextInt(8)
layers = 2*logN - 1; layers = 2*logN - 1;
n = 1 << logN; n = 1 << logN;
} }

View File

@ -7,6 +7,7 @@ import meerkat.protobuf.ConcreteCrypto;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.protobuf.Voting; import meerkat.protobuf.Voting;
import org.bouncycastle.math.ec.ECPoint; import org.bouncycastle.math.ec.ECPoint;
import org.bouncycastle.util.BigIntegers;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import qilin.primitives.RandomOracle; import qilin.primitives.RandomOracle;
@ -62,13 +63,13 @@ public class RerandomizeTest {
ConcreteCrypto.ElGamalCiphertext eElGamal = ECElGamalEncryption.RerandomizableEncryptedMessage2ElGamalCiphertext(e); ConcreteCrypto.ElGamalCiphertext eElGamal = ECElGamalEncryption.RerandomizableEncryptedMessage2ElGamalCiphertext(e);
ConcreteCrypto.ElGamalCiphertext eNewElGamal = ECElGamalEncryption.RerandomizableEncryptedMessage2ElGamalCiphertext(eNew); ConcreteCrypto.ElGamalCiphertext eNewElGamal = ECElGamalEncryption.RerandomizableEncryptedMessage2ElGamalCiphertext(eNew);
ECPoint expected1 = g.multiply(new BigInteger(r.getData().toByteArray())); ECPoint expected1 = g.multiply(enc.extractRandomness(r));
ECPoint result1 = group.add(convert2ECPoint(eNewElGamal.getC1()),group.negate(convert2ECPoint(eElGamal.getC1()))); ECPoint result1 = group.add(convert2ECPoint(eNewElGamal.getC1()),group.negate(convert2ECPoint(eElGamal.getC1())));
expected1.normalize(); expected1.normalize();
result1.normalize(); result1.normalize();
assert (expected1.equals(result1)); assert (expected1.equals(result1));
ECPoint expected2 = h.multiply(new BigInteger(r.getData().toByteArray())); ECPoint expected2 = h.multiply(enc.extractRandomness(r));
ECPoint result2 = group.add(convert2ECPoint(eNewElGamal.getC2()), group.negate(convert2ECPoint(eElGamal.getC2()))); ECPoint result2 = group.add(convert2ECPoint(eNewElGamal.getC2()), group.negate(convert2ECPoint(eElGamal.getC2())));
expected2.normalize(); expected2.normalize();
result2.normalize(); result2.normalize();
@ -76,6 +77,7 @@ public class RerandomizeTest {
assert (expected2.equals(result2)); assert (expected2.equals(result2));
} }
@Test @Test
public void rerandomizeTest() throws InvalidProtocolBufferException { public void rerandomizeTest() throws InvalidProtocolBufferException {

View File

@ -18,6 +18,7 @@ import qilin.primitives.generic.ElGamal;
import qilin.util.Pair; import qilin.util.Pair;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.math.BigInteger;
import java.security.KeyFactory; import java.security.KeyFactory;
import java.security.PublicKey; import java.security.PublicKey;
import java.util.Random; import java.util.Random;

View File

@ -76,13 +76,13 @@ public class ZeroKnowledgeProofTest {
ConcreteCrypto.ElGamalCiphertext e2TagElGamal = ECElGamalEncryption.RerandomizableEncryptedMessage2ElGamalCiphertext(e2New); ConcreteCrypto.ElGamalCiphertext e2TagElGamal = ECElGamalEncryption.RerandomizableEncryptedMessage2ElGamalCiphertext(e2New);
assert (g.multiply(new BigInteger(r1.getData().toByteArray())).equals( assert (g.multiply(enc.extractRandomness(r1)).equals(
group.add(convert2ECPoint(e1TagElGamal.getC1()),group.negate(convert2ECPoint(e1ElGamal.getC1()))))); group.add(convert2ECPoint(e1TagElGamal.getC1()),group.negate(convert2ECPoint(e1ElGamal.getC1())))));
assert (h.multiply(new BigInteger(r1.getData().toByteArray())).equals( assert (h.multiply(enc.extractRandomness(r1)).equals(
group.add(convert2ECPoint(e1TagElGamal.getC2()),group.negate(convert2ECPoint(e1ElGamal.getC2()))))); group.add(convert2ECPoint(e1TagElGamal.getC2()),group.negate(convert2ECPoint(e1ElGamal.getC2())))));
assert (g.multiply(new BigInteger(r2.getData().toByteArray())).equals( assert (g.multiply(enc.extractRandomness(r2)).equals(
group.add(convert2ECPoint(e2TagElGamal.getC1()),group.negate(convert2ECPoint(e2ElGamal.getC1()))))); group.add(convert2ECPoint(e2TagElGamal.getC1()),group.negate(convert2ECPoint(e2ElGamal.getC1())))));
assert (h.multiply(new BigInteger(r2.getData().toByteArray())).equals( assert (h.multiply(enc.extractRandomness(r2)).equals(
group.add(convert2ECPoint(e2TagElGamal.getC2()),group.negate(convert2ECPoint(e2ElGamal.getC2()))))); group.add(convert2ECPoint(e2TagElGamal.getC2()),group.negate(convert2ECPoint(e2ElGamal.getC2())))));
assert (verifier.verify(e1,e2,e1New,e2New,prover.prove(e1,e2,e1New,e2New,false,0,0,0,r1,r2))); assert (verifier.verify(e1,e2,e1New,e2New,prover.prove(e1,e2,e1New,e2New,false,0,0,0,r1,r2)));

View File

@ -23,7 +23,6 @@ public class AddSub {
BigInteger[] randoms; BigInteger[] randoms;
BigInteger[] randoms2; BigInteger[] randoms2;
@Before
public void setup() throws Exception { public void setup() throws Exception {
Random rand = new Random(); Random rand = new Random();
tests = 1 << 17; tests = 1 << 17;
@ -47,7 +46,6 @@ public class AddSub {
} }
@Test
public void AddSubProfiling() throws InvalidProtocolBufferException { public void AddSubProfiling() throws InvalidProtocolBufferException {
System.out.println("AddSub"); System.out.println("AddSub");

View File

@ -19,7 +19,7 @@ public class GenerateRandomness {
int tests; int tests;
ECElGamalEncryption enc; ECElGamalEncryption enc;
Random rand; Random rand;
@Before
public void setup() throws Exception { public void setup() throws Exception {
rand = new Random(); rand = new Random();
ECGroup group = new ECGroup("secp256k1"); ECGroup group = new ECGroup("secp256k1");
@ -33,7 +33,6 @@ public class GenerateRandomness {
} }
@Test
public void GenerateRandomnessProfiling() throws InvalidProtocolBufferException { public void GenerateRandomnessProfiling() throws InvalidProtocolBufferException {
System.out.println("GenerateRandomnessProfiling"); System.out.println("GenerateRandomnessProfiling");

View File

@ -23,7 +23,6 @@ public class Modulo {
BigInteger[] randoms; BigInteger[] randoms;
BigInteger orderUpperBound; BigInteger orderUpperBound;
@Before
public void setup() throws Exception { public void setup() throws Exception {
Random rand = new Random(); Random rand = new Random();
ECGroup group = new ECGroup("secp256k1"); ECGroup group = new ECGroup("secp256k1");
@ -41,7 +40,6 @@ public class Modulo {
} }
} }
@Test
public void ModuloProfiling() throws InvalidProtocolBufferException { public void ModuloProfiling() throws InvalidProtocolBufferException {
System.out.println("ModuloProfiling"); System.out.println("ModuloProfiling");

View File

@ -21,7 +21,6 @@ public class Mul {
BigInteger[] randoms; BigInteger[] randoms;
BigInteger[] randoms2; BigInteger[] randoms2;
@Before
public void setup() throws Exception { public void setup() throws Exception {
Random rand = new Random(); Random rand = new Random();
tests = 1 << 17; tests = 1 << 17;
@ -45,7 +44,6 @@ public class Mul {
} }
@Test
public void MulProfiling() throws InvalidProtocolBufferException { public void MulProfiling() throws InvalidProtocolBufferException {
System.out.println("Mul"); System.out.println("Mul");

View File

@ -26,7 +26,6 @@ public class SHA256 {
BigInteger[] randoms; BigInteger[] randoms;
RandomOracle randomOracle; RandomOracle randomOracle;
@Before
public void setup() throws Exception { public void setup() throws Exception {
Random rand = new Random(); Random rand = new Random();
randomOracle = new DigestOracle(); randomOracle = new DigestOracle();
@ -40,7 +39,6 @@ public class SHA256 {
} }
} }
@Test
public void SHA256Profiling() throws InvalidProtocolBufferException { public void SHA256Profiling() throws InvalidProtocolBufferException {
System.out.println("SHA256Profiling"); System.out.println("SHA256Profiling");

View File

@ -28,7 +28,6 @@ public class ByteString2ECPoint {
int tests; int tests;
ConcreteCrypto.ElGamalCiphertext[] encryptedMessage; ConcreteCrypto.ElGamalCiphertext[] encryptedMessage;
@Before
public void setup() throws Exception { public void setup() throws Exception {
rand = new Random(); rand = new Random();
group = new ECGroup("secp256k1"); group = new ECGroup("secp256k1");
@ -53,7 +52,6 @@ public class ByteString2ECPoint {
return group.decode(bs.toByteArray()); return group.decode(bs.toByteArray());
} }
@Test
public void ByteString2ECPointProfiling() throws InvalidProtocolBufferException { public void ByteString2ECPointProfiling() throws InvalidProtocolBufferException {
System.out.println("ByteString2ECPointProfiling"); System.out.println("ByteString2ECPointProfiling");

View File

@ -28,7 +28,6 @@ public class RerandomizableEncryptedMessage2ElGamalCiphertext {
int tests; int tests;
Crypto.RerandomizableEncryptedMessage[] encryptedMessage; Crypto.RerandomizableEncryptedMessage[] encryptedMessage;
@Before
public void setup() throws Exception { public void setup() throws Exception {
rand = new Random(); rand = new Random();
group = new ECGroup("secp256k1"); group = new ECGroup("secp256k1");
@ -48,7 +47,7 @@ public class RerandomizableEncryptedMessage2ElGamalCiphertext {
encryptedMessage[i] = enc.encrypt(msg, enc.generateRandomness(rand)); encryptedMessage[i] = enc.encrypt(msg, enc.generateRandomness(rand));
} }
} }
@Test
public void RerandomizableEncryptedMessage2ElGamalCiphertext() throws InvalidProtocolBufferException { public void RerandomizableEncryptedMessage2ElGamalCiphertext() throws InvalidProtocolBufferException {
System.out.println("RerandomizableEncryptedMessage2ElGamalCiphertext"); System.out.println("RerandomizableEncryptedMessage2ElGamalCiphertext");

View File

@ -26,7 +26,6 @@ public class Add {
List<ECPoint> members1; List<ECPoint> members1;
List<ECPoint> members2; List<ECPoint> members2;
@Before
public void setup() throws InvalidKeySpecException { public void setup() throws InvalidKeySpecException {
// initialization // initialization
random = new Random(); random = new Random();
@ -46,7 +45,6 @@ public class Add {
} }
} }
@Test
public void addProfiling() throws InvalidProtocolBufferException { public void addProfiling() throws InvalidProtocolBufferException {
System.out.println("AddSub"); System.out.println("AddSub");
System.out.println("n is : " + n); System.out.println("n is : " + n);

View File

@ -25,7 +25,7 @@ public class Encode {
private int n; private int n;
List<ECPoint> members; List<ECPoint> members;
@Before
public void setup() throws InvalidKeySpecException { public void setup() throws InvalidKeySpecException {
// initialization // initialization
random = new Random(); random = new Random();
@ -41,7 +41,7 @@ public class Encode {
members.add(group.sample(random)); members.add(group.sample(random));
} }
} }
@Test
public void encodeProfiling() throws InvalidProtocolBufferException { public void encodeProfiling() throws InvalidProtocolBufferException {
System.out.println("Encode"); System.out.println("Encode");
System.out.println("n is : " + n); System.out.println("n is : " + n);

View File

@ -26,7 +26,7 @@ public class Mul {
private int n; private int n;
List<ECPoint> members; List<ECPoint> members;
List<BigInteger> randomnesses; List<BigInteger> randomnesses;
@Before
public void setup() throws InvalidKeySpecException { public void setup() throws InvalidKeySpecException {
// initialization // initialization
random = new Random(); random = new Random();
@ -48,7 +48,6 @@ public class Mul {
} }
} }
@Test
public void mulProfiling() throws InvalidProtocolBufferException { public void mulProfiling() throws InvalidProtocolBufferException {
System.out.println("Multiply"); System.out.println("Multiply");
System.out.println("n is : " + n); System.out.println("n is : " + n);

View File

@ -25,7 +25,6 @@ public class Negate {
private int n; private int n;
List<ECPoint> members; List<ECPoint> members;
@Before
public void setup() throws InvalidKeySpecException { public void setup() throws InvalidKeySpecException {
// initialization // initialization
random = new Random(); random = new Random();
@ -41,7 +40,7 @@ public class Negate {
members.add(group.sample(random)); members.add(group.sample(random));
} }
} }
@Test
public void negProfiling() throws InvalidProtocolBufferException { public void negProfiling() throws InvalidProtocolBufferException {
System.out.println("Neg"); System.out.println("Neg");
System.out.println("n is : " + n); System.out.println("n is : " + n);

View File

@ -34,7 +34,6 @@ public class Rerandomize {
Crypto.EncryptionRandomness[] randomnesses; Crypto.EncryptionRandomness[] randomnesses;
Crypto.RerandomizableEncryptedMessage[] encryptedMessage; Crypto.RerandomizableEncryptedMessage[] encryptedMessage;
@Before
public void setup() throws Exception { public void setup() throws Exception {
rand = new Random(); rand = new Random();
group = new ECGroup("secp256k1"); group = new ECGroup("secp256k1");
@ -58,7 +57,6 @@ public class Rerandomize {
} }
} }
@Test
public void RerandomizeProfiling() throws InvalidProtocolBufferException { public void RerandomizeProfiling() throws InvalidProtocolBufferException {
System.out.println("Rerandomiz"); System.out.println("Rerandomiz");

View File

@ -37,7 +37,7 @@ public class ZeroKnowledgeProof {
Crypto.EncryptionRandomness[] randomnesses; Crypto.EncryptionRandomness[] randomnesses;
Crypto.RerandomizableEncryptedMessage[] encryptedMessage; Crypto.RerandomizableEncryptedMessage[] encryptedMessage;
Crypto.RerandomizableEncryptedMessage[] reencryptedMessage; Crypto.RerandomizableEncryptedMessage[] reencryptedMessage;
@Before
public void setup() throws Exception { public void setup() throws Exception {
rand = new Random(); rand = new Random();
group = new ECGroup("secp256k1"); group = new ECGroup("secp256k1");
@ -70,7 +70,6 @@ public class ZeroKnowledgeProof {
return group.decode(bs.toByteArray()); return group.decode(bs.toByteArray());
} }
@Test
public void zeroKnowledgeProofTest() throws InvalidProtocolBufferException { public void zeroKnowledgeProofTest() throws InvalidProtocolBufferException {
System.out.println("Prove"); System.out.println("Prove");