Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jan 26, 2025
1 parent cd5a5e5 commit 8ce50e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ optionally for ECDSA. Check out [draft](https://datatracker.ietf.org/doc/draft-i
#### ECDH: Diffie-Hellman shared secrets

```ts
// 1. The output includes parity byte. Strip it using shared.slice(1)
// 2. The output is not hashed. More secure way is sha256(shared) or hkdf(shared)
const someonesPub = secp256k1.getPublicKey(secp256k1.utils.randomPrivateKey());
const shared = secp256k1.getSharedSecret(priv, someonesPub);
// NOTE:
// - `shared` includes parity byte: strip it using shared.slice(1)
// - `shared` is not hashed: more secure way is sha256(shared) or hkdf(shared)
```

#### secp256k1 Schnorr signatures from BIP340
Expand Down

0 comments on commit 8ce50e7

Please sign in to comment.