diff --git a/crypto/src/crypto/parameters/ECPublicKeyParameters.cs b/crypto/src/crypto/parameters/ECPublicKeyParameters.cs
index 9e71c2a25..1eb665da9 100644
--- a/crypto/src/crypto/parameters/ECPublicKeyParameters.cs
+++ b/crypto/src/crypto/parameters/ECPublicKeyParameters.cs
@@ -7,78 +7,78 @@ using Org.BouncyCastle.Math.EC;
namespace Org.BouncyCastle.Crypto.Parameters
{
public class ECPublicKeyParameters
- : ECKeyParameters
+ : ECKeyParameters
{
private readonly ECPoint q;
- public ECPublicKeyParameters(
- ECPoint q,
- ECDomainParameters parameters)
- : this("EC", q, parameters)
- {
- }
-
- [Obsolete("Use version with explicit 'algorithm' parameter")]
- public ECPublicKeyParameters(
- ECPoint q,
- DerObjectIdentifier publicKeyParamSet)
- : base("ECGOST3410", false, publicKeyParamSet)
- {
- if (q == null)
- throw new ArgumentNullException("q");
-
- this.q = q;
- }
-
- public ECPublicKeyParameters(
- string algorithm,
- ECPoint q,
- ECDomainParameters parameters)
- : base(algorithm, false, parameters)
+ public ECPublicKeyParameters(
+ ECPoint q,
+ ECDomainParameters parameters)
+ : this("EC", q, parameters)
{
- if (q == null)
- throw new ArgumentNullException("q");
+ }
+
+ [Obsolete("Use version with explicit 'algorithm' parameter")]
+ public ECPublicKeyParameters(
+ ECPoint q,
+ DerObjectIdentifier publicKeyParamSet)
+ : base("ECGOST3410", false, publicKeyParamSet)
+ {
+ if (q == null)
+ throw new ArgumentNullException("q");
- this.q = q;
- }
+ this.q = q.Normalize();
+ }
- public ECPublicKeyParameters(
- string algorithm,
- ECPoint q,
- DerObjectIdentifier publicKeyParamSet)
- : base(algorithm, false, publicKeyParamSet)
+ public ECPublicKeyParameters(
+ string algorithm,
+ ECPoint q,
+ ECDomainParameters parameters)
+ : base(algorithm, false, parameters)
{
- if (q == null)
- throw new ArgumentNullException("q");
+ if (q == null)
+ throw new ArgumentNullException("q");
- this.q = q;
- }
+ this.q = q.Normalize();
+ }
- public ECPoint Q
+ public ECPublicKeyParameters(
+ string algorithm,
+ ECPoint q,
+ DerObjectIdentifier publicKeyParamSet)
+ : base(algorithm, false, publicKeyParamSet)
{
- get { return q; }
+ if (q == null)
+ throw new ArgumentNullException("q");
+
+ this.q = q.Normalize();
}
- public override bool Equals(object obj)
+ public ECPoint Q
{
- if (obj == this)
- return true;
+ get { return q; }
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj == this)
+ return true;
- ECPublicKeyParameters other = obj as ECPublicKeyParameters;
+ ECPublicKeyParameters other = obj as ECPublicKeyParameters;
- if (other == null)
- return false;
+ if (other == null)
+ return false;
- return Equals(other);
+ return Equals(other);
}
- protected bool Equals(
- ECPublicKeyParameters other)
- {
- return q.Equals(other.q) && base.Equals(other);
- }
+ protected bool Equals(
+ ECPublicKeyParameters other)
+ {
+ return q.Equals(other.q) && base.Equals(other);
+ }
- public override int GetHashCode()
+ public override int GetHashCode()
{
return q.GetHashCode() ^ base.GetHashCode();
}
|