summary refs log tree commit diff
path: root/crypto/src/math/ec/ECFieldElement.cs
diff options
context:
space:
mode:
authorOren Novotny <oren@novotny.org>2015-07-30 14:04:28 -0400
committerOren Novotny <oren@novotny.org>2015-07-30 14:04:28 -0400
commitbc097c3007e065591ffc3e3443d7503015d23d41 (patch)
tree108224d915e0d3adb37be016c4c9cd873a51dfb7 /crypto/src/math/ec/ECFieldElement.cs
parentMerge branch 'master' into master-vs12 (diff)
parentMove lazy initialization under lock (diff)
downloadBouncyCastle.NET-ed25519-bc097c3007e065591ffc3e3443d7503015d23d41.tar.xz
Merge branch 'master' into master-vs12
Diffstat (limited to 'crypto/src/math/ec/ECFieldElement.cs')
-rw-r--r--crypto/src/math/ec/ECFieldElement.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/src/math/ec/ECFieldElement.cs b/crypto/src/math/ec/ECFieldElement.cs
index 844bed649..4d4fb3e4d 100644
--- a/crypto/src/math/ec/ECFieldElement.cs
+++ b/crypto/src/math/ec/ECFieldElement.cs
@@ -604,6 +604,9 @@ namespace Org.BouncyCastle.Math.EC
             int			k3,
             BigInteger	x)
         {
+            if (x == null || x.SignValue < 0 || x.BitLength > m)
+                throw new ArgumentException("value invalid in F2m field element", "x");
+
             if ((k2 == 0) && (k3 == 0))
             {
                 this.representation = Tpb;