From ea0041821b4d401017901b8d407810546d6d2e61 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 23 Jul 2025 08:21:48 -0700 Subject: [PATCH] Reuse internal method for NaCl hashing instead of new Blake instance with the goal of eventually implementing Blake internally. --- src/lib/workers/nano-nacl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.47.3