From e1640eb74e64301db5207a480d2d1e4015761fd5 Mon Sep 17 00:00:00 2001 From: YoungHoon Cha <86239699+yhc125@users.noreply.github.com> Date: Tue, 17 Oct 2023 00:28:21 +0900 Subject: [PATCH] Update README.md Added libraries missing from the code examples. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0bce327..17790df 100644 --- a/README.md +++ b/README.md @@ -761,6 +761,7 @@ if you need to hash to **public key**. import { p256 } from '@noble/curves/p256'; import { sha256 } from '@noble/hashes/sha256'; import { hkdf } from '@noble/hashes/hkdf'; +import * as mod from '@noble/curves/abstract/modular'; const someKey = new Uint8Array(32).fill(2); // Needs to actually be random, not .fill(2) const derived = hkdf(sha256, someKey, undefined, 'application', 48); // 48 bytes for 32-byte priv const validPrivateKey = mod.hashToPrivateScalar(derived, p256.CURVE.n);