Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2013-09-23 18:05:05 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-09-23 18:05:05 +0400
commit272398d61616ab54dfcbc7ecc6409bd565f3076b (patch)
tree9d9f0aa602d467f7774a16ceb196870437e8852a /core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java
parentc8f6229673823b664f2c244966b7087b0f15cca1 (diff)
Update various EC algorithms and tests to use normalize and
getAffine[XY]Coord when working with curves that might now be using non-affine coordinates internally
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java')
-rwxr-xr-xcore/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java b/core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java
index f4dfc6ed..b5a145ac 100755
--- a/core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java
+++ b/core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java
@@ -128,11 +128,11 @@ public class ECIESKeyEncapsulation
rPrime = r;
}
- ECPoint hTilde = ((ECPublicKeyParameters)key).getQ().multiply(rPrime);
+ ECPoint hTilde = ((ECPublicKeyParameters)key).getQ().multiply(rPrime).normalize();
// Encode the shared secret value
int PEHlen = (key.getParameters().getCurve().getFieldSize() + 7) / 8;
- byte[] PEH = BigIntegers.asUnsignedByteArray(PEHlen, hTilde.getX().toBigInteger());
+ byte[] PEH = BigIntegers.asUnsignedByteArray(PEHlen, hTilde.getAffineXCoord().toBigInteger());
// Initialise the KDF
byte[] kdfInput;
@@ -215,11 +215,11 @@ public class ECIESKeyEncapsulation
xHat = ((ECPrivateKeyParameters)key).getD();
}
- ECPoint hTilde = gHat.multiply(xHat);
+ ECPoint hTilde = gHat.multiply(xHat).normalize();
// Encode the shared secret value
int PEHlen = (key.getParameters().getCurve().getFieldSize() + 7) / 8;
- byte[] PEH = BigIntegers.asUnsignedByteArray(PEHlen, hTilde.getX().toBigInteger());
+ byte[] PEH = BigIntegers.asUnsignedByteArray(PEHlen, hTilde.getAffineXCoord().toBigInteger());
// Initialise the KDF
byte[] kdfInput;