2.0.0 • Published 2 years ago

ed448-js v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ed448-js GitHub license Tests npm version Coverage Status Monthly Downloads

Pure JavaScript/TypeScript implementation of the Ed448 elliptic curve (RFC 8032) for EdDSA signature. Uses the jsbn library for big integer operations. Uses jssha for SHAKE256 hash calculation.

Installation

Using npm:

npm install ed448-js

or yarn:

yarn add ed448-js

Then include it in your code:

import createEd448 from "ed448-js";

Usage

const Ed448 = createEd448();

getPublicKey(privateKey)

Calculate public key from a provided private key

const privateKey = crypto.randomFillSync(new Uint8Array(57));
const publicKey = Ed448.getPublicKey(privateKey);

The private key can be any random generated byte-array of length 57

sign(privateKey, message, context?): number[]

Calculate the EdDSA signature. The result is represented as plain number array (length: 114). It can be converted using Buffer.from, or Uint8Array.from.

verify(publicKey, message, signature, context?): boolean

Verify the EdDSA signature.

2.0.0

2 years ago

1.0.0

2 years ago