diff options
Diffstat (limited to 'crypto/src/math/ec/custom')
8 files changed, 8 insertions, 8 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecT113FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT113FieldElement.cs index 7e9d53e44..e3a923f62 100644 --- a/crypto/src/math/ec/custom/sec/SecT113FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT113FieldElement.cs @@ -12,7 +12,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public SecT113FieldElement(BigInteger x) { - if (x == null || x.SignValue < 0) + if (x == null || x.SignValue < 0 || x.BitLength > 113) throw new ArgumentException("value invalid for SecT113FieldElement", "x"); this.x = SecT113Field.FromBigInteger(x); diff --git a/crypto/src/math/ec/custom/sec/SecT131FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT131FieldElement.cs index d60c7ed7d..65aaf01ba 100644 --- a/crypto/src/math/ec/custom/sec/SecT131FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT131FieldElement.cs @@ -12,7 +12,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public SecT131FieldElement(BigInteger x) { - if (x == null || x.SignValue < 0) + if (x == null || x.SignValue < 0 || x.BitLength > 131) throw new ArgumentException("value invalid for SecT131FieldElement", "x"); this.x = SecT131Field.FromBigInteger(x); diff --git a/crypto/src/math/ec/custom/sec/SecT163FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT163FieldElement.cs index 0ef421c71..3ab383a1d 100644 --- a/crypto/src/math/ec/custom/sec/SecT163FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT163FieldElement.cs @@ -12,7 +12,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public SecT163FieldElement(BigInteger x) { - if (x == null || x.SignValue < 0) + if (x == null || x.SignValue < 0 || x.BitLength > 163) throw new ArgumentException("value invalid for SecT163FieldElement", "x"); this.x = SecT163Field.FromBigInteger(x); diff --git a/crypto/src/math/ec/custom/sec/SecT233FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT233FieldElement.cs index 439c41d37..60b204604 100644 --- a/crypto/src/math/ec/custom/sec/SecT233FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT233FieldElement.cs @@ -12,7 +12,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public SecT233FieldElement(BigInteger x) { - if (x == null || x.SignValue < 0) + if (x == null || x.SignValue < 0 || x.BitLength > 233) throw new ArgumentException("value invalid for SecT233FieldElement", "x"); this.x = SecT233Field.FromBigInteger(x); diff --git a/crypto/src/math/ec/custom/sec/SecT239FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT239FieldElement.cs index c89b484b1..e7bfffd1f 100644 --- a/crypto/src/math/ec/custom/sec/SecT239FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT239FieldElement.cs @@ -12,7 +12,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public SecT239FieldElement(BigInteger x) { - if (x == null || x.SignValue < 0) + if (x == null || x.SignValue < 0 || x.BitLength > 239) throw new ArgumentException("value invalid for SecT239FieldElement", "x"); this.x = SecT239Field.FromBigInteger(x); diff --git a/crypto/src/math/ec/custom/sec/SecT283FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT283FieldElement.cs index 09243e859..9181b8685 100644 --- a/crypto/src/math/ec/custom/sec/SecT283FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT283FieldElement.cs @@ -12,7 +12,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public SecT283FieldElement(BigInteger x) { - if (x == null || x.SignValue < 0) + if (x == null || x.SignValue < 0 || x.BitLength > 283) throw new ArgumentException("value invalid for SecT283FieldElement", "x"); this.x = SecT283Field.FromBigInteger(x); diff --git a/crypto/src/math/ec/custom/sec/SecT409FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT409FieldElement.cs index 6dabf6a7a..b60ceafee 100644 --- a/crypto/src/math/ec/custom/sec/SecT409FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT409FieldElement.cs @@ -12,7 +12,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public SecT409FieldElement(BigInteger x) { - if (x == null || x.SignValue < 0) + if (x == null || x.SignValue < 0 || x.BitLength > 409) throw new ArgumentException("value invalid for SecT409FieldElement", "x"); this.x = SecT409Field.FromBigInteger(x); diff --git a/crypto/src/math/ec/custom/sec/SecT571FieldElement.cs b/crypto/src/math/ec/custom/sec/SecT571FieldElement.cs index 8474c912e..a26e1e336 100644 --- a/crypto/src/math/ec/custom/sec/SecT571FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecT571FieldElement.cs @@ -12,7 +12,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public SecT571FieldElement(BigInteger x) { - if (x == null || x.SignValue < 0) + if (x == null || x.SignValue < 0 || x.BitLength > 571) throw new ArgumentException("value invalid for SecT571FieldElement", "x"); this.x = SecT571Field.FromBigInteger(x); |