@types/ed25519
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Installation

npm install --save @types/ed25519

Summary

This package contains type definitions for ed25519 (https://github.com/dazoe/ed25519).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ed25519.

index.d.ts

// Main site: https://ed25519.cr.yp.to/
// Manually generated and maintained because the package is a
// veneer on an underlying C library; auto-generation won't work.
// The JavaScript-C interface is well described at
// https://github.com/dazoe/ed25519/blob/master/src/ed25519.cc

/// <reference types="node" />

/** The key material returned from a call to MakeKeypair(). */
export interface CurveKeyPair {
    /**
     * A Buffer containing the public portion of the Curve25519 key.
     */
    publicKey: Buffer;

    /**
     * A Buffer containing the private, secret portion of the Curve25519 key.
     */
    privateKey: Buffer;
}

/**
 * Uses the crytpographically strong random seed to generate a
 * Curve25519 key pair.
 * @return The public and private key pair.
 */
export function MakeKeypair(seed: Buffer): CurveKeyPair;

/**
 * Signs a plaintext message buffer using the private key generated using
 * MakeKeypair().
 * @return The signature calculated on the plaintext.
 */
export function Sign(message: Buffer, privateKeyOrKeyPair: Buffer | CurveKeyPair): Buffer;

/**
 * Verifies a signature for a message buffer using a
 * public key generated using MakeKeypair().
 * @return True if the signature validates correctly, false otherwise.
 */
export function Verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: @types/node

Credits

These definitions were written by .

Readme

Keywords

none

Package Sidebar

Install

npm i @types/ed25519

Weekly Downloads

588

Version

0.0.3

License

MIT

Unpacked Size

5.09 kB

Total Files

5

Last publish

Collaborators

  • types