From 58f42b0ee783704cb8d2ce3b22a053f8c4f0daa8 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 28 Jan 2014 10:15:14 +0700 Subject: Port point-detaching stuff from Java --- crypto/src/math/ec/custom/sec/SecP256K1Point.cs | 5 +++++ crypto/src/math/ec/custom/sec/SecP256R1Point.cs | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'crypto/src/math/ec/custom') diff --git a/crypto/src/math/ec/custom/sec/SecP256K1Point.cs b/crypto/src/math/ec/custom/sec/SecP256K1Point.cs index 548db535c..d981911a6 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1Point.cs @@ -50,6 +50,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec { } + protected override ECPoint Detach() + { + return new SecP256K1Point(null, AffineXCoord, AffineYCoord); + } + protected internal override bool CompressionYTilde { get { return this.AffineYCoord.TestBitZero(); } diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Point.cs b/crypto/src/math/ec/custom/sec/SecP256R1Point.cs index 11e79678f..be54e0dda 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1Point.cs @@ -49,6 +49,11 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec { } + protected override ECPoint Detach() + { + return new SecP256R1Point(null, AffineXCoord, AffineYCoord); + } + protected internal override bool CompressionYTilde { get { return this.AffineYCoord.TestBitZero(); } -- cgit 1.5.1