noise-curve-tiny-secp
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

noise-curve-secp256k1

Js secp256k1 elliptic curve module for noise-handshake

Usage

import { secp256k1 } from 'noise-curve-secp256k1';
import Noise from 'noise-handshake';

const handshake = new Noise(pattern, initiator, staticKeyPair, {
  curve: secp256k1,
});

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
}

generateSeedKeyPair(seed)

Generate a new keypair from a seed. Return value is of the form:

{
  publicKey,
  secretKey
}

dh(pk, lsk)

Perform DH between pk and lsk and return the result.

Package Sidebar

Install

npm i noise-curve-tiny-secp

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

6.68 kB

Total Files

8

Last publish

Collaborators

  • nzh