/// import { BigInt } from './../utils/BigInt'; /** * Hash function interface */ export declare type Hash = (...src: (Buffer)[]) => Buffer; /** * Low Level SRP Engine that implements all required math for * SRP implementation */ export declare class SRPEngine { static create(N: string, g: string, H: 'sha-1' | 'sha-256' | 'sha-512' | Hash): SRPEngine; readonly N: BigInt; readonly Nbits: number; readonly Nbytes: number; readonly g: BigInt; readonly k: BigInt; readonly H: Hash; constructor(N: BigInt, NBits: number, g: BigInt, k: BigInt, H: Hash); /** * Computing x - Private key * @param I User Identity * @param p User Password * @param s User Salt */ computeX(I: string, p: string, s: Buffer): BigInt; /** * Computing v - Verifier * @param x Private Key */ computeV(x: BigInt): BigInt; /** * Compute B - server public key * @param v verifier * @param b secret key */ computeB(b: BigInt, v: BigInt): BigInt; /** * Compute A - client public key * @param a secret key */ computeA(a: BigInt): BigInt; /** * Compute u - Random scrambling parameter * @param A Client public key * @param B Server public key */ computeU(A: BigInt, B: BigInt): BigInt; /** * Compute Client S - Session Key * @param a Client secret key * @param B Server public key * @param x Private key * @param u Random Scrambling Parameter */ computeClientS(a: BigInt, B: BigInt, x: BigInt, u: BigInt): BigInt; /** * Compute Server S - Session key * @param b Server secret key * @param A Client public key * @param v Verifier * @param u Random Scrambling Parameter */ computeServerS(b: BigInt, A: BigInt, v: BigInt, u: BigInt): BigInt; /** * Compute K - Strong Session Key * @param S Session key */ computeK: (S: BigInt) => BigInt; /** * Compute Client Proof * @param I User Identity * @param s User Salt * @param A Client public key * @param B Server public key * @param K Strong Session Key */ computeClientProof: (I: string, s: Buffer, A: BigInt, B: BigInt, K: BigInt) => BigInt; /** * Compute Server Proof * @param A Client public key * @param M Client proof * @param K Strong Session Key */ computeServerProof: (A: BigInt, M: BigInt, K: BigInt) => BigInt; /** * Hashing wrapper */ private _H; }