bsrp
Version:
Secure Remote Password Protocol (SRP-6a) Implementation
11 lines (10 loc) • 788 B
TypeScript
import { BigInteger } from "jsbn";
export declare const generateRandomBytes: (length: number) => Uint8Array;
export declare type Input = BigInteger | Uint8Array;
export declare const toBytes: (input: Input) => Uint8Array;
export declare const toBigInteger: (input: Input) => BigInteger;
export declare const pad: (input: Input, length: number) => Uint8Array;
export declare type HashInput = Input | string;
export declare const hash: (...args: Array<HashInput>) => Promise<Uint8Array>;
export declare const calculateX: (salt: BigInteger, identity: string, password: string) => Promise<BigInteger>;
export declare const calculateM: (generator: BigInteger, prime: BigInteger, identity: string, salt: BigInteger, A: BigInteger, B: BigInteger, sessionKey: Uint8Array) => Promise<Uint8Array>;