From e1dbf0dae09d3ecddc992a5a7b04a82ca03dcd2a Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 19 Nov 2013 11:15:52 +0000 Subject: - crypto + crypto tests --- src/main/java/org/gnunet/voting/Ballot.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/main/java/org/gnunet/voting/Ballot.java') diff --git a/src/main/java/org/gnunet/voting/Ballot.java b/src/main/java/org/gnunet/voting/Ballot.java index 72d444f..e300010 100644 --- a/src/main/java/org/gnunet/voting/Ballot.java +++ b/src/main/java/org/gnunet/voting/Ballot.java @@ -180,13 +180,13 @@ public class Ballot { if (!optCaPub.isPresent()) { throw new InvalidBallotException("no CA pub key given"); } - caPub = EcdsaPublicKey.fromStringUncompressed(optCaPub.get()); + caPub = EcdsaPublicKey.fromString(optCaPub.get()); if (null == caPub) { throw new InvalidBallotException("CA pub key invalid"); } Optional optIssuerPub = cfg.getValueString("election", "ISSUER_PUB"); if (optIssuerPub.isPresent()) { - issuerPub = EcdsaPublicKey.fromStringUncompressed(optIssuerPub.get()); + issuerPub = EcdsaPublicKey.fromString(optIssuerPub.get()); Optional optIssuerSig = cfg.getValueString("election", "ISSUER_SIG"); if (!optIssuerSig.isPresent()) { throw new InvalidBallotException("issuer public key present, but no signature"); @@ -227,7 +227,7 @@ public class Ballot { Optional optVoterPub = cfg.getValueString("vote", "VOTER_PUB"); if (optVoterPub.isPresent()) { - voterPub = EcdsaPublicKey.fromStringUncompressed(optVoterPub.get()); + voterPub = EcdsaPublicKey.fromString(optVoterPub.get()); if (null == voterPub) { throw new InvalidBallotException("voter public key present but invalid"); } @@ -268,15 +268,13 @@ public class Ballot { digest.update(x.getKey().getBytes()); digest.update(x.getValue().data); } - digest.update(issuerPub.x); digest.update(issuerPub.y); - digest.update(caPub.x); digest.update(caPub.y); digest.update(Longs.toByteArray(startTime.getSeconds())); digest.update(Longs.toByteArray(endTime.getSeconds())); digest.update(Longs.toByteArray(closingTime.getSeconds())); digest.update(Longs.toByteArray(queryTime.getSeconds())); - return new HashCode(digest.digest()); + return HashCode.fromHashCode(digest.digest()); } /** -- cgit v1.2.3