From 125e93ac90fab535316f55695f14dde8e9c76c97 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Mon, 28 Dec 2015 14:59:52 +0700 Subject: Optimized Sqrt and Trace for custom binary curves --- crypto/src/math/ec/custom/sec/SecT163FieldElement.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crypto/src/math/ec/custom/sec/SecT163FieldElement.cs') diff --git a/crypto/src/math/ec/custom/sec/SecT163FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT163FieldElement.cs index c7a0b5639..8953fb529 100644 --- a/crypto/src/math/ec/custom/sec/SecT163FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT163FieldElement.cs @@ -159,7 +159,9 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public override ECFieldElement Sqrt() { - return SquarePow(M - 1); + ulong[] z = Nat192.Create64(); + SecT163Field.Sqrt(x, z); + return new SecT163FieldElement(z); } public virtual int Representation -- cgit 1.5.1