diff options
Diffstat (limited to 'libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECPair.java')
-rw-r--r-- | libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECPair.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECPair.java b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECPair.java new file mode 100644 index 000000000..1b8d247db --- /dev/null +++ b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECPair.java @@ -0,0 +1,40 @@ +package org.spongycastle.crypto.ec; + +import org.spongycastle.math.ec.ECPoint; + +public class ECPair +{ + private final ECPoint x; + private final ECPoint y; + + public ECPair(ECPoint x, ECPoint y) + { + this.x = x; + this.y = y; + } + + public ECPoint getX() + { + return x; + } + + public ECPoint getY() + { + return y; + } + + public boolean equals(ECPair other) + { + return other.getX().equals(getX()) && other.getY().equals(getY()); + } + + public boolean equals(Object other) + { + return other instanceof ECPair ? equals((ECPair)other) : false; + } + + public int hashCode() + { + return x.hashCode() + 37 * y.hashCode(); + } +} |