diff options
author | Peter Dettman <peter.dettman@gmail.com> | 2022-06-21 21:14:47 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@gmail.com> | 2022-06-21 21:14:47 +0700 |
commit | 7ca8774497c8e5c46fb67369909d4d9a87cbeb3f (patch) | |
tree | e7ab545ca1b51d48f3506ccbf310c34275d2f8ac /crypto/src/math/ec/custom/sec/SecP256K1Point.cs | |
parent | Remove legacy TLS (diff) | |
download | BouncyCastle.NET-ed25519-7ca8774497c8e5c46fb67369909d4d9a87cbeb3f.tar.xz |
Remove per-ECPoint compression
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecP256K1Point.cs')
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP256K1Point.cs | 49 |
1 files changed, 7 insertions, 42 deletions
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); } } } |