summary refs log tree commit diff
path: root/crypto/src/math/ec/custom
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/math/ec/custom')
-rw-r--r--crypto/src/math/ec/custom/djb/Curve25519.cs10
-rw-r--r--crypto/src/math/ec/custom/djb/Curve25519Point.cs40
-rw-r--r--crypto/src/math/ec/custom/gm/SM2P256V1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/gm/SM2P256V1Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecP128R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP128R1Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecP160K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP160K1Point.cs49
-rw-r--r--crypto/src/math/ec/custom/sec/SecP160R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP160R1Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecP160R2Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP160R2Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecP192K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP192K1Point.cs49
-rw-r--r--crypto/src/math/ec/custom/sec/SecP192R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP192R1Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecP224K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP224K1Point.cs49
-rw-r--r--crypto/src/math/ec/custom/sec/SecP224R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP224R1Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecP256K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP256K1Point.cs49
-rw-r--r--crypto/src/math/ec/custom/sec/SecP256R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP256R1Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecP384R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP384R1Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecP521R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecP521R1Point.cs48
-rw-r--r--crypto/src/math/ec/custom/sec/SecT113R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT113R1Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT113R2Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT113R2Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT131R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT131R1Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT131R2Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT131R2Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT163K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT163K1Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT163R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT163R1Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT163R2Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT163R2Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT193R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT193R1Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT193R2Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT193R2Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT233K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT233K1Point.cs39
-rw-r--r--crypto/src/math/ec/custom/sec/SecT233R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT233R1Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT239K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT239K1Point.cs39
-rw-r--r--crypto/src/math/ec/custom/sec/SecT283K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT283K1Point.cs39
-rw-r--r--crypto/src/math/ec/custom/sec/SecT283R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT283R1Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT409K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT409K1Point.cs39
-rw-r--r--crypto/src/math/ec/custom/sec/SecT409R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT409R1Point.cs37
-rw-r--r--crypto/src/math/ec/custom/sec/SecT571K1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT571K1Point.cs39
-rw-r--r--crypto/src/math/ec/custom/sec/SecT571R1Curve.cs10
-rw-r--r--crypto/src/math/ec/custom/sec/SecT571R1Point.cs37
64 files changed, 479 insertions, 1185 deletions
diff --git a/crypto/src/math/ec/custom/djb/Curve25519.cs b/crypto/src/math/ec/custom/djb/Curve25519.cs

index 2566af030..380be7252 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519.cs
@@ -68,14 +68,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb return new Curve25519FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new Curve25519Point(this, x, y, withCompression); + return new Curve25519Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new Curve25519Point(this, x, y, zs, withCompression); + return new Curve25519Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -164,7 +164,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new Curve25519FieldElement(x), new Curve25519FieldElement(y), CURVE25519_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new Curve25519FieldElement(x), new Curve25519FieldElement(y), CURVE25519_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/djb/Curve25519Point.cs b/crypto/src/math/ec/custom/djb/Curve25519Point.cs
index eb8fc12f2..f61e28af8 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519Point.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519Point.cs
@@ -7,39 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb internal class Curve25519Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve the curve to use - * @param x affine x co-ordinate - * @param y affine y co-ordinate - * - * @deprecated Use ECCurve.CreatePoint to construct points - */ - public Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve the curve to use - * @param x affine x co-ordinate - * @param y affine y co-ordinate - * @param withCompression if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -178,7 +152,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb ECFieldElement[] zs = new ECFieldElement[] { Z3, W3 }; - return new Curve25519Point(curve, X3, Y3, zs, IsCompressed); + return new Curve25519Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -224,7 +198,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb if (IsInfinity) return this; - return new Curve25519Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new Curve25519Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } protected virtual Curve25519FieldElement CalculateJacobianModifiedW(Curve25519FieldElement Z, uint[] ZSquared) @@ -307,7 +281,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Djb Curve25519Field.Twice(W3.x, W3.x); } - return new Curve25519Point(this.Curve, X3, Y3, new ECFieldElement[] { Z3, W3 }, IsCompressed); + return new Curve25519Point(this.Curve, X3, Y3, new ECFieldElement[] { Z3, W3 }); } } } diff --git a/crypto/src/math/ec/custom/gm/SM2P256V1Curve.cs b/crypto/src/math/ec/custom/gm/SM2P256V1Curve.cs
index 805245c45..ae6c6e1d9 100644 --- a/crypto/src/math/ec/custom/gm/SM2P256V1Curve.cs +++ b/crypto/src/math/ec/custom/gm/SM2P256V1Curve.cs
@@ -67,14 +67,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.GM return new SM2P256V1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SM2P256V1Point(this, x, y, withCompression); + return new SM2P256V1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SM2P256V1Point(this, x, y, zs, withCompression); + return new SM2P256V1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -163,7 +163,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.GM private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SM2P256V1FieldElement(x), new SM2P256V1FieldElement(y), SM2P256V1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SM2P256V1FieldElement(x), new SM2P256V1FieldElement(y), SM2P256V1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/gm/SM2P256V1Point.cs b/crypto/src/math/ec/custom/gm/SM2P256V1Point.cs
index 916c90633..aba4c3d8e 100644 --- a/crypto/src/math/ec/custom/gm/SM2P256V1Point.cs +++ b/crypto/src/math/ec/custom/gm/SM2P256V1Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.GM internal class SM2P256V1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SM2P256V1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SM2P256V1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SM2P256V1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SM2P256V1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SM2P256V1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -172,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.GM ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; - return new SM2P256V1Point(curve, X3, Y3, zs, IsCompressed); + return new SM2P256V1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -240,7 +206,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.GM SM2P256V1Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SM2P256V1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SM2P256V1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -273,7 +239,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.GM if (IsInfinity) return this; - return new SM2P256V1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SM2P256V1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP128R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP128R1Curve.cs
index b4a150ca0..a5fc338da 100644 --- a/crypto/src/math/ec/custom/sec/SecP128R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP128R1Curve.cs
@@ -68,14 +68,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP128R1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP128R1Point(this, x, y, withCompression); + return new SecP128R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP128R1Point(this, x, y, zs, withCompression); + return new SecP128R1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -164,7 +164,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP128R1FieldElement(x), new SecP128R1FieldElement(y), SECP128R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP128R1FieldElement(x), new SecP128R1FieldElement(y), SECP128R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP128R1Point.cs b/crypto/src/math/ec/custom/sec/SecP128R1Point.cs
index ae76d3cd1..45d28298a 100644 --- a/crypto/src/math/ec/custom/sec/SecP128R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP128R1Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP128R1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP128R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP128R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(boolean)} - */ - public SecP128R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP128R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP128R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -172,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; - return new SecP128R1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP128R1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -240,7 +206,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP128R1Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SecP128R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecP128R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -273,7 +239,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP128R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP128R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP160K1Curve.cs b/crypto/src/math/ec/custom/sec/SecP160K1Curve.cs
index c2c78e464..99318a2d8 100644 --- a/crypto/src/math/ec/custom/sec/SecP160K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP160K1Curve.cs
@@ -65,14 +65,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP160R2FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP160K1Point(this, x, y, withCompression); + return new SecP160K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP160K1Point(this, x, y, zs, withCompression); + return new SecP160K1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -161,7 +161,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP160R2FieldElement(x), new SecP160R2FieldElement(y), SECP160K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP160R2FieldElement(x), new SecP160R2FieldElement(y), SECP160K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP160K1Point.cs b/crypto/src/math/ec/custom/sec/SecP160K1Point.cs
index 1bcbadb33..8a2309bd5 100644 --- a/crypto/src/math/ec/custom/sec/SecP160K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP160K1Point.cs
@@ -7,48 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP160K1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.CreatePoint to construct points - */ - public SecP160K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP160K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP160K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP160K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, - bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP160K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -174,7 +139,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[] { Z3 }; - return new SecP160K1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP160K1Point(curve, X3, Y3, zs); } // B.3 pg 62 @@ -230,7 +195,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP160R2Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SecP160K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecP160K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -263,7 +228,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP160K1Point(Curve, this.RawXCoord, this.RawYCoord.Negate(), this.RawZCoords, IsCompressed); + return new SecP160K1Point(Curve, this.RawXCoord, this.RawYCoord.Negate(), this.RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP160R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP160R1Curve.cs
index 8ae519ad3..b3e90f82a 100644 --- a/crypto/src/math/ec/custom/sec/SecP160R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP160R1Curve.cs
@@ -68,14 +68,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP160R1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP160R1Point(this, x, y, withCompression); + return new SecP160R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP160R1Point(this, x, y, zs, withCompression); + return new SecP160R1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -164,7 +164,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP160R1FieldElement(x), new SecP160R1FieldElement(y), SECP160R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP160R1FieldElement(x), new SecP160R1FieldElement(y), SECP160R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP160R1Point.cs b/crypto/src/math/ec/custom/sec/SecP160R1Point.cs
index f9f065de6..35495c95c 100644 --- a/crypto/src/math/ec/custom/sec/SecP160R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP160R1Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP160R1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.CreatePoint to construct points - */ - public SecP160R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP160R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP160R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP160R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP160R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -172,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; - return new SecP160R1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP160R1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -240,7 +206,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP160R1Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SecP160R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecP160R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -273,7 +239,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP160R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP160R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP160R2Curve.cs b/crypto/src/math/ec/custom/sec/SecP160R2Curve.cs
index 49c3fa331..54a67d796 100644 --- a/crypto/src/math/ec/custom/sec/SecP160R2Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP160R2Curve.cs
@@ -68,14 +68,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP160R2FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP160R2Point(this, x, y, withCompression); + return new SecP160R2Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP160R2Point(this, x, y, zs, withCompression); + return new SecP160R2Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -164,7 +164,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP160R2FieldElement(x), new SecP160R2FieldElement(y), SECP160R2_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP160R2FieldElement(x), new SecP160R2FieldElement(y), SECP160R2_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP160R2Point.cs b/crypto/src/math/ec/custom/sec/SecP160R2Point.cs
index 343cf8c16..5bcb944af 100644 --- a/crypto/src/math/ec/custom/sec/SecP160R2Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP160R2Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP160R2Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.CreatePoint to construct points - */ - public SecP160R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP160R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP160R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP160R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP160R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -172,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; - return new SecP160R2Point(curve, X3, Y3, zs, IsCompressed); + return new SecP160R2Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -240,7 +206,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP160R2Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SecP160R2Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecP160R2Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -273,7 +239,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP160R2Point(Curve, this.RawXCoord, this.RawYCoord.Negate(), this.RawZCoords, IsCompressed); + return new SecP160R2Point(Curve, this.RawXCoord, this.RawYCoord.Negate(), this.RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP192K1Curve.cs b/crypto/src/math/ec/custom/sec/SecP192K1Curve.cs
index b9fb08e56..9e73e5d51 100644 --- a/crypto/src/math/ec/custom/sec/SecP192K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP192K1Curve.cs
@@ -65,14 +65,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP192K1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP192K1Point(this, x, y, withCompression); + return new SecP192K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP192K1Point(this, x, y, zs, withCompression); + return new SecP192K1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -161,7 +161,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP192K1FieldElement(x), new SecP192K1FieldElement(y), SECP192K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP192K1FieldElement(x), new SecP192K1FieldElement(y), SECP192K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP192K1Point.cs b/crypto/src/math/ec/custom/sec/SecP192K1Point.cs
index 58eb09102..3098f7a84 100644 --- a/crypto/src/math/ec/custom/sec/SecP192K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP192K1Point.cs
@@ -7,48 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP192K1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, - bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -173,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[] { Z3 }; - return new SecP192K1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP192K1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -228,7 +193,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP192K1Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SecP192K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecP192K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -261,7 +226,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP192K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP192K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP192R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP192R1Curve.cs
index 465768514..fb9e0f7ad 100644 --- a/crypto/src/math/ec/custom/sec/SecP192R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP192R1Curve.cs
@@ -68,14 +68,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP192R1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP192R1Point(this, x, y, withCompression); + return new SecP192R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP192R1Point(this, x, y, zs, withCompression); + return new SecP192R1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -164,7 +164,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP192R1FieldElement(x), new SecP192R1FieldElement(y), SECP192R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP192R1FieldElement(x), new SecP192R1FieldElement(y), SECP192R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP192R1Point.cs b/crypto/src/math/ec/custom/sec/SecP192R1Point.cs
index 3b53e341e..6c2152134 100644 --- a/crypto/src/math/ec/custom/sec/SecP192R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP192R1Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP192R1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP192R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP192R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP192R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP192R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP192R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -172,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[] { Z3 }; - return new SecP192R1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP192R1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -240,7 +206,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP192R1Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SecP192R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecP192R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -273,7 +239,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP192R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP192R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP224K1Curve.cs b/crypto/src/math/ec/custom/sec/SecP224K1Curve.cs
index dc5cd6c0b..91af66685 100644 --- a/crypto/src/math/ec/custom/sec/SecP224K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP224K1Curve.cs
@@ -65,14 +65,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP224K1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP224K1Point(this, x, y, withCompression); + return new SecP224K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP224K1Point(this, x, y, zs, withCompression); + return new SecP224K1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -161,7 +161,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP224K1FieldElement(x), new SecP224K1FieldElement(y), SECP224K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP224K1FieldElement(x), new SecP224K1FieldElement(y), SECP224K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP224K1Point.cs b/crypto/src/math/ec/custom/sec/SecP224K1Point.cs
index 98cb29274..6a163e4ff 100644 --- a/crypto/src/math/ec/custom/sec/SecP224K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP224K1Point.cs
@@ -7,48 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP224K1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP224K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP224K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP224K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP224K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, - bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP224K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -173,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[] { Z3 }; - return new SecP224K1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP224K1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -228,7 +193,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP224K1Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SecP224K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecP224K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -261,7 +226,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP224K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP224K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP224R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP224R1Curve.cs
index 8e79316d8..b82841446 100644 --- a/crypto/src/math/ec/custom/sec/SecP224R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP224R1Curve.cs
@@ -68,14 +68,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP224R1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP224R1Point(this, x, y, withCompression); + return new SecP224R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP224R1Point(this, x, y, zs, withCompression); + return new SecP224R1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -164,7 +164,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP224R1FieldElement(x), new SecP224R1FieldElement(y), SECP224R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP224R1FieldElement(x), new SecP224R1FieldElement(y), SECP224R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP224R1Point.cs b/crypto/src/math/ec/custom/sec/SecP224R1Point.cs
index 73c4f1948..eda660d1f 100644 --- a/crypto/src/math/ec/custom/sec/SecP224R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP224R1Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP224R1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP224R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP224R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP224R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP224R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP224R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -172,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[] { Z3 }; - return new SecP224R1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP224R1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -240,7 +206,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP224R1Field.Multiply(Z3.x, Z1.x, Z3.x); } - return new SecP224R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecP224R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -273,7 +239,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP224R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP224R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP256K1Curve.cs b/crypto/src/math/ec/custom/sec/SecP256K1Curve.cs
index 123305cd4..d9c876818 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1Curve.cs
@@ -65,14 +65,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP256K1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP256K1Point(this, x, y, withCompression); + return new SecP256K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP256K1Point(this, x, y, zs, withCompression); + return new SecP256K1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -161,7 +161,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP256K1FieldElement(x), new SecP256K1FieldElement(y), SECP256K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP256K1FieldElement(x), new SecP256K1FieldElement(y), SECP256K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP256K1Point.cs b/crypto/src/math/ec/custom/sec/SecP256K1Point.cs
index 689be0117..6b12fb41c 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1Point.cs
@@ -7,48 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP256K1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, - bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -174,7 +139,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[] { Z3 }; - return new SecP256K1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP256K1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -230,7 +195,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP256K1Field.Multiply(Z3.x, Z1.x, Z3.x, tt0); } - return new SecP256K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecP256K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -263,7 +228,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP256K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP256K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs
index b90f5d048..7a5cec8b3 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs
@@ -67,14 +67,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP256R1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP256R1Point(this, x, y, withCompression); + return new SecP256R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP256R1Point(this, x, y, zs, withCompression); + return new SecP256R1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -163,7 +163,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP256R1FieldElement(x), new SecP256R1FieldElement(y), SECP256R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP256R1FieldElement(x), new SecP256R1FieldElement(y), SECP256R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Point.cs b/crypto/src/math/ec/custom/sec/SecP256R1Point.cs
index d487aad87..878937aff 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP256R1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP256R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP256R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP256R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP256R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP256R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -173,7 +139,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; - return new SecP256R1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP256R1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -242,7 +208,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP256R1Field.Multiply(Z3.x, Z1.x, Z3.x, tt0); } - return new SecP256R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecP256R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -275,7 +241,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP256R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP256R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP384R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP384R1Curve.cs
index b57788ea0..242b73fc6 100644 --- a/crypto/src/math/ec/custom/sec/SecP384R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP384R1Curve.cs
@@ -67,14 +67,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP384R1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP384R1Point(this, x, y, withCompression); + return new SecP384R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP384R1Point(this, x, y, zs, withCompression); + return new SecP384R1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -163,7 +163,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP384R1FieldElement(x), new SecP384R1FieldElement(y), SECP384R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP384R1FieldElement(x), new SecP384R1FieldElement(y), SECP384R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP384R1Point.cs b/crypto/src/math/ec/custom/sec/SecP384R1Point.cs
index c2c364be1..bbf509a6a 100644 --- a/crypto/src/math/ec/custom/sec/SecP384R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP384R1Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP384R1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP384R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP384R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP384R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP384R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP384R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -174,7 +140,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[] { Z3 }; - return new SecP384R1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP384R1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -243,7 +209,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP384R1Field.Multiply(Z3.x, Z1.x, Z3.x, tt0); } - return new SecP384R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecP384R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -276,7 +242,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP384R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP384R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP521R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP521R1Curve.cs
index 143176b10..9cdcec036 100644 --- a/crypto/src/math/ec/custom/sec/SecP521R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP521R1Curve.cs
@@ -67,14 +67,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP521R1FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecP521R1Point(this, x, y, withCompression); + return new SecP521R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecP521R1Point(this, x, y, zs, withCompression); + return new SecP521R1Point(this, x, y, zs); } public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) @@ -163,7 +163,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(uint[] x, uint[] y) { - return m_outer.CreateRawPoint(new SecP521R1FieldElement(x), new SecP521R1FieldElement(y), SECP521R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecP521R1FieldElement(x), new SecP521R1FieldElement(y), SECP521R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecP521R1Point.cs b/crypto/src/math/ec/custom/sec/SecP521R1Point.cs
index 7fc1927cf..f0ded2c8d 100644 --- a/crypto/src/math/ec/custom/sec/SecP521R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP521R1Point.cs
@@ -7,47 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP521R1Point : AbstractFpPoint { - /** - * Create a point which encodes with point compression. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecP521R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecP521R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * Create a point that encodes with or without point compresion. - * - * @param curve - * the curve to use - * @param x - * affine x co-ordinate - * @param y - * affine y co-ordinate - * @param withCompression - * if true encode with point compression - * - * @deprecated per-point compression property will be removed, refer - * {@link #getEncoded(bool)} - */ - public SecP521R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecP521R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecP521R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -170,7 +136,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement[] zs = new ECFieldElement[] { Z3 }; - return new SecP521R1Point(curve, X3, Y3, zs, IsCompressed); + return new SecP521R1Point(curve, X3, Y3, zs); } public override ECPoint Twice() @@ -238,7 +204,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecP521R1Field.Multiply(Z3.x, Z1.x, Z3.x, tt0); } - return new SecP521R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecP521R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -271,7 +237,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (IsInfinity) return this; - return new SecP521R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + return new SecP521R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT113R1Curve.cs b/crypto/src/math/ec/custom/sec/SecT113R1Curve.cs
index 492b1d8b5..91cfc6ac0 100644 --- a/crypto/src/math/ec/custom/sec/SecT113R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT113R1Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT113FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT113R1Point(this, x, y, withCompression); + return new SecT113R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT113R1Point(this, x, y, zs, withCompression); + return new SecT113R1Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT113FieldElement(x), new SecT113FieldElement(y), SECT113R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT113FieldElement(x), new SecT113FieldElement(y), SECT113R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT113R1Point.cs b/crypto/src/math/ec/custom/sec/SecT113R1Point.cs
index db085d005..551fd159c 100644 --- a/crypto/src/math/ec/custom/sec/SecT113R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT113R1Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT113R1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT113R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT113R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT113R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT113R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT113R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).Add(curve.A); if (X3.IsZero) { - return new SecT113R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT113R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT113R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT113R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }); } public override ECPoint Twice() @@ -196,7 +183,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); if (T.IsZero) { - return new SecT113R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT113R1Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -205,7 +192,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -254,14 +241,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT113R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT113R1Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }); } public override ECPoint Negate() @@ -275,7 +262,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT113R1Point(Curve, X, L.Add(Z), new ECFieldElement[]{ Z }, IsCompressed); + return new SecT113R1Point(Curve, X, L.Add(Z), new ECFieldElement[]{ Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT113R2Curve.cs b/crypto/src/math/ec/custom/sec/SecT113R2Curve.cs
index d0fad0ff7..b11f2ad1b 100644 --- a/crypto/src/math/ec/custom/sec/SecT113R2Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT113R2Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT113FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT113R2Point(this, x, y, withCompression); + return new SecT113R2Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT113R2Point(this, x, y, zs, withCompression); + return new SecT113R2Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT113FieldElement(x), new SecT113FieldElement(y), SECT113R2_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT113FieldElement(x), new SecT113FieldElement(y), SECT113R2_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT113R2Point.cs b/crypto/src/math/ec/custom/sec/SecT113R2Point.cs
index 45fae2d95..d2c314a7e 100644 --- a/crypto/src/math/ec/custom/sec/SecT113R2Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT113R2Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT113R2Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT113R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT113R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT113R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT113R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT113R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -138,7 +125,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).Add(curve.A); if (X3.IsZero) { - return new SecT113R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT113R2Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -155,7 +142,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT113R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT113R2Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -173,7 +160,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }); } public override ECPoint Twice() @@ -202,7 +189,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); if (T.IsZero) { - return new SecT113R2Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT113R2Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -211,7 +198,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -264,14 +251,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT113R2Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT113R2Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }); } public override ECPoint Negate() @@ -285,7 +272,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT113R2Point(Curve, X, L.Add(Z), new ECFieldElement[]{ Z }, IsCompressed); + return new SecT113R2Point(Curve, X, L.Add(Z), new ECFieldElement[]{ Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT131R1Curve.cs b/crypto/src/math/ec/custom/sec/SecT131R1Curve.cs
index 2b2636901..9e6e81bf0 100644 --- a/crypto/src/math/ec/custom/sec/SecT131R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT131R1Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT131FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT131R1Point(this, x, y, withCompression); + return new SecT131R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT131R1Point(this, x, y, zs, withCompression); + return new SecT131R1Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT131FieldElement(x), new SecT131FieldElement(y), SECT131R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT131FieldElement(x), new SecT131FieldElement(y), SECT131R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT131R1Point.cs b/crypto/src/math/ec/custom/sec/SecT131R1Point.cs
index 7aba4f2e0..22102ba6c 100644 --- a/crypto/src/math/ec/custom/sec/SecT131R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT131R1Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT131R1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT131R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT131R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT131R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT131R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT131R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).Add(curve.A); if (X3.IsZero) { - return new SecT131R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT131R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT131R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT131R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -198,7 +185,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); if (T.IsZero) { - return new SecT131R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT131R1Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -207,7 +194,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -260,14 +247,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT131R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT131R1Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -281,7 +268,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT131R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT131R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT131R2Curve.cs b/crypto/src/math/ec/custom/sec/SecT131R2Curve.cs
index 123362f4d..8851c8d1c 100644 --- a/crypto/src/math/ec/custom/sec/SecT131R2Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT131R2Curve.cs
@@ -53,14 +53,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT131FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT131R2Point(this, x, y, withCompression); + return new SecT131R2Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT131R2Point(this, x, y, zs, withCompression); + return new SecT131R2Point(this, x, y, zs); } public override ECPoint Infinity @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT131FieldElement(x), new SecT131FieldElement(y), SECT131R2_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT131FieldElement(x), new SecT131FieldElement(y), SECT131R2_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT131R2Point.cs b/crypto/src/math/ec/custom/sec/SecT131R2Point.cs
index 5d06049bc..9600371c1 100644 --- a/crypto/src/math/ec/custom/sec/SecT131R2Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT131R2Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT131R2Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT131R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT131R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT131R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT131R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT131R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).Add(curve.A); if (X3.IsZero) { - return new SecT131R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT131R2Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT131R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT131R2Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -198,7 +185,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); if (T.IsZero) { - return new SecT131R2Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT131R2Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -207,7 +194,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -256,14 +243,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT131R2Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT131R2Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -277,7 +264,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT131R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT131R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT163K1Curve.cs b/crypto/src/math/ec/custom/sec/SecT163K1Curve.cs
index 31c63a8c4..2c3e67820 100644 --- a/crypto/src/math/ec/custom/sec/SecT163K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT163K1Curve.cs
@@ -64,14 +64,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT163FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT163K1Point(this, x, y, withCompression); + return new SecT163K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT163K1Point(this, x, y, zs, withCompression); + return new SecT163K1Point(this, x, y, zs); } public override bool IsKoblitz @@ -176,7 +176,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), SECT163K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), SECT163K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT163K1Point.cs b/crypto/src/math/ec/custom/sec/SecT163K1Point.cs
index 66e657cc6..0a96f04eb 100644 --- a/crypto/src/math/ec/custom/sec/SecT163K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT163K1Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT163K1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT163K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT163K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT163K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT163K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT163K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).AddOne(); if (X3.IsZero) { - return new SecT163K1Point(curve, X3, curve.B, IsCompressed); + return new SecT163K1Point(curve, X3, curve.B); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT163K1Point(curve, X3, curve.B, IsCompressed); + return new SecT163K1Point(curve, X3, curve.B); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -196,7 +183,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); if (T.IsZero) { - return new SecT163K1Point(curve, T, curve.B, IsCompressed); + return new SecT163K1Point(curve, T, curve.B); } ECFieldElement X3 = T.Square(); @@ -205,7 +192,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement t1 = L1.Add(X1).Square(); ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(X3); - return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -254,14 +241,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT163K1Point(curve, A, curve.B, IsCompressed); + return new SecT163K1Point(curve, A, curve.B); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); - return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -275,7 +262,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT163K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT163K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT163R1Curve.cs b/crypto/src/math/ec/custom/sec/SecT163R1Curve.cs
index 61c452ea7..e7c395191 100644 --- a/crypto/src/math/ec/custom/sec/SecT163R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT163R1Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT163FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT163R1Point(this, x, y, withCompression); + return new SecT163R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT163R1Point(this, x, y, zs, withCompression); + return new SecT163R1Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), SECT163R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), SECT163R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT163R1Point.cs b/crypto/src/math/ec/custom/sec/SecT163R1Point.cs
index bab1f3529..52cbf32ef 100644 --- a/crypto/src/math/ec/custom/sec/SecT163R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT163R1Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT163R1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT163R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT163R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT163R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT163R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT163R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).Add(curve.A); if (X3.IsZero) { - return new SecT163R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT163R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT163R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT163R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -198,7 +185,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); if (T.IsZero) { - return new SecT163R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT163R1Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -207,7 +194,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -256,14 +243,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT163R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT163R1Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -277,7 +264,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT163R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT163R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT163R2Curve.cs b/crypto/src/math/ec/custom/sec/SecT163R2Curve.cs
index c610b5722..05ca7007a 100644 --- a/crypto/src/math/ec/custom/sec/SecT163R2Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT163R2Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT163FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT163R2Point(this, x, y, withCompression); + return new SecT163R2Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT163R2Point(this, x, y, zs, withCompression); + return new SecT163R2Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), SECT163R2_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), SECT163R2_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT163R2Point.cs b/crypto/src/math/ec/custom/sec/SecT163R2Point.cs
index a207e6fba..40f35a93b 100644 --- a/crypto/src/math/ec/custom/sec/SecT163R2Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT163R2Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT163R2Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -136,7 +123,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).AddOne(); if (X3.IsZero) { - return new SecT163R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT163R2Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -153,7 +140,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT163R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT163R2Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -171,7 +158,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -198,7 +185,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); if (T.IsZero) { - return new SecT163R2Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT163R2Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -207,7 +194,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -259,14 +246,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT163R2Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT163R2Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); - return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -280,7 +267,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT163R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT163R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT193R1Curve.cs b/crypto/src/math/ec/custom/sec/SecT193R1Curve.cs
index 32bc434c7..44c3593d8 100644 --- a/crypto/src/math/ec/custom/sec/SecT193R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT193R1Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT193FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT193R1Point(this, x, y, withCompression); + return new SecT193R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT193R1Point(this, x, y, zs, withCompression); + return new SecT193R1Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT193FieldElement(x), new SecT193FieldElement(y), SECT193R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT193FieldElement(x), new SecT193FieldElement(y), SECT193R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT193R1Point.cs b/crypto/src/math/ec/custom/sec/SecT193R1Point.cs
index 9dbdd14c2..b4b798aff 100644 --- a/crypto/src/math/ec/custom/sec/SecT193R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT193R1Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT193R1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT193R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT193R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT193R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT193R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT193R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).Add(curve.A); if (X3.IsZero) { - return new SecT193R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT193R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT193R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT193R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -198,7 +185,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); if (T.IsZero) { - return new SecT193R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT193R1Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -207,7 +194,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -256,14 +243,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT193R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT193R1Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -277,7 +264,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT193R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT193R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT193R2Curve.cs b/crypto/src/math/ec/custom/sec/SecT193R2Curve.cs
index 7f5357177..9ff71fccf 100644 --- a/crypto/src/math/ec/custom/sec/SecT193R2Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT193R2Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT193FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT193R2Point(this, x, y, withCompression); + return new SecT193R2Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT193R2Point(this, x, y, zs, withCompression); + return new SecT193R2Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT193FieldElement(x), new SecT193FieldElement(y), SECT193R2_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT193FieldElement(x), new SecT193FieldElement(y), SECT193R2_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT193R2Point.cs b/crypto/src/math/ec/custom/sec/SecT193R2Point.cs
index b75a7ce58..782a08dfa 100644 --- a/crypto/src/math/ec/custom/sec/SecT193R2Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT193R2Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT193R2Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT193R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT193R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT193R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT193R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT193R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).Add(curve.A); if (X3.IsZero) { - return new SecT193R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT193R2Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT193R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT193R2Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -198,7 +185,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); if (T.IsZero) { - return new SecT193R2Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT193R2Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -207,7 +194,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -256,14 +243,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT193R2Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT193R2Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -277,7 +264,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT193R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT193R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT233K1Curve.cs b/crypto/src/math/ec/custom/sec/SecT233K1Curve.cs
index 7a3f55f87..512c87d70 100644 --- a/crypto/src/math/ec/custom/sec/SecT233K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT233K1Curve.cs
@@ -59,14 +59,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT233FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT233K1Point(this, x, y, withCompression); + return new SecT233K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT233K1Point(this, x, y, zs, withCompression); + return new SecT233K1Point(this, x, y, zs); } public override ECPoint Infinity @@ -176,7 +176,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT233FieldElement(x), new SecT233FieldElement(y), SECT233K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT233FieldElement(x), new SecT233FieldElement(y), SECT233K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT233K1Point.cs b/crypto/src/math/ec/custom/sec/SecT233K1Point.cs
index ffb865591..53053a144 100644 --- a/crypto/src/math/ec/custom/sec/SecT233K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT233K1Point.cs
@@ -5,32 +5,19 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT233K1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT233K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT233K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT233K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT233K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT233K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } protected override ECPoint Detach() { - return new SecT233K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + return new SecT233K1Point(null, this.AffineXCoord, this.AffineYCoord); } public override ECFieldElement YCoord @@ -136,7 +123,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1); if (X3.IsZero) { - return new SecT233K1Point(curve, X3, curve.B, IsCompressed); + return new SecT233K1Point(curve, X3, curve.B); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -153,7 +140,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT233K1Point(curve, X3, curve.B, IsCompressed); + return new SecT233K1Point(curve, X3, curve.B); } ECFieldElement ABZ2 = A.Multiply(B); @@ -171,7 +158,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -206,7 +193,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (T.IsZero) { - return new SecT233K1Point(curve, T, curve.B, IsCompressed); + return new SecT233K1Point(curve, T, curve.B); } ECFieldElement X3 = T.Square(); @@ -216,7 +203,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); - return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -268,14 +255,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT233K1Point(curve, A, curve.B, IsCompressed); + return new SecT233K1Point(curve, A, curve.B); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -289,7 +276,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT233K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT233K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT233R1Curve.cs b/crypto/src/math/ec/custom/sec/SecT233R1Curve.cs
index 7b7e59386..2487d5248 100644 --- a/crypto/src/math/ec/custom/sec/SecT233R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT233R1Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT233FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT233R1Point(this, x, y, withCompression); + return new SecT233R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT233R1Point(this, x, y, zs, withCompression); + return new SecT233R1Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT233FieldElement(x), new SecT233FieldElement(y), SECT233R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT233FieldElement(x), new SecT233FieldElement(y), SECT233R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT233R1Point.cs b/crypto/src/math/ec/custom/sec/SecT233R1Point.cs
index b9c6ce62a..59587f0f3 100644 --- a/crypto/src/math/ec/custom/sec/SecT233R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT233R1Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT233R1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT233R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT233R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT233R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT233R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT233R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).AddOne(); if (X3.IsZero) { - return new SecT233R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT233R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT233R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT233R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -194,7 +181,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); if (T.IsZero) { - return new SecT233R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT233R1Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -203,7 +190,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -251,14 +238,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT233R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT233R1Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); - return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -272,7 +259,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT233R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT233R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT239K1Curve.cs b/crypto/src/math/ec/custom/sec/SecT239K1Curve.cs
index 48854ce7e..c84962b17 100644 --- a/crypto/src/math/ec/custom/sec/SecT239K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT239K1Curve.cs
@@ -64,14 +64,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT239FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT239K1Point(this, x, y, withCompression); + return new SecT239K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT239K1Point(this, x, y, zs, withCompression); + return new SecT239K1Point(this, x, y, zs); } public override bool IsKoblitz @@ -176,7 +176,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT239FieldElement(x), new SecT239FieldElement(y), SECT239K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT239FieldElement(x), new SecT239FieldElement(y), SECT239K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT239K1Point.cs b/crypto/src/math/ec/custom/sec/SecT239K1Point.cs
index 36b4606d1..b49563a98 100644 --- a/crypto/src/math/ec/custom/sec/SecT239K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT239K1Point.cs
@@ -5,32 +5,19 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT239K1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT239K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT239K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT239K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT239K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT239K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } protected override ECPoint Detach() { - return new SecT239K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + return new SecT239K1Point(null, this.AffineXCoord, this.AffineYCoord); } public override ECFieldElement YCoord @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1); if (X3.IsZero) { - return new SecT239K1Point(curve, X3, curve.B, IsCompressed); + return new SecT239K1Point(curve, X3, curve.B); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT239K1Point(curve, X3, curve.B, IsCompressed); + return new SecT239K1Point(curve, X3, curve.B); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -203,7 +190,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (T.IsZero) { - return new SecT239K1Point(curve, T, curve.B, IsCompressed); + return new SecT239K1Point(curve, T, curve.B); } ECFieldElement X3 = T.Square(); @@ -213,7 +200,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); - return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -263,14 +250,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT239K1Point(curve, A, curve.B, IsCompressed); + return new SecT239K1Point(curve, A, curve.B); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -284,7 +271,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT239K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT239K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT283K1Curve.cs b/crypto/src/math/ec/custom/sec/SecT283K1Curve.cs
index c4d182435..462b5c9f2 100644 --- a/crypto/src/math/ec/custom/sec/SecT283K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT283K1Curve.cs
@@ -64,14 +64,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT283FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT283K1Point(this, x, y, withCompression); + return new SecT283K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT283K1Point(this, x, y, zs, withCompression); + return new SecT283K1Point(this, x, y, zs); } public override bool IsKoblitz @@ -176,7 +176,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT283FieldElement(x), new SecT283FieldElement(y), SECT283K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT283FieldElement(x), new SecT283FieldElement(y), SECT283K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT283K1Point.cs b/crypto/src/math/ec/custom/sec/SecT283K1Point.cs
index d3d7fa107..e5888daca 100644 --- a/crypto/src/math/ec/custom/sec/SecT283K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT283K1Point.cs
@@ -5,32 +5,19 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT283K1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT283K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT283K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT283K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT283K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT283K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } protected override ECPoint Detach() { - return new SecT283K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + return new SecT283K1Point(null, this.AffineXCoord, this.AffineYCoord); } public override ECFieldElement YCoord @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1); if (X3.IsZero) { - return new SecT283K1Point(curve, X3, curve.B, IsCompressed); + return new SecT283K1Point(curve, X3, curve.B); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT283K1Point(curve, X3, curve.B, IsCompressed); + return new SecT283K1Point(curve, X3, curve.B); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -202,7 +189,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (T.IsZero) { - return new SecT283K1Point(curve, T, curve.B, IsCompressed); + return new SecT283K1Point(curve, T, curve.B); } ECFieldElement X3 = T.Square(); @@ -212,7 +199,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); - return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -262,14 +249,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT283K1Point(curve, A, curve.B, IsCompressed); + return new SecT283K1Point(curve, A, curve.B); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -283,7 +270,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT283K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT283K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT283R1Curve.cs b/crypto/src/math/ec/custom/sec/SecT283R1Curve.cs
index c29413788..eae1427e1 100644 --- a/crypto/src/math/ec/custom/sec/SecT283R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT283R1Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT283FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT283R1Point(this, x, y, withCompression); + return new SecT283R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT283R1Point(this, x, y, zs, withCompression); + return new SecT283R1Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT283FieldElement(x), new SecT283FieldElement(y), SECT283R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT283FieldElement(x), new SecT283FieldElement(y), SECT283R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT283R1Point.cs b/crypto/src/math/ec/custom/sec/SecT283R1Point.cs
index 8c4092d63..761ab2b88 100644 --- a/crypto/src/math/ec/custom/sec/SecT283R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT283R1Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT283R1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT283R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT283R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT283R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT283R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT283R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).AddOne(); if (X3.IsZero) { - return new SecT283R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT283R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT283R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT283R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -194,7 +181,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); if (T.IsZero) { - return new SecT283R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT283R1Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -203,7 +190,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -251,14 +238,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT283R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT283R1Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); - return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -272,7 +259,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT283R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT283R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT409K1Curve.cs b/crypto/src/math/ec/custom/sec/SecT409K1Curve.cs
index 9e5fe88c7..dfb3ea614 100644 --- a/crypto/src/math/ec/custom/sec/SecT409K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT409K1Curve.cs
@@ -64,14 +64,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT409FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT409K1Point(this, x, y, withCompression); + return new SecT409K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT409K1Point(this, x, y, zs, withCompression); + return new SecT409K1Point(this, x, y, zs); } public override bool IsKoblitz @@ -176,7 +176,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT409FieldElement(x), new SecT409FieldElement(y), SECT409K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT409FieldElement(x), new SecT409FieldElement(y), SECT409K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT409K1Point.cs b/crypto/src/math/ec/custom/sec/SecT409K1Point.cs
index b127aea0d..e98fc77f0 100644 --- a/crypto/src/math/ec/custom/sec/SecT409K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT409K1Point.cs
@@ -5,32 +5,19 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT409K1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT409K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT409K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT409K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT409K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT409K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } protected override ECPoint Detach() { - return new SecT409K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + return new SecT409K1Point(null, this.AffineXCoord, this.AffineYCoord); } public override ECFieldElement YCoord @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1); if (X3.IsZero) { - return new SecT409K1Point(curve, X3, curve.B, IsCompressed); + return new SecT409K1Point(curve, X3, curve.B); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT409K1Point(curve, X3, curve.B, IsCompressed); + return new SecT409K1Point(curve, X3, curve.B); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -202,7 +189,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (T.IsZero) { - return new SecT409K1Point(curve, T, curve.B, IsCompressed); + return new SecT409K1Point(curve, T, curve.B); } ECFieldElement X3 = T.Square(); @@ -212,7 +199,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); - return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -262,14 +249,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT409K1Point(curve, A, curve.B, IsCompressed); + return new SecT409K1Point(curve, A, curve.B); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -283,7 +270,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT409K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT409K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT409R1Curve.cs b/crypto/src/math/ec/custom/sec/SecT409R1Curve.cs
index 845c14b40..796f18bca 100644 --- a/crypto/src/math/ec/custom/sec/SecT409R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT409R1Curve.cs
@@ -58,14 +58,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT409FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT409R1Point(this, x, y, withCompression); + return new SecT409R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT409R1Point(this, x, y, zs, withCompression); + return new SecT409R1Point(this, x, y, zs); } public override bool IsKoblitz @@ -170,7 +170,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT409FieldElement(x), new SecT409FieldElement(y), SECT409R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT409FieldElement(x), new SecT409FieldElement(y), SECT409R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT409R1Point.cs b/crypto/src/math/ec/custom/sec/SecT409R1Point.cs
index 546b10795..56b7c444c 100644 --- a/crypto/src/math/ec/custom/sec/SecT409R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT409R1Point.cs
@@ -5,26 +5,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT409R1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT409R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT409R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT409R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT409R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT409R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -134,7 +121,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = L.Square().Add(L).Add(X1).AddOne(); if (X3.IsZero) { - return new SecT409R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT409R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -151,7 +138,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = AU1.Multiply(AU2); if (X3.IsZero) { - return new SecT409R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + return new SecT409R1Point(curve, X3, curve.B.Sqrt()); } ECFieldElement ABZ2 = A.Multiply(B); @@ -169,7 +156,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -194,7 +181,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); if (T.IsZero) { - return new SecT409R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + return new SecT409R1Point(curve, T, curve.B.Sqrt()); } ECFieldElement X3 = T.Square(); @@ -203,7 +190,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); - return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -251,14 +238,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT409R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + return new SecT409R1Point(curve, A, curve.B.Sqrt()); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); - return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -272,7 +259,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT409R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT409R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT571K1Curve.cs b/crypto/src/math/ec/custom/sec/SecT571K1Curve.cs
index 544a1ba4b..79628cef3 100644 --- a/crypto/src/math/ec/custom/sec/SecT571K1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT571K1Curve.cs
@@ -64,14 +64,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT571FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT571K1Point(this, x, y, withCompression); + return new SecT571K1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT571K1Point(this, x, y, zs, withCompression); + return new SecT571K1Point(this, x, y, zs); } public override bool IsKoblitz @@ -176,7 +176,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT571FieldElement(x), new SecT571FieldElement(y), SECT571K1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT571FieldElement(x), new SecT571FieldElement(y), SECT571K1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT571K1Point.cs b/crypto/src/math/ec/custom/sec/SecT571K1Point.cs
index 0f132c84c..e5c3cc62f 100644 --- a/crypto/src/math/ec/custom/sec/SecT571K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT571K1Point.cs
@@ -7,32 +7,19 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT571K1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT571K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT571K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT571K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT571K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT571K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } protected override ECPoint Detach() { - return new SecT571K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + return new SecT571K1Point(null, this.AffineXCoord, this.AffineYCoord); } public override ECFieldElement YCoord @@ -154,7 +141,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = (SecT571FieldElement)L.Square().Add(L).Add(X1); if (X3.IsZero) { - return new SecT571K1Point(curve, X3, curve.B, IsCompressed); + return new SecT571K1Point(curve, X3, curve.B); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -178,7 +165,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (X3.IsZero) { - return new SecT571K1Point(curve, X3, curve.B, IsCompressed); + return new SecT571K1Point(curve, X3, curve.B); } Z3 = new SecT571FieldElement(t3); @@ -207,7 +194,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -240,7 +227,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (T.IsZero) { - return new SecT571K1Point(curve, T, curve.B, IsCompressed); + return new SecT571K1Point(curve, T, curve.B); } ECFieldElement X3 = T.Square(); @@ -250,7 +237,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); - return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -300,14 +287,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT571K1Point(curve, A, curve.B, IsCompressed); + return new SecT571K1Point(curve, A, curve.B); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); - return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -321,7 +308,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT571K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT571K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT571R1Curve.cs b/crypto/src/math/ec/custom/sec/SecT571R1Curve.cs
index 67343b0c9..b64cfb498 100644 --- a/crypto/src/math/ec/custom/sec/SecT571R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecT571R1Curve.cs
@@ -62,14 +62,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecT571FieldElement(x); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y) { - return new SecT571R1Point(this, x, y, withCompression); + return new SecT571R1Point(this, x, y); } - protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) { - return new SecT571R1Point(this, x, y, zs, withCompression); + return new SecT571R1Point(this, x, y, zs); } public override bool IsKoblitz @@ -174,7 +174,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec private ECPoint CreatePoint(ulong[] x, ulong[] y) { - return m_outer.CreateRawPoint(new SecT571FieldElement(x), new SecT571FieldElement(y), SECT571R1_AFFINE_ZS, false); + return m_outer.CreateRawPoint(new SecT571FieldElement(x), new SecT571FieldElement(y), SECT571R1_AFFINE_ZS); } } } diff --git a/crypto/src/math/ec/custom/sec/SecT571R1Point.cs b/crypto/src/math/ec/custom/sec/SecT571R1Point.cs
index 6a82a5ef5..1ba7909f8 100644 --- a/crypto/src/math/ec/custom/sec/SecT571R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecT571R1Point.cs
@@ -7,26 +7,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecT571R1Point : AbstractF2mPoint { - /** - * @deprecated Use ECCurve.createPoint to construct points - */ - public SecT571R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) - : this(curve, x, y, false) + internal SecT571R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : base(curve, x, y) { } - /** - * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} - */ - public SecT571R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) - : base(curve, x, y, withCompression) - { - if ((x == null) != (y == null)) - throw new ArgumentException("Exactly one of the field elements is null"); - } - - internal SecT571R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) - : base(curve, x, y, zs, withCompression) + internal SecT571R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) + : base(curve, x, y, zs) { } @@ -154,7 +141,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec X3 = (SecT571FieldElement)L.Square().Add(L).Add(X1).AddOne(); if (X3.IsZero) { - return new SecT571R1Point(curve, X3, SecT571R1Curve.SecT571R1_B_SQRT, IsCompressed); + return new SecT571R1Point(curve, X3, SecT571R1Curve.SecT571R1_B_SQRT); } ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); @@ -178,7 +165,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (X3.IsZero) { - return new SecT571R1Point(curve, X3, SecT571R1Curve.SecT571R1_B_SQRT, IsCompressed); + return new SecT571R1Point(curve, X3, SecT571R1Curve.SecT571R1_B_SQRT); } Z3 = new SecT571FieldElement(t3); @@ -206,7 +193,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } - return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Twice() @@ -247,7 +234,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (Nat576.IsZero64(T)) { - return new SecT571R1Point(curve, new SecT571FieldElement(T), SecT571R1Curve.SecT571R1_B_SQRT, IsCompressed); + return new SecT571R1Point(curve, new SecT571FieldElement(T), SecT571R1Curve.SecT571R1_B_SQRT); } ulong[] tt = Nat576.CreateExt64(); @@ -277,7 +264,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec SecT571Field.AddBothTo(X3.x, Z3.x, t2); SecT571FieldElement L3 = new SecT571FieldElement(t2); - return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint TwicePlus(ECPoint b) @@ -325,14 +312,14 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec if (A.IsZero) { - return new SecT571R1Point(curve, A, SecT571R1Curve.SecT571R1_B_SQRT, IsCompressed); + return new SecT571R1Point(curve, A, SecT571R1Curve.SecT571R1_B_SQRT); } ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); - return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }); } public override ECPoint Negate() @@ -346,7 +333,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec // L is actually Lambda (X + Y/X) here ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; - return new SecT571R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + return new SecT571R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }); } } }