Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-02-27 10:00:36 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-02-27 10:00:36 +0400
commitce0088e3cda1a8acb3e00223c4a10818a8b650e9 (patch)
treed0a22fd2a484e4f72aa2ca4fb7e34af45d3e8be3 /core/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP224K1FieldElement.java
parent32b98fc1cf0864dac783e51a492fe6d64330a530 (diff)
Equality/hashcode should ignore "excess" words
Diffstat (limited to 'core/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP224K1FieldElement.java')
-rw-r--r--core/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP224K1FieldElement.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP224K1FieldElement.java b/core/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP224K1FieldElement.java
index c49ea511..5496c30a 100644
--- a/core/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP224K1FieldElement.java
+++ b/core/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP224K1FieldElement.java
@@ -198,7 +198,7 @@ public class SecP224K1FieldElement extends ECFieldElement
int[] t2 = x84;
SecP224K1Field.square(t1, t2);
- if (Arrays.areEqual(x1, t2))
+ if (Nat224.eq(x1, t2))
{
return new SecP224K1FieldElement(t1);
}
@@ -211,7 +211,7 @@ public class SecP224K1FieldElement extends ECFieldElement
SecP224K1Field.square(t1, t2);
- if (Arrays.areEqual(x1, t2))
+ if (Nat224.eq(x1, t2))
{
return new SecP224K1FieldElement(t1);
}
@@ -232,11 +232,11 @@ public class SecP224K1FieldElement extends ECFieldElement
}
SecP224K1FieldElement o = (SecP224K1FieldElement)other;
- return Arrays.areEqual(x, o.x);
+ return Nat224.eq(x, o.x);
}
public int hashCode()
{
- return Q.hashCode() ^ Arrays.hashCode(x);
+ return Q.hashCode() ^ Arrays.hashCode(x, 0, 7);
}
}