From: Chris Duncan Date: Tue, 3 Dec 2024 22:34:26 +0000 (-0800) Subject: Remove secret key derivation from NanoNaCl since it's not applicable to Nano. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=a1891d22fc89e7a29e0c74652f9c81aee5c8182f;p=libnemo.git Remove secret key derivation from NanoNaCl since it's not applicable to Nano. --- 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 }