\r
this.Square(chk, r[0])\r
this.Multiply(chk, chk, den)\r
- this.Multiply(this.neq25519(chk, num) ? r[0] : new Float64Array(16), r[0], this.I)\r
+\r
+ // if neq is true, multiply r[0] by I, else multiply by 1 for a no-op\r
+ const neq = this.neq25519(chk, num)\r
+ const I = new Float64Array(this.I)\r
+ for (let i = 0; i < 16; i++) {\r
+ I[i] *= neq\r
+ }\r
+ I[0] += neq ^ 1\r
+ this.Multiply(r[0], r[0], I)\r
\r
this.Square(chk, r[0])\r
this.Multiply(chk, chk, den)\r