]> git.codecow.com Git - libnemo.git/commitdiff
Reuse internal method for NaCl hashing instead of new Blake instance with the goal...
authorChris Duncan <chris@zoso.dev>
Wed, 23 Jul 2025 15:21:48 +0000 (08:21 -0700)
committerChris Duncan <chris@zoso.dev>
Wed, 23 Jul 2025 15:21:48 +0000 (08:21 -0700)
src/lib/workers/nano-nacl.ts

index c6b025918a0bd5d86a34ad102720b3665d8061a0..7773fa3592dd98ac8f76c13b4bdf89b4097e391d 100644 (file)
@@ -589,7 +589,8 @@ export class NanoNaCl extends WorkerInterface {
                const pk = new Uint8Array(this.crypto_sign_PUBLICKEYBYTES)\r
                const p: Float64Array[] = [this.gf(), this.gf(), this.gf(), this.gf()]\r
 \r
-               const hash = new Blake2b(64).update(seed).digest()\r
+               const hash = new Uint8Array(64)\r
+               this.crypto_hash(hash, seed, 64)\r
                hash[0] &= 248\r
                hash[31] &= 127\r
                hash[31] |= 64\r