# noise-curve-secp

> `secp256k1` elliptic curve operations for use with [`noise-handshake`](https://github.com/chm-diederichs/noise-handshake)

Latest version **3.0.0** (published 2022-09-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install noise-curve-secp
pnpm add noise-curve-secp
yarn add noise-curve-secp
bun add noise-curve-secp
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2022-09-21 |
| First published | 2021-07-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/noise-curve-secp) |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | chm-diederichs |

## Links

- npm: https://www.npmjs.com/package/noise-curve-secp
- Repository: https://github.com/chm-diederichs/noise-curve-secp256k1
- Homepage: https://github.com/chm-diederichs/noise-curve-secp256k1#readme
- Issues: https://github.com/chm-diederichs/noise-curve-secp256k1/issues
- npm.io page: https://npm.io/package/noise-curve-secp

## Dependencies (3)

- [nanoassert](https://npm.io/package/nanoassert.md) ^2.0.0
- [secp256k1-native](https://npm.io/package/secp256k1-native.md) ^1.1.2
- [sodium-universal](https://npm.io/package/sodium-universal.md) ^3.0.4

## Recent versions

- 3.0.0 (latest) — 2022-09-21
- 2.0.0 — 2021-09-14
- 1.0.2 — 2021-08-19
- 1.0.1 — 2021-08-19
- 1.0.0 — 2021-07-16

## README

# noise-curve-secp

`secp256k1` elliptic curve operations for use with [`noise-handshake`](https://github.com/chm-diederichs/noise-handshake)

## Usage
```js
const curve = require('noise-curve-secp256k1')
const Noise = require('noise-handshake')

const handshake = new Noise(pattern, initiator, staticKeyPair, { curve })
```

## API

#### constants

`DHLEN` = 32
`PKLEN` = 64
`SKLEN` = 32
`ALG` = 'secp256k1'

#### `generateKeyPair([privKey])`

Generate a new keypair, optionally pass in a preexisting `privKey`. Return value is of the form:

```
{
  publicKey,
  secretKey
}
```

#### `dh(pk, lsk)`

Perform DH between `pk` and `lsk` and return the result.

---
_Source: https://npm.io/package/noise-curve-secp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
