@cloudflare/zkp-ecdsa
Version:
zkp-ecdsa: A Typescript Implementation of ZKAttest
62 lines • 2.08 kB
TypeScript
export declare abstract class Group {
readonly p: bigint;
readonly order: bigint;
name: string;
constructor(name: string, p: bigint, order: bigint);
abstract identity(): Group.Point;
abstract generator(): Group.Point;
abstract isOnGroup(_: Group.Point): boolean;
abstract sizePointBytes(): number;
abstract deserializePoint(_: Uint8Array): Group.Point;
isCompatPoint(pt: Group.Point): true | never;
isCompatScalar(s: Group.Scalar): true | never;
sizeFieldBytes(): number;
eq(g: Group): boolean;
newScalar(s: bigint): Group.Scalar;
randomScalar(): Group.Scalar;
deserializeScalar(a: Uint8Array): Group.Scalar;
}
export declare namespace Group {
abstract class Point {
abstract readonly group: Group;
abstract isIdentity(): boolean;
abstract eq(_: Point): boolean;
abstract neg(): this;
abstract dbl(): this;
abstract add(_: this): this;
abstract toAffine(): {
x: bigint;
y: bigint;
} | false;
abstract toBytes(): Uint8Array;
isCompatPoint(pt: this): true | never;
isCompatScalar(s: Group.Scalar): true | never;
static toStringCoords(coords: Array<{
name: string;
value: bigint;
}>): string;
sub(pt: this): this;
dblmul(s1: Group.Scalar, p2: this, s2: Group.Scalar): this;
mul(s: Group.Scalar): this;
}
class Scalar {
readonly group: Group;
k: bigint;
constructor(group: Group, s: bigint);
toString(): string;
bits(): string;
base16(): string;
eq(s: Scalar): boolean;
add(s: Scalar): Scalar;
sub(s: Scalar): Scalar;
mul(s: Scalar): Scalar;
neg(): Scalar;
toBytes(): Uint8Array;
isOne(): boolean;
isZero(): boolean;
cmp(s: Scalar): number;
protected reduce(): void;
}
}
export declare function hashPoints(hashID: string, points: Group.Point[]): Promise<bigint>;
//# sourceMappingURL=group.d.ts.map