From 7ca8774497c8e5c46fb67369909d4d9a87cbeb3f Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 21 Jun 2022 21:14:47 +0700 Subject: Remove per-ECPoint compression --- crypto/src/math/ec/custom/sec/SecP192R1Point.cs | 48 ++++--------------------- 1 file changed, 7 insertions(+), 41 deletions(-) (limited to 'crypto/src/math/ec/custom/sec/SecP192R1Point.cs') 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); } } } -- cgit 1.4.1