diff options
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/crypto/params/ECDomainParameters.java')
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/crypto/params/ECDomainParameters.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/params/ECDomainParameters.java b/bcprov/src/main/java/org/bouncycastle/crypto/params/ECDomainParameters.java index 9cc6e727..c97f2e76 100644 --- a/bcprov/src/main/java/org/bouncycastle/crypto/params/ECDomainParameters.java +++ b/bcprov/src/main/java/org/bouncycastle/crypto/params/ECDomainParameters.java @@ -71,4 +71,34 @@ public class ECDomainParameters { return Arrays.clone(seed); } + + public boolean equals( + Object obj) + { + if (this == obj) + { + return true; + } + + if ((obj instanceof ECDomainParameters)) + { + ECDomainParameters other = (ECDomainParameters)obj; + + return this.curve.equals(other.curve) && this.G.equals(other.G) && this.n.equals(other.n) && this.h.equals(other.h); + } + + return false; + } + + public int hashCode() + { + int hc = curve.hashCode(); + hc *= 37; + hc ^= G.hashCode(); + hc *= 37; + hc ^= n.hashCode(); + hc *= 37; + hc ^= h.hashCode(); + return hc; + } } |