PHP WebShell
Текущая директория: /opt/BitGoJS/modules/sdk-lib-mpc/dist/src/shamir
Просмотр файла: shamir.d.ts
import { BaseCurve } from '../curves';
import { SplitSecret } from './types';
export declare class Shamir {
curve: BaseCurve;
constructor(curve: BaseCurve);
/**
* Perform Shamir sharing on the secret `secret` to the degree `threshold - 1` split `numShares`
* ways. The split secret requires `threshold` shares to be reconstructed.
*
* @param secret secret to split
* @param threshold share threshold required to reconstruct secret
* @param numShares total number of shares to split secret into
* @param indices optional indices which can be used while generating the shares
* @param salt optional salt which could be used while generating the shares
* @returns Dictionary containing `shares`, a dictionary where each key is an int
* in the range 1<=x<=numShares representing that share's free term, and `v`, an
* array of proofs to be shared with all participants.
*/
split(secret: bigint, threshold: number, numShares: number, indices?: Array<number>, salt?: bigint): SplitSecret;
/**
* Verify a VSS share.
*
* @param u Secret share received from other party.
* @param v Verification values received from other party.
* @param index Verifier's index.
* @returns True on success; otherwise throws Error.
*/
verify(u: bigint, v: Array<bigint>, index: number): boolean;
/**
* Reconstitute a secret from a dictionary of shares. The number of shares must
* be equal to `t` to reconstitute the original secret.
*
* @param shares dictionary of shares. each key is the free term of the share
* @returns secret
*/
combine(shares: Record<number, bigint>): bigint;
}
//# sourceMappingURL=shamir.d.ts.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!