|
|
@ -95,11 +95,13 @@ function pointFpEquals(other) { |
|
|
|
if (other.isInfinity()) return this.isInfinity() |
|
|
|
|
|
|
|
// u = Y2 * Z1 - Y1 * Z2
|
|
|
|
u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q) |
|
|
|
var u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q) |
|
|
|
|
|
|
|
if (u.signum() !== 0) return false |
|
|
|
|
|
|
|
// v = X2 * Z1 - X1 * Z2
|
|
|
|
v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q) |
|
|
|
var v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q) |
|
|
|
|
|
|
|
return v.signum() === 0 |
|
|
|
} |
|
|
|
|
|
|
|