diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-28 10:15:14 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-28 10:15:14 +0700 |
commit | 58f42b0ee783704cb8d2ce3b22a053f8c4f0daa8 (patch) | |
tree | eb7fcbdaf10650e10cc9299b43e67d7d321e97f9 /crypto/src/math/ec/ECPoint.cs | |
parent | Port from Java order/cofactor for all curves (diff) | |
download | BouncyCastle.NET-ed25519-58f42b0ee783704cb8d2ce3b22a053f8c4f0daa8.tar.xz |
Port point-detaching stuff from Java
Diffstat (limited to 'crypto/src/math/ec/ECPoint.cs')
-rw-r--r-- | crypto/src/math/ec/ECPoint.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/src/math/ec/ECPoint.cs b/crypto/src/math/ec/ECPoint.cs index 8f0168e27..89bd788ae 100644 --- a/crypto/src/math/ec/ECPoint.cs +++ b/crypto/src/math/ec/ECPoint.cs @@ -66,11 +66,18 @@ namespace Org.BouncyCastle.Math.EC this.m_withCompression = withCompression; } + public ECPoint GetDetachedPoint() + { + return Normalize().Detach(); + } + public virtual ECCurve Curve { get { return m_curve; } } + protected abstract ECPoint Detach(); + protected virtual int CurveCoordinateSystem { get @@ -513,6 +520,11 @@ namespace Org.BouncyCastle.Math.EC { } + protected override ECPoint Detach() + { + return new FpPoint(null, AffineXCoord, AffineYCoord); + } + protected internal override bool CompressionYTilde { get { return this.AffineYCoord.TestBitZero(); } @@ -1174,6 +1186,11 @@ namespace Org.BouncyCastle.Math.EC { } + protected override ECPoint Detach() + { + return new F2mPoint(null, AffineXCoord, AffineYCoord); + } + public override ECFieldElement YCoord { get |