Skip to content

Pure JavaScript/TypeScript implementation of Ed448 for EdDSA

License

Notifications You must be signed in to change notification settings

Iskander508/Ed448-js

Repository files navigation

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.

About

Pure JavaScript/TypeScript implementation of Ed448 for EdDSA

Resources

License

Stars

Watchers

Forks

Packages

No packages published