@types/ed2curve
Version:
TypeScript definitions for ed2curve
35 lines (25 loc) • 1.24 kB
Markdown
# Installation
> `npm install --save @types/ed2curve`
# Summary
This package contains type definitions for ed2curve (https://github.com/dchest/ed2curve-js).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ed2curve.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ed2curve/index.d.ts)
````ts
import { BoxKeyPair, SignKeyPair } from "tweetnacl";
export as namespace ed2curve;
/**
* Converts Ed25519 public key to Curve25519 public key.
* montgomeryX = (edwardsY + 1)*inverse(1 - edwardsY) mod p
*/
export function convertPublicKey(publicKey: SignKeyPair["publicKey"]): BoxKeyPair["publicKey"] | null;
/** Converts Ed25519 secret key to Curve25519 secret key. */
export function convertSecretKey(secretKey: SignKeyPair["secretKey"]): BoxKeyPair["secretKey"];
/** Converts Ed25519 key pair to Curve25519 key pair. */
export function convertKeyPair(keyPair: SignKeyPair): BoxKeyPair | null;
````
### Additional Details
* Last updated: Mon, 06 Nov 2023 22:41:05 GMT
* Dependencies: [tweetnacl](https://npmjs.com/package/tweetnacl)
# Credits
These definitions were written by [Florian Keller](https://github.com/ffflorian).