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-12-28 15:07:43 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-12-28 15:07:43 +0400
commit6f2ba42c7933a3f2d1a6161d2f4c04bcf5267622 (patch)
treeeaf3d07a9e42d0412ca8b93aa68e83d934276efe /core/src/main/java/org/bouncycastle/crypto/tls/TlsECCUtils.java
parent7b4cf9681221b37d19906f9c9a6125a9c637c1dd (diff)
Include order/cofactor in Fp curves where possible
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsECCUtils.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsECCUtils.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsECCUtils.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsECCUtils.java
index f4fbe28d..87efb14f 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsECCUtils.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsECCUtils.java
@@ -448,10 +448,11 @@ public class TlsECCUtils
BigInteger prime_p = readECParameter(input);
BigInteger a = readECFieldElement(prime_p.bitLength(), input);
BigInteger b = readECFieldElement(prime_p.bitLength(), input);
- ECCurve curve = new ECCurve.Fp(prime_p, a, b);
- ECPoint base = deserializeECPoint(ecPointFormats, curve, TlsUtils.readOpaque8(input));
+ byte[] baseEncoding = TlsUtils.readOpaque8(input);
BigInteger order = readECParameter(input);
BigInteger cofactor = readECParameter(input);
+ ECCurve curve = new ECCurve.Fp(prime_p, a, b, order, cofactor);
+ ECPoint base = deserializeECPoint(ecPointFormats, curve, baseEncoding);
return new ECDomainParameters(curve, base, order, cofactor);
}
case ECCurveType.explicit_char2:
@@ -474,12 +475,10 @@ public class TlsECCUtils
BigInteger a = readECFieldElement(m, input);
BigInteger b = readECFieldElement(m, input);
-
byte[] baseEncoding = TlsUtils.readOpaque8(input);
BigInteger order = readECParameter(input);
BigInteger cofactor = readECParameter(input);
- // TODO The order/cofactor are currently needed for tau-adic optimization if Koblitz
ECCurve curve = (basis == ECBasisType.ec_basis_pentanomial)
? new ECCurve.F2m(m, k1, k2, k3, a, b, order, cofactor)
: new ECCurve.F2m(m, k1, a, b, order, cofactor);