From 83ab18d6e64ade0f156c3ba97cff8a31e6e3f786 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 22 Jan 2014 12:44:18 +0700 Subject: Override methods to optimize for LongArray --- crypto/src/math/ec/ECFieldElement.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'crypto/src/math') diff --git a/crypto/src/math/ec/ECFieldElement.cs b/crypto/src/math/ec/ECFieldElement.cs index 9ebf6f41e..f31732aaf 100644 --- a/crypto/src/math/ec/ECFieldElement.cs +++ b/crypto/src/math/ec/ECFieldElement.cs @@ -974,6 +974,26 @@ namespace Org.BouncyCastle.Math.EC this.x = x; } + public override int BitLength + { + get { return x.Degree(); } + } + + public override bool IsOne + { + get { return x.IsOne(); } + } + + public override bool IsZero + { + get { return x.IsZero(); } + } + + public override bool TestBitZero() + { + return x.TestBitZero(); + } + public override BigInteger ToBigInteger() { return x.ToBigInteger(); -- cgit 1.4.1