From 5609ec7644c517acc3e990582f630f5dd4d4fbd0 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 26 Jun 2023 23:38:01 +0000 Subject: [PATCH] Adjust readme docs on sig key recovery --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7fc137e..5e2b3c0 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ The package consists of two parts: - ed25519 / curve25519 / x25519 / ristretto255, edwards448 / curve448 / x448 - pairing-friendly curves bls12-381, bn254 - [pasta](https://electriccoin.co/blog/the-pasta-curves-for-halo-2-and-beyond/) curves -2. [Abstract](#abstract-api), zero-dependency elliptic curve algorithms +* [Abstract](#abstract-api), zero-dependency elliptic curve algorithms ### Implementations @@ -93,7 +93,7 @@ import { jubjub } from '@noble/curves/jubjub'; ```ts // extraEntropy https://moderncrypto.org/mail-archive/curves/2017/000925.html const sigImprovedSecurity = secp256k1.sign(msg, priv, { extraEntropy: true }); -sig.recoverPublicKey(msg) === pub; // public key recovery +sig.recoverPublicKey(msg).toRawBytes(); // === pub; // public key recovery const someonesPub = secp256k1.getPublicKey(secp256k1.utils.randomPrivateKey()); const shared = secp256k1.getSharedSecret(priv, someonesPub); // ECDH ```