diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-22 12:44:18 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-22 12:44:18 +0700 |
commit | 83ab18d6e64ade0f156c3ba97cff8a31e6e3f786 (patch) | |
tree | 45106ff01d51ca14c9440ca70fd2eb28877ad3ae /crypto/src/math/ec | |
parent | Use new Math.Field classes in EC curves, and avoid casting in client code (diff) | |
download | BouncyCastle.NET-ed25519-83ab18d6e64ade0f156c3ba97cff8a31e6e3f786.tar.xz |
Override methods to optimize for LongArray
Diffstat (limited to 'crypto/src/math/ec')
-rw-r--r-- | crypto/src/math/ec/ECFieldElement.cs | 20 |
1 files changed, 20 insertions, 0 deletions
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(); |