From: Chris Duncan Date: Wed, 13 Aug 2025 21:16:05 +0000 (-0700) Subject: Remove branching statement. X-Git-Tag: v0.10.5~41^2~105 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=2cc2f6032c37aa6d88befc3c4d056d2873be919f;p=libnemo.git Remove branching statement. --- diff --git a/src/lib/crypto/nano-nacl.ts b/src/lib/crypto/nano-nacl.ts index fa9ddf8..5370882 100644 --- a/src/lib/crypto/nano-nacl.ts +++ b/src/lib/crypto/nano-nacl.ts @@ -37,12 +37,13 @@ export class NanoNaCl { static pow2523 (o: BigInt64Array, i: BigInt64Array): void { const c: BigInt64Array = new BigInt64Array(16) c.set(i.subarray(0, 16), 0) - for (let a = 250; a >= 0; a--) { + for (let a = 0; a < 249; a++) { this.Square(c, c) - if (a !== 1) { - this.Multiply(c, c, i) - } + this.Multiply(c, c, i) } + this.Square(c, c) + this.Square(c, c) + this.Multiply(c, c, i) o.set(c, 0) }