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

0.3.3 • Public • Published

Installation

npm install --save @types/elgamal

Summary

This package contains type definitions for elgamal (https://github.com/kripod/elgamal.js).

Details

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

index.d.ts

import { BigInteger as BigInt } from "jsbn";

export default class ElGamal {
    p: BigInt;
    g: BigInt;
    y: BigInt;
    x: BigInt;
    static generateAsync(primeBits?: number): Promise<ElGamal>;
    constructor(
        p: BigInt | string | number,
        g: BigInt | string | number,
        y: BigInt | string | number,
        x: BigInt | string | number,
    );
    encryptAsync(m: BigInt | string | number, k?: BigInt | string | number): Promise<EncryptedValue>;
    decryptAsync(m: EncryptedValue): Promise<DecryptedValue>;
}

export { BigInt };

export class DecryptedValue {
    bi: BigInt;
    constructor(m: BigInt | string | number);
    toString(): string;
}

export class EncryptedValue {
    a: BigInt;
    b: BigInt;
    constructor(a: BigInt, b: BigInt);
    multiply(encryptedValue: EncryptedValue): EncryptedValue;
}

export namespace Utils {
    const BIG_TWO: BigInt;
    function getRandomNbitBigIntAsync(bits: number): Promise<BigInt>;
    function getRandomBigIntAsync(min: BigInt, max: BigInt): Promise<BigInt>;
    function getBigPrimeAsync(bits: number): Promise<BigInt>;
    function parseBigInt(obj: BigInt | string | number): BigInt | null;
}

export class MissingPrivateKeyError extends Error {}

Additional Details

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

Credits

These definitions were written by Yu-Hsi Chiang.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.00ts2.0
0.3.00ts2.1
0.3.00ts2.2
0.3.00ts2.3
0.3.00ts2.4
0.3.00ts2.5
0.3.00ts2.6
0.3.00ts2.7
0.3.00ts2.8
0.3.00ts2.9
0.3.00ts3.0
0.3.00ts3.1
0.3.00ts3.2
0.3.00ts3.3
0.3.00ts3.4
0.3.00ts3.5
0.3.00ts3.6
0.3.00ts3.7
0.3.00ts3.8
0.3.00ts3.9
0.3.00ts4.0
0.3.00ts4.1
0.3.00ts4.2
0.3.00ts4.3
0.3.00ts4.4
0.3.32ts5.6
0.3.32latest
0.3.32ts4.5
0.3.32ts4.6
0.3.32ts4.7
0.3.32ts4.8
0.3.32ts4.9
0.3.32ts5.0
0.3.32ts5.1
0.3.32ts5.2
0.3.32ts5.3
0.3.32ts5.4
0.3.32ts5.5
0.3.32ts5.7

Version History

VersionDownloads (Last 7 Days)Published
0.3.32
0.3.20
0.3.10
0.3.00

Package Sidebar

Install

npm i @types/elgamal

Weekly Downloads

2

Version

0.3.3

License

MIT

Unpacked Size

5.06 kB

Total Files

5

Last publish

Collaborators

  • types