From: Chris Duncan Date: Tue, 29 Sep 2026 19:57:51 +0000 (-0700) Subject: Reduce load calls and eliminate loop in blake-gen. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=35d5644b8ea2c678cb8de497f9d5d1cbdfe673df;p=nano25519.git Reduce load calls and eliminate loop in blake-gen. --- diff --git a/scripts/blake2b-gen.mjs b/scripts/blake2b-gen.mjs index 815c555..7d189fb 100644 --- a/scripts/blake2b-gen.mjs +++ b/scripts/blake2b-gen.mjs @@ -110,17 +110,15 @@ const INIT = (() => { output += ` // initialize hash state + const p_ptr = changetype(this.p) ` for (let i = 0; i < H_LENGTH; i++) { output += ` - this.h[${i}] = ${blake2b_iv[i]} + this.h[${i}] = ${blake2b_iv[i]} ^ load(p_ptr, ${i << 3}) ` } output += ` - for (let i = 0; i < ${H_LENGTH}; i++) { - this.h[i] ^= load(changetype(this.p) + (i << 3)) - } return this } `