/** * @module secret helper/util/etc. functions * * this is where you will find helper functions like those that generate * and parse ibs for secret. */ import { HashAlgorithm } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs'; import { Ib } from '@ibgib/ts-gib/dist/types.mjs'; import { CheckIfPasswordProbablyCorrectInfo, SecretData_V1, SecretIbGib_V1, SecretInfo, SecretType } from './secret-types.mjs'; import { MetaspaceService } from "../../witness/space/metaspace/metaspace-types.mjs"; import { IbGibSpaceAny } from "../../witness/space/space-base-v1.mjs"; export declare function validateCommonSecretData({ data, }: { data?: SecretData_V1; }): string[]; export declare function validateCommonSecretIbGib({ ibGib, }: { ibGib: SecretIbGib_V1; }): Promise; /** * builds the ib based on data. * * atow (02/2024) this is only data.name and data.type. * * @returns `${SECRET_ATOM} ${type} ${name}` atow (02/2024) */ export declare function getSecretIb({ data, }: { data: SecretData_V1; }): Ib; /** * Current schema is '[SECRET_ATOM] [type] [name]' * * NOTE this is space-delimited */ export declare function parseSecretIb({ ib, }: { ib: Ib; }): { atom: string; type: string; name: string; }; export declare function createAndRegisterNewSecret({ secretType, secretInfo, metaspace, space, }: { secretType: SecretType; secretInfo: SecretInfo; metaspace: MetaspaceService; space: IbGibSpaceAny; }): Promise; /** * executes the hash16816 fn on the incoming {@link password} using parameters * {@link recursionCount}, {@link saltPrependedPerHash} and {@link algorithm}. * Then selects a random contiguous substring of {@link substringLength} of the * resultant hash. * * @returns {@link substringLength} of deterministic hash * * This is a novel idea only useful in a byzantine fault tolerant distributed * computation context, so to understand how this is used, PLEASE... * @see {@link CheckIfPasswordProbablyCorrectInfo} */ export declare function getCheckIfPasswordProbablyCorrectInfo({ password, substringLength, recursionCount, saltPrependedPerHash, algorithm, }: { /** * string that we're going to hash and return the substring of. */ password: string; /** * length of the substring of the hash */ substringLength: number; /** * salt when recursively hashing */ saltPrependedPerHash: string; /** * algorithm to use. defaults to 'SHA-256' */ algorithm: HashAlgorithm; /** * number of recursions to do. Defaults to 16816. */ recursionCount: number; }): Promise; /** * confirmation side of verifying if a consumer's password is **probably** * correct. Basically computes the silly hash of the password and checks to see * if it contains the given substring. * * @see {@link CheckIfPasswordProbablyCorrectInfo} * @see {@link getCheckIfPasswordProbablyCorrectInfo} */ export declare function passwordProbablyCorrect({ password, checkInfo, }: { password: string; checkInfo: CheckIfPasswordProbablyCorrectInfo; }): Promise; //# sourceMappingURL=secret-helper.d.mts.map