From 2ebe9502a210e5d642664c33c723cdcf3ce5f88c Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 13 Mar 2014 13:04:05 +0700 Subject: Add new CreateRawPoint method on ECCurve that includes the Z coords --- crypto/src/math/ec/custom/sec/SecP192K1Curve.cs | 5 +++++ crypto/src/math/ec/custom/sec/SecP192R1Curve.cs | 5 +++++ crypto/src/math/ec/custom/sec/SecP224K1Curve.cs | 5 +++++ crypto/src/math/ec/custom/sec/SecP224R1Curve.cs | 5 +++++ crypto/src/math/ec/custom/sec/SecP256K1Curve.cs | 5 +++++ crypto/src/math/ec/custom/sec/SecP256R1Curve.cs | 5 +++++ crypto/src/math/ec/custom/sec/SecP384R1Curve.cs | 5 +++++ crypto/src/math/ec/custom/sec/SecP521R1Curve.cs | 5 +++++ 8 files changed, 40 insertions(+) (limited to 'crypto/src/math/ec/custom') diff --git a/crypto/src/math/ec/custom/sec/SecP192K1Curve.cs b/crypto/src/math/ec/custom/sec/SecP192K1Curve.cs index ab509b9fa..54b87588b 100644 --- a/crypto/src/math/ec/custom/sec/SecP192K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP192K1Curve.cs @@ -68,6 +68,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP192K1Point(this, x, y, withCompression); } + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP192K1Point(this, x, y, zs, withCompression); + } + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement x = FromBigInteger(X1); diff --git a/crypto/src/math/ec/custom/sec/SecP192R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP192R1Curve.cs index 62cb6f510..57b20d31e 100644 --- a/crypto/src/math/ec/custom/sec/SecP192R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP192R1Curve.cs @@ -71,6 +71,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP192R1Point(this, x, y, withCompression); } + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP192R1Point(this, x, y, zs, withCompression); + } + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement x = FromBigInteger(X1); diff --git a/crypto/src/math/ec/custom/sec/SecP224K1Curve.cs b/crypto/src/math/ec/custom/sec/SecP224K1Curve.cs index 5d82eaed8..70de308bb 100644 --- a/crypto/src/math/ec/custom/sec/SecP224K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP224K1Curve.cs @@ -68,6 +68,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP224K1Point(this, x, y, withCompression); } + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP224K1Point(this, x, y, zs, withCompression); + } + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement x = FromBigInteger(X1); diff --git a/crypto/src/math/ec/custom/sec/SecP224R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP224R1Curve.cs index ee0aa94a4..33b66be82 100644 --- a/crypto/src/math/ec/custom/sec/SecP224R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP224R1Curve.cs @@ -71,6 +71,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP224R1Point(this, x, y, withCompression); } + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP224R1Point(this, x, y, zs, withCompression); + } + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement x = FromBigInteger(X1); diff --git a/crypto/src/math/ec/custom/sec/SecP256K1Curve.cs b/crypto/src/math/ec/custom/sec/SecP256K1Curve.cs index a938a67d7..89de61706 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1Curve.cs @@ -68,6 +68,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP256K1Point(this, x, y, withCompression); } + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP256K1Point(this, x, y, zs, withCompression); + } + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement x = FromBigInteger(X1); diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs index 9525c0207..9a94eb8d1 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs @@ -70,6 +70,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP256R1Point(this, x, y, withCompression); } + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP256R1Point(this, x, y, zs, withCompression); + } + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement x = FromBigInteger(X1); diff --git a/crypto/src/math/ec/custom/sec/SecP384R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP384R1Curve.cs index 9366232c6..f3dec05c9 100644 --- a/crypto/src/math/ec/custom/sec/SecP384R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP384R1Curve.cs @@ -70,6 +70,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP384R1Point(this, x, y, withCompression); } + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP384R1Point(this, x, y, zs, withCompression); + } + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement x = FromBigInteger(X1); diff --git a/crypto/src/math/ec/custom/sec/SecP521R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP521R1Curve.cs index 24a0a5e33..cb42304ef 100644 --- a/crypto/src/math/ec/custom/sec/SecP521R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP521R1Curve.cs @@ -70,6 +70,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP521R1Point(this, x, y, withCompression); } + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP521R1Point(this, x, y, zs, withCompression); + } + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement x = FromBigInteger(X1); -- cgit 1.4.1