@types/elliptic
- Version 6.4.18
- Published
- 11.8 kB
- 1 dependency
- MIT license
Install
npm i @types/elliptic
yarn add @types/elliptic
pnpm add @types/elliptic
Overview
TypeScript definitions for elliptic
Index
Variables
Classes
Type Aliases
Namespaces
Variables
Classes
class ec
class ec {}
constructor
constructor(options: string | curves.PresetCurve);
property curve
curve: any;
property g
g: any;
property hash
hash: any;
property n
n: any;
property nh
nh: any;
method genKeyPair
genKeyPair: (options?: ec.GenKeyPairOptions) => ec.KeyPair;
method getKeyRecoveryParam
getKeyRecoveryParam: ( e: Error | undefined, signature: SignatureInput, Q: BN, enc?: string) => number;
method keyFromPrivate
keyFromPrivate: ( priv: Uint8Array | Buffer | string | number[] | ec.KeyPair, enc?: string) => ec.KeyPair;
method keyFromPublic
keyFromPublic: ( pub: | Uint8Array | Buffer | string | number[] | { x: string; y: string } | ec.KeyPair, enc?: string) => ec.KeyPair;
method keyPair
keyPair: (options: ec.KeyPairOptions) => ec.KeyPair;
method recoverPubKey
recoverPubKey: ( msg: BNInput, signature: SignatureInput, j: number, enc?: string) => any;
method sign
sign: { ( msg: BNInput, key: Buffer | ec.KeyPair, enc: string, options?: ec.SignOptions ): ec.Signature; (msg: any, key: any, options?: ec.SignOptions): ec.Signature;};
method verify
verify: ( msg: BNInput, signature: SignatureInput, key: Buffer | ec.KeyPair, enc?: string) => boolean;
class eddsa
class eddsa {}
constructor
constructor(name: string);
property curve
curve: curve.edwards;
method decodeInt
decodeInt: (bytes: BNInput) => BN;
method decodePoint
decodePoint: (bytes: eddsa.Bytes) => eddsa.Point;
method encodeInt
encodeInt: (num: BN) => Buffer;
method encodePoint
encodePoint: (point: eddsa.Point) => Buffer;
method hashInt
hashInt: () => BN;
method isPoint
isPoint: (val: any) => boolean;
method keyFromPublic
keyFromPublic: (pub: eddsa.Bytes | eddsa.KeyPair | eddsa.Point) => eddsa.KeyPair;
method keyFromSecret
keyFromSecret: (secret: eddsa.Bytes) => eddsa.KeyPair;
method makeSignature
makeSignature: (sig: eddsa.Signature | Buffer | string) => eddsa.Signature;
method sign
sign: (message: eddsa.Bytes, secret: eddsa.Bytes) => eddsa.Signature;
method verify
verify: ( message: eddsa.Bytes, sig: eddsa.Bytes | eddsa.Signature, pub: eddsa.Bytes | eddsa.Point | eddsa.KeyPair) => boolean;
Type Aliases
type BNInput
type BNInput = string | BN | number | Buffer | Uint8Array | readonly number[];
type SignatureInput
type SignatureInput = | ec.Signature | ec.SignatureOptions | Uint8Array | readonly number[] | string;
Namespaces
namespace curve
namespace curve {}
class base
class base {}
Base class for the curves
constructor
constructor(type: string, conf: base.BaseCurveOptions);
property g
g: base.BasePoint;
property n
n: BN;
property one
one: BN;
property p
p: BN;
property red
red: any;
property redN
redN: BN;
property two
two: BN;
property type
type: string;
property zero
zero: BN;
method decodePoint
decodePoint: (bytes: Buffer | string, enc?: 'hex') => base.BasePoint;
method validate
validate: (point: base.BasePoint) => boolean;
class edwards
class edwards extends base {}
constructor
constructor(conf: edwards.EdwardsConf);
property a
a: BN;
property c
c: BN;
property c2
c2: BN;
property d
d: BN;
property dd
dd: BN;
method point
point: ( x: BNInput, y: BNInput, z?: BNInput, t?: BNInput) => edwards.EdwardsPoint;
method pointFromJSON
pointFromJSON: (obj: BNInput[]) => edwards.EdwardsPoint;
method pointFromX
pointFromX: (x: BNInput, odd?: boolean) => edwards.EdwardsPoint;
method pointFromY
pointFromY: (y: BNInput, odd?: boolean) => edwards.EdwardsPoint;
class short
class short extends base {}
constructor
constructor(conf: short.ShortConf);
property a
a: any;
property b
b: any;
property g
g: short.ShortPoint;
method point
point: (x: BNInput, y: BNInput, isRed?: boolean) => short.ShortPoint;
method pointFromJSON
pointFromJSON: (obj: BNInput[], red: boolean) => short.ShortPoint;
method pointFromX
pointFromX: (x: BNInput, odd?: boolean) => short.ShortPoint;
namespace curve.base
namespace curve.base {}
class BasePoint
class BasePoint {}
constructor
constructor(curve: base, type: string);
property curve
curve: base;
property precomputed
precomputed: PrecomputedValues;
property type
type: string;
method add
add: (p: BasePoint) => BasePoint;
method dbl
dbl: () => BasePoint;
method dblp
dblp: (k: number) => BasePoint;
method encode
encode: { (enc: 'hex', compact: boolean): string; (enc: 'array', compact: boolean): number[];};
method encodeCompressed
encodeCompressed: { (enc: 'hex'): string; (enc?: 'array'): number[] };
method eq
eq: (p: BasePoint) => boolean;
method getX
getX: () => BN;
method getY
getY: () => BN;
method inspect
inspect: () => string;
method isInfinity
isInfinity: () => boolean;
method mul
mul: (k: BN) => BasePoint;
method neg
neg: () => BasePoint;
method precompute
precompute: (power: number) => BasePoint;
method validate
validate: () => boolean;
interface BaseCurveOptions
interface BaseCurveOptions {}
interface PrecomputedValues
interface PrecomputedValues {}
namespace curve.edwards
namespace curve.edwards {}
class EdwardsPoint
class EdwardsPoint extends base.BasePoint {}
interface EdwardsConf
interface EdwardsConf extends base.BaseCurveOptions {}
namespace curve.short
namespace curve.short {}
class ShortPoint
class ShortPoint extends base.BasePoint {}
namespace curves
namespace curves {}
class PresetCurve
class PresetCurve {}
constructor
constructor(options: PresetCurve.Options);
property g
g: any;
property hash
hash: any;
property n
n: any;
property type
type: string;
namespace curves.PresetCurve
namespace curves.PresetCurve {}
interface Options
interface Options {}
property a
a: string;
property b
b: string;
property basis
basis?: any;
property beta
beta?: string | undefined;
property g
g: any;
property gRed
gRed: boolean;
property hash
hash: any;
property lambda
lambda?: string | undefined;
property n
n: string;
property p
p: string;
property prime
prime: string | null;
property type
type: string;
namespace ec
namespace ec {}
class KeyPair
class KeyPair {}
constructor
constructor(ec: ec, options: KeyPairOptions);
property ec
ec: ec;
method derive
derive: (pub: curve.base.BasePoint) => BN;
method fromPrivate
static fromPrivate: ( ec: ec, priv: Buffer | string | KeyPair, enc?: string) => KeyPair;
method fromPublic
static fromPublic: ( ec: ec, pub: Buffer | string | { x: string; y: string } | KeyPair, enc?: string) => KeyPair;
method getPrivate
getPrivate: { (enc: 'hex'): string; (): BN };
method getPublic
getPublic: { (compact: boolean, enc: 'hex'): string; (compact: boolean, enc: 'array'): number[]; (enc: 'hex'): string; (enc: 'array'): number[]; (): curve.base.BasePoint;};
method inspect
inspect: () => string;
method sign
sign: { (msg: BNInput, enc: string, options?: SignOptions): Signature; (msg: any, options?: SignOptions): Signature;};
method validate
validate: () => { readonly result: boolean; readonly reason: string };
method verify
verify: (msg: BNInput, signature: SignatureInput) => boolean;
interface GenKeyPairOptions
interface GenKeyPairOptions {}
property entropy
entropy: any;
property entropyEnc
entropyEnc?: string | undefined;
property pers
pers?: any;
property persEnc
persEnc?: string | undefined;
interface KeyPairOptions
interface KeyPairOptions {}
interface Signature
interface Signature {}
property r
r: BN;
property recoveryParam
recoveryParam: number | null;
property s
s: BN;
method toDER
toDER: { (): number[]; (enc: 'hex'): string };
interface SignatureOptions
interface SignatureOptions {}
interface SignOptions
interface SignOptions {}
namespace eddsa
namespace eddsa {}
class KeyPair
class KeyPair {}
constructor
constructor(eddsa: eddsa, params: KeyPairOptions);
method fromPublic
static fromPublic: (eddsa: eddsa, pub: Bytes) => KeyPair;
method fromSecret
static fromSecret: (eddsa: eddsa, secret: Bytes) => KeyPair;
method getPublic
getPublic: { (enc: 'hex'): string; (): Buffer };
method getSecret
getSecret: { (enc: 'hex'): string; (): Buffer };
method secret
secret: () => Buffer;
method sign
sign: (message: Bytes) => Signature;
method verify
verify: (message: Bytes, sig: Signature | Bytes) => boolean;
class Signature
class Signature {}
constructor
constructor(eddsa: eddsa, sig: any);
method toBytes
toBytes: () => Buffer;
method toHex
toHex: () => string;
interface KeyPairOptions
interface KeyPairOptions {}
type Bytes
type Bytes = string | Buffer;
type Point
type Point = curve.base.BasePoint;
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/elliptic
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/elliptic)
- HTML<a href="https://www.jsdocs.io/package/@types/elliptic"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4822 ms. - Missing or incorrect documentation? Open an issue for this package.