mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 10:35:22 +08:00
* Add xstream * Add bigi * Add uuid-js * Add user-home * Add strip-bom * Add strip-ansi * Add slug * Add safe-regex * Add react-recaptcha * Add is-absolute-url * Add is-archive * Add is-compressed * Add is-relative-url * add is-root-path * Add is-root * Add is-text-path * add os-homedir * Add os-tmpdir * Add path-is-absolute * Add pad * Add number-is-nan * Add node-hid * Add is-finite * is-path-incwd * Add indent-string * Add cpy * Add camelcase-keys * Add blacklist * add http-codes * clamp-js * Add checkstyle-formatter * Add currency-formatter * Add multi-typeof * Add intl-messageformat * Add coinstring * Add ecurve * Add bitcoinjs-lib * Add deep-freeze * Add fuxxaldrin * Add react-body-classname * Add react-highlight-words * Update headers * Fix lint errors * remove xstream * Code review comments * Remove clamp-js in favour of https://github.com/DefinitelyTyped/DefinitelyTyped/pull/13527
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
// Type definitions for ecurve 1.0
|
|
// Project: https://github.com/cryptocoinjs/ecurve#readme
|
|
// Definitions by: Mohamed Hegazy <https://github.com/mhegazy>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types= "node" />
|
|
|
|
import BigInteger = require('bigi');
|
|
|
|
export class Curve {
|
|
p: BigInteger;
|
|
a: BigInteger;
|
|
b: BigInteger;
|
|
G: Point;
|
|
n: BigInteger;
|
|
h: BigInteger;
|
|
constructor(p: BigInteger, a: BigInteger, b: BigInteger, Gx: BigInteger, Gy: BigInteger, n: BigInteger, h: BigInteger);
|
|
isInfinity(Q: any): boolean;
|
|
isOnCurve(Q: any): boolean;
|
|
pointFromX(isOdd: boolean, x: Point): Point;
|
|
validate(Q: any): boolean;
|
|
}
|
|
export class Point {
|
|
x: BigInteger;
|
|
y: BigInteger;
|
|
z: BigInteger;
|
|
affineX: BigInteger;
|
|
affineY: BigInteger;
|
|
constructor(curve: Curve, x: BigInteger, y: BigInteger, z: BigInteger);
|
|
add(b: Point): Point;
|
|
equals(other: Point): boolean;
|
|
getEncoded(compressed?: boolean): Buffer;
|
|
multiply(k: any): Point;
|
|
multiplyTwo(j: any, x: any, k: any): Point;
|
|
negate(): Point;
|
|
toString(): string;
|
|
twice(): Point;
|
|
static decodeFrom(curve: Curve, buffer: Buffer): any;
|
|
static fromAffine(curve: Curve, x: BigInteger, y: BigInteger): Point;
|
|
}
|
|
export function getCurveByName(name: string): Curve;
|