From: Chris Duncan Date: Wed, 23 Jul 2025 15:21:48 +0000 (-0700) Subject: Reuse internal method for NaCl hashing instead of new Blake instance with the goal... X-Git-Tag: v0.10.5~55^2~21 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=ea0041821b4d401017901b8d407810546d6d2e61;p=libnemo.git Reuse internal method for NaCl hashing instead of new Blake instance with the goal of eventually implementing Blake internally. --- diff --git a/src/lib/workers/nano-nacl.ts b/src/lib/workers/nano-nacl.ts index c6b0259..7773fa3 100644 --- a/src/lib/workers/nano-nacl.ts +++ b/src/lib/workers/nano-nacl.ts @@ -589,7 +589,8 @@ export class NanoNaCl extends WorkerInterface { const pk = new Uint8Array(this.crypto_sign_PUBLICKEYBYTES) const p: Float64Array[] = [this.gf(), this.gf(), this.gf(), this.gf()] - const hash = new Blake2b(64).update(seed).digest() + const hash = new Uint8Array(64) + this.crypto_hash(hash, seed, 64) hash[0] &= 248 hash[31] &= 127 hash[31] |= 64