/** * KDF Strategy Constants * * Defines available key derivation function strategies. */ // #region KdfStrategy export const KDF_STRATEGY_RECURSIVE_SALT_WRAP = 'recursive-salt-wrap'; export type KdfStrategy = | typeof KDF_STRATEGY_RECURSIVE_SALT_WRAP ; /** * Available KDF strategies for deriving keys from master secrets. * * - `recursive-salt-wrap`: Hash(salt + current + salt) ^ rounds * Used by KeystoneStrategy_HashRevealV1 for pool secret derivation */ export const KdfStrategy = { /** * Recursive salt wrap strategy: Hash(salt + current + salt) ^ rounds * * This is the primary strategy used by keystones for deriving pool secrets * from master secrets with configurable rounds for key stretching. */ recursive_salt_wrap: KDF_STRATEGY_RECURSIVE_SALT_WRAP, } satisfies { [key: string]: KdfStrategy }; export const KDF_STRATEGY_VALID_VALUES = Object.values(KdfStrategy); export function isValidKdfStrategy(strategy: string): strategy is KdfStrategy { return KDF_STRATEGY_VALID_VALUES.includes(strategy as KdfStrategy); } // #endregion KdfStrategy