From 2cc2f6032c37aa6d88befc3c4d056d2873be919f Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 13 Aug 2025 14:16:05 -0700 Subject: [PATCH] Remove branching statement. --- src/lib/crypto/nano-nacl.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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) } -- 2.47.3