From ce0e0e0d62f57617d2b1360d5a4e7b4d4479d5f3 Mon Sep 17 00:00:00 2001 From: Tal Moran Date: Mon, 23 Jan 2017 15:41:27 +0200 Subject: [PATCH] Fix protobuf decoding bug --- .../test/java/meerkat/crypto/concrete/ECElGamalUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meerkat-common/src/test/java/meerkat/crypto/concrete/ECElGamalUtils.java b/meerkat-common/src/test/java/meerkat/crypto/concrete/ECElGamalUtils.java index c40128c..e1368e5 100644 --- a/meerkat-common/src/test/java/meerkat/crypto/concrete/ECElGamalUtils.java +++ b/meerkat-common/src/test/java/meerkat/crypto/concrete/ECElGamalUtils.java @@ -70,10 +70,10 @@ public class ECElGamalUtils { GroupElement c1encoded = cipherText.getC1(); GroupElement c2encoded = cipherText.getC2(); - ECPoint c1 = group.decode(c1encoded.toByteArray()); - ECPoint c2 = group.decode(c2encoded.toByteArray()); + ECPoint c1 = ECElGamalEncryption.decodeElement(group, c1encoded); + ECPoint c2 = ECElGamalEncryption.decodeElement(group, c2encoded); - ECPoint plaintextEncoded = secretKey.decrypt(new Pair(c1, c2)); + ECPoint plaintextEncoded = secretKey.decrypt(new Pair<>(c1, c2)); byte[] plaintext = group.injectiveDecode(plaintextEncoded);