public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof SecP224R1FieldElement)) { return false; } SecP224R1FieldElement o = (SecP224R1FieldElement)other; return Nat224.eq(x, o.x); }
public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof SecP224R1FieldElement)) { return false; } SecP224R1FieldElement o = (SecP224R1FieldElement)other; return Nat224.eq(x, o.x); }
public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof SecP224K1FieldElement)) { return false; } SecP224K1FieldElement o = (SecP224K1FieldElement)other; return Nat224.eq(x, o.x); }
public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof SecP224K1FieldElement)) { return false; } SecP224K1FieldElement o = (SecP224K1FieldElement)other; return Nat224.eq(x, o.x); }
/** * return a sqrt root - the routine verifies that the calculation returns the right value - if * none exists it returns null. */ public ECFieldElement sqrt() { int[] c = this.x; if (Nat224.isZero(c) || Nat224.isOne(c)) { return this; } int[] nc = Nat224.create(); SecP224R1Field.negate(c, nc); int[] r = Mod.random(SecP224R1Field.P); int[] t = Nat224.create(); if (!isSquare(c)) { return null; } while (!trySqrt(nc, r, t)) { SecP224R1Field.addOne(r, r); } SecP224R1Field.square(t, r); return Nat224.eq(c, r) ? new SecP224R1FieldElement(t) : null; }
/** * return a sqrt root - the routine verifies that the calculation returns the right value - if * none exists it returns null. */ public ECFieldElement sqrt() { int[] c = this.x; if (Nat224.isZero(c) || Nat224.isOne(c)) { return this; } int[] nc = Nat224.create(); SecP224R1Field.negate(c, nc); int[] r = Mod.random(SecP224R1Field.P); int[] t = Nat224.create(); if (!isSquare(c)) { return null; } while (!trySqrt(nc, r, t)) { SecP224R1Field.addOne(r, r); } SecP224R1Field.square(t, r); return Nat224.eq(c, r) ? new SecP224R1FieldElement(t) : null; }