aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-12-28 23:09:28 -0800
committerAdam Soltys <[email protected]>2022-12-28 23:09:28 -0800
commite802d03884457e90ee16fc31a58229234d1b2542 (patch)
treeb9a9400539b588c113777ad6ee922350da2ba519 /src/lib
parentad61c6bf6f8d5e2fb1c94008cbb185e8ad3d12b2 (diff)
downloadcoinos-ui-e802d03884457e90ee16fc31a58229234d1b2542.tar.gz
coinos-ui-e802d03884457e90ee16fc31a58229234d1b2542.zip
rm feed from homepage
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/nostr.js13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/lib/nostr.js b/src/lib/nostr.js
index 918ee153..3f112788 100644
--- a/src/lib/nostr.js
+++ b/src/lib/nostr.js
@@ -27,35 +27,24 @@ export let sign = async ({ event, user }) => {
await wait(() => !!get(pw));
password = get(pw);
- console.log('got pw');
-
let mnemonic, key, seed, entropy, child, privkey;
- let stretched = await stretch(password, Buffer.from(salt, 'hex'));
- console.log("stretched", stretched)
- if (username ==="bob") console.log(cipher, salt, password, decode(cipher, 180));
entropy = Buffer.from(
await crypto.subtle.decrypt(
{ name: 'AES-GCM', iv: new Uint8Array(16) },
- stretched,
+ await stretch(password, Buffer.from(salt, 'hex')),
Uint8Array.from(fromWords(decode(cipher, 180).words))
),
'hex'
).toString('hex');
- console.log('decoded entropy');
-
mnemonic = entropyToMnemonic(entropy);
seed = mnemonicToSeedSync(mnemonic);
key = bip32.fromSeed(seed);
child = key.derivePath("m/44'/1237'/0'/0/0");
privkey = child.privateKey;
- console.log('derived privkey');
-
event.id = await calculateId(event);
- console.log('got id');
event.sig = await signId(privkey, event.id);
- console.log('signed');
};
export let send = (event) => {