From 73cb18129e632b44ddae7f9c589fd9c17c77d3ca Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 22 Jan 2014 11:40:05 +0700 Subject: Use new Math.Field classes in EC curves, and avoid casting in client code --- crypto/test/src/math/ec/test/ECPointTest.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'crypto/test') diff --git a/crypto/test/src/math/ec/test/ECPointTest.cs b/crypto/test/src/math/ec/test/ECPointTest.cs index 78f0a3ca6..696448544 100644 --- a/crypto/test/src/math/ec/test/ECPointTest.cs +++ b/crypto/test/src/math/ec/test/ECPointTest.cs @@ -411,21 +411,10 @@ namespace Org.BouncyCastle.Math.EC.Tests private void implTestEncoding(ECPoint p) { // Not Point Compression - ECPoint unCompP; + ECPoint unCompP = p.Curve.CreatePoint(p.X.ToBigInteger(), p.Y.ToBigInteger(), false); // Point compression - ECPoint compP; - - if (p is FpPoint) - { - unCompP = new FpPoint(p.Curve, p.X, p.Y, false); - compP = new FpPoint(p.Curve, p.X, p.Y, true); - } - else - { - unCompP = new F2mPoint(p.Curve, p.X, p.Y, false); - compP = new F2mPoint(p.Curve, p.X, p.Y, true); - } + ECPoint compP = p.Curve.CreatePoint(p.X.ToBigInteger(), p.Y.ToBigInteger(), true); byte[] unCompBarr = unCompP.GetEncoded(); ECPoint decUnComp = p.Curve.DecodePoint(unCompBarr); -- cgit 1.4.1