1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import BigInteger = require('bigi');
|
9 |
|
10 | export class Curve {
|
11 | p: BigInteger;
|
12 | a: BigInteger;
|
13 | b: BigInteger;
|
14 | G: Point;
|
15 | n: BigInteger;
|
16 | h: BigInteger;
|
17 | constructor(p: BigInteger, a: BigInteger, b: BigInteger, Gx: BigInteger, Gy: BigInteger, n: BigInteger, h: BigInteger);
|
18 | isInfinity(Q: any): boolean;
|
19 | isOnCurve(Q: any): boolean;
|
20 | pointFromX(isOdd: boolean, x: Point): Point;
|
21 | validate(Q: any): boolean;
|
22 | }
|
23 | export class Point {
|
24 | x: BigInteger;
|
25 | y: BigInteger;
|
26 | z: BigInteger;
|
27 | affineX: BigInteger;
|
28 | affineY: BigInteger;
|
29 | constructor(curve: Curve, x: BigInteger, y: BigInteger, z: BigInteger);
|
30 | add(b: Point): Point;
|
31 | equals(other: Point): boolean;
|
32 | getEncoded(compressed?: boolean): Buffer;
|
33 | multiply(k: any): Point;
|
34 | multiplyTwo(j: any, x: any, k: any): Point;
|
35 | negate(): Point;
|
36 | toString(): string;
|
37 | twice(): Point;
|
38 | static decodeFrom(curve: Curve, buffer: Buffer): any;
|
39 | static fromAffine(curve: Curve, x: BigInteger, y: BigInteger): Point;
|
40 | }
|
41 | export function getCurveByName(name: string): Curve;
|