@foxt/js-srp
Version:
js-srp modified to add support for the SRP implementation used by Apple's iCloud.com
20 lines (19 loc) • 988 B
TypeScript
export declare function bitLength(n: bigint): number;
export declare function byteLength(n: bigint): number;
export declare function bigintFromBytes(buf: Uint8Array): bigint;
export declare function bytesFromBigint(v: bigint): Uint8Array;
export declare function randomBytes(numBytes: number): Uint8Array;
export declare function modPow(x: bigint, y: bigint, m: bigint): bigint;
export declare function concatBytes(...a: Uint8Array[]): Uint8Array;
export declare function xorBytes(a: Uint8Array, b: Uint8Array): Uint8Array;
export declare function toHex(buffer: Uint8Array): string;
export declare function fromHex(str: string): Uint8Array;
export declare function constantTimeCompare(a: Uint8Array, b: Uint8Array): boolean;
export declare enum Hash {
SHA1 = 3,
SHA256 = 5,
SHA384 = 6,
SHA512 = 7
}
export declare function hash(hash: Hash, data: ArrayBuffer): Promise<ArrayBuffer>;
export declare function hashInterleave(h: Hash, data: ArrayBuffer): Promise<ArrayBuffer>;