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.
Using npm
:
npm install ed448-js
or yarn
:
yarn add ed448-js
Then include it in your code:
import createEd448 from "ed448-js";
const Ed448 = createEd448();
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
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 the EdDSA signature.