1 files changed, 3 insertions, 18 deletions
diff --git a/crypto/src/crypto/parameters/ECPublicKeyParameters.cs b/crypto/src/crypto/parameters/ECPublicKeyParameters.cs
index 474e5d82c..69916e525 100644
--- a/crypto/src/crypto/parameters/ECPublicKeyParameters.cs
+++ b/crypto/src/crypto/parameters/ECPublicKeyParameters.cs
@@ -9,21 +9,6 @@ namespace Org.BouncyCastle.Crypto.Parameters
public class ECPublicKeyParameters
: ECKeyParameters
{
- private static ECPoint Validate(ECPoint q)
- {
- if (q == null)
- throw new ArgumentNullException("q");
- if (q.IsInfinity)
- throw new ArgumentException("point at infinity", "q");
-
- q = q.Normalize();
-
- if (!q.IsValid())
- throw new ArgumentException("point not on curve", "q");
-
- return q;
- }
-
private readonly ECPoint q;
public ECPublicKeyParameters(
@@ -42,7 +27,7 @@ namespace Org.BouncyCastle.Crypto.Parameters
if (q == null)
throw new ArgumentNullException("q");
- this.q = Validate(q);
+ this.q = ECDomainParameters.Validate(Parameters.Curve, q);
}
public ECPublicKeyParameters(
@@ -54,7 +39,7 @@ namespace Org.BouncyCastle.Crypto.Parameters
if (q == null)
throw new ArgumentNullException("q");
- this.q = Validate(q);
+ this.q = ECDomainParameters.Validate(Parameters.Curve, q);
}
public ECPublicKeyParameters(
@@ -66,7 +51,7 @@ namespace Org.BouncyCastle.Crypto.Parameters
if (q == null)
throw new ArgumentNullException("q");
- this.q = Validate(q);
+ this.q = ECDomainParameters.Validate(Parameters.Curve, q);
}
public ECPoint Q
|