@@ -4463,7 +4463,7 @@ exports.callbackify = callbackify;
44634463const sss = __webpack_require__(9381)
44644464
44654465/**
4466- * K-of-N secret recovery. Uses bitwise XOR for k=n, Shamir's Secret Sharing for 1 < K < N, and direct secret sharing for K = 1.
4466+ * K-of-N secret recovery. Uses direct secret sharing for K = 1, and Shamir's Secret Sharing for K > 1.
44674467 *
44684468 * @example
44694469 * // share secret using 2-of-3 shares
@@ -30085,7 +30085,7 @@ MFKDFDerivedKey.prototype.persistFactor = persistence.persistFactor
3008530085
3008630086// Strengthening Functions
3008730087const strengthening = __webpack_require__(7280)
30088- MFKDFDerivedKey.prototype.strenthen = strengthening.strenthen
30088+ MFKDFDerivedKey.prototype.strengthen = strengthening.strengthen
3008930089
3009030090// MFDPG Functions
3009130091const mfdpg = __webpack_require__(7214)
@@ -34911,19 +34911,8 @@ const validate = (__webpack_require__(4685).validate)
3491134911 * @param {MFKDFFactor} factor - Base factor used to derive this key
3491234912 * @param {Object} [options] - Configuration options
3491334913 * @param {string} [options.id] - Unique identifier for this key; random UUIDv4 generated by default
34914- * @param {number} [options.size=32] - Size of derived key, in bytes
3491534914 * @param {number} [options.threshold] - Number of factors required to derive key; factors.length by default (all required)
3491634915 * @param {Buffer} [options.salt] - Cryptographic salt; generated via secure PRG by default (recommended)
34917- * @param {string} [options.kdf='argon2id'] - KDF algorithm to use; pbkdf2, bcrypt, scrypt, argon2i, argon2d, or argon2id
34918- * @param {number} [options.pbkdf2rounds=310000] - Number of rounds to use if using pbkdf2
34919- * @param {string} [options.pbkdf2digest='sha256'] - Hash function to use if using pbkdf2; sha1, sha256, sha384, or sha512
34920- * @param {number} [options.bcryptrounds=10] - Number of rounds to use if using bcrypt
34921- * @param {number} [options.scryptcost=16384] - Iterations count (N) to use if using scrypt
34922- * @param {number} [options.scryptblocksize=8] - Block size (r) to use if using scrypt
34923- * @param {number} [options.scryptparallelism=1] - Parallelism factor (p) to use if using scrypt
34924- * @param {number} [options.argon2time=2] - Iterations to use if using argon2
34925- * @param {number} [options.argon2mem=24576] - Memory to use if using argon2
34926- * @param {number} [options.argon2parallelism=1] - Parallelism to use if using argon2
3492734916 * @returns {MFKDFDerivedKey} A multi-factor derived key object
3492834917 * @author Vivek Nair (https://nair.me) <vivek@nair.me>
3492934918 * @since 0.16.0
@@ -35460,19 +35449,8 @@ const setupKey = (__webpack_require__(7073).key)
3546035449 * @param {Array.<MFKDFFactor>} factors - Array of factors used to derive this key
3546135450 * @param {Object} [options] - Configuration options
3546235451 * @param {string} [options.id='stack'] - Unique identifier for this factor
35463- * @param {number} [options.size=32] - Size of derived key, in bytes
3546435452 * @param {number} [options.threshold] - Number of factors required to derive key; factors.length by default (all required)
3546535453 * @param {Buffer} [options.salt] - Cryptographic salt; generated via secure PRG by default (recommended)
35466- * @param {string} [options.kdf='pbkdf2'] - KDF algorithm to use; pbkdf2, bcrypt, scrypt, argon2i, argon2d, or argon2id
35467- * @param {number} [options.pbkdf2rounds=1] - Number of rounds to use if using pbkdf2
35468- * @param {string} [options.pbkdf2digest='sha256'] - Hash function to use if using pbkdf2; sha1, sha256, sha384, or sha512
35469- * @param {number} [options.bcryptrounds=10] - Number of rounds to use if using bcrypt
35470- * @param {number} [options.scryptcost=16384] - Iterations count (N) to use if using scrypt
35471- * @param {number} [options.scryptblocksize=8] - Block size (r) to use if using scrypt
35472- * @param {number} [options.scryptparallelism=1] - Parallelism factor (p) to use if using scrypt
35473- * @param {number} [options.argon2time=2] - Iterations to use if using argon2
35474- * @param {number} [options.argon2mem=24576] -Mmemory to use if using argon2
35475- * @param {number} [options.argon2parallelism=1] - Parallelism to use if using argon2
3547635454 * @returns {MFKDFFactor} MFKDF factor information
3547735455 * @author Vivek Nair (https://nair.me) <vivek@nair.me>
3547835456 * @since 0.15.0
@@ -51271,8 +51249,8 @@ module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArgum
5127151249 * @author Vivek Nair (https://nair.me) <vivek@nair.me>
5127251250 */
5127351251
51274- const { encrypt } = __webpack_require__(9208)
51275- const { argon2id } = __webpack_require__(964)
51252+ const { encrypt } = __webpack_require__(9208);
51253+ const { argon2id } = __webpack_require__(964);
5127651254
5127751255/**
5127851256 * Update the time and/or memory cost of an existing multi-factor derived key.
@@ -51307,32 +51285,32 @@ const { argon2id } = __webpack_require__(964)
5130751285 * @memberOf MFKDFDerivedKey
5130851286 * @async
5130951287 */
51310- async function strenthen (time = 0, memory = 0) {
51311- if (typeof time !== ' number' || time < 0 || !Number.isInteger(time)) {
51312- throw new TypeError(' time must be a non-negative integer')
51288+ async function strengthen (time = 0, memory = 0) {
51289+ if (typeof time !== " number" || time < 0 || !Number.isInteger(time)) {
51290+ throw new TypeError(" time must be a non-negative integer");
5131351291 }
51314- if (typeof memory !== ' number' || memory < 0 || !Number.isInteger(memory)) {
51315- throw new TypeError(' memory must be a non-negative integer')
51292+ if (typeof memory !== " number" || memory < 0 || !Number.isInteger(memory)) {
51293+ throw new TypeError(" memory must be a non-negative integer");
5131651294 }
5131751295
51318- this.policy.time = time
51319- this.policy.memory = memory
51296+ this.policy.time = time;
51297+ this.policy.memory = memory;
5132051298
5132151299 const kek = Buffer.from(
5132251300 await argon2id({
5132351301 password: this.secret,
51324- salt: Buffer.from(this.policy.salt, ' base64' ),
51302+ salt: Buffer.from(this.policy.salt, " base64" ),
5132551303 hashLength: 32,
5132651304 parallelism: 1,
5132751305 iterations: 2 + Math.max(0, time),
5132851306 memorySize: 19456 + Math.max(0, memory),
51329- outputType: ' binary'
51307+ outputType: " binary",
5133051308 })
51331- )
51309+ );
5133251310
51333- this.policy.key = encrypt(this.key, kek).toString(' base64')
51311+ this.policy.key = encrypt(this.key, kek).toString(" base64");
5133451312}
51335- module.exports.strenthen = strenthen
51313+ module.exports.strengthen = strengthen;
5133651314
5133751315
5133851316/***/ }),
@@ -52955,7 +52933,7 @@ module.exports = function xor (a, b) {
5295552933const sss = __webpack_require__(9381)
5295652934
5295752935/**
52958- * K-of-N secret combining. Uses bitwise XOR for k=n, Shamir's Secret Sharing for 1 < K < N, and direct secret sharing for K = 1.
52936+ * K-of-N secret combining. Uses direct secret sharing for K = 1, and Shamir's Secret Sharing for K > 1.
5295952937 *
5296052938 * @example
5296152939 * // share secret using 2-of-3 shares
@@ -67319,7 +67297,7 @@ module.exports = RangeError;
6731967297const sss = __webpack_require__(9381)
6732067298
6732167299/**
67322- * K-of-N secret sharing. Uses bitwise XOR for k=n, Shamir's Secret Sharing for 1 < K < N, and direct secret sharing for K = 1.
67300+ * K-of-N secret sharing. Uses direct secret sharing for K = 1, and Shamir's Secret Sharing for K > 1.
6732367301 *
6732467302 * @example
6732567303 * // share secret using 2-of-3 shares
0 commit comments