From a1891d22fc89e7a29e0c74652f9c81aee5c8182f Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 3 Dec 2024 14:34:26 -0800 Subject: [PATCH] Remove secret key derivation from NanoNaCl since it's not applicable to Nano. --- src/lib/nano-nacl.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib/nano-nacl.ts b/src/lib/nano-nacl.ts index d3d84c0..4679023 100644 --- a/src/lib/nano-nacl.ts +++ b/src/lib/nano-nacl.ts @@ -813,10 +813,8 @@ const n = () => { checkArrayTypes(seed) if (seed.length !== crypto_sign_SEEDBYTES) throw new Error('bad seed size') - const pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES) - const sk = new Uint8Array(crypto_sign_SECRETKEYBYTES) - for (let i = 0; i < 32; i++) sk[i] = seed[i] + const pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES) const p = [gf(), gf(), gf(), gf()] const hash = new Blake2b(64).update(seed).digest() @@ -827,9 +825,7 @@ const n = () => { scalarbase(p, hash) pack(pk, p) - for (let i = 0; i < 32; i++) sk[i + 32] = pk[i] - - return { publicKey: pk, secretKey: sk } + return { publicKey: pk } } return { sign, open, detached, verify, keyPair } -- 2.34.1