Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static _fromSeed(seed, mnemonic) {
const seedArray = arrayify(seed);
if (seedArray.length < 16 || seedArray.length > 64) {
throw new Error("invalid seed");
}
const I = arrayify(computeHmac(SupportedAlgorithms.sha512, MasterSecret, seedArray));
return new HDNode(_constructorGuard, bytes32(I.slice(0, 32)), null, "0x00000000", bytes32(I.slice(32)), 0, 0, mnemonic, "m");
}
static fromMnemonic(mnemonic, password, wordlist) {
static _fromSeed(seed: BytesLike, mnemonic: string): HDNode {
const seedArray: Uint8Array = arrayify(seed);
if (seedArray.length < 16 || seedArray.length > 64) { throw new Error("invalid seed"); }
const I: Uint8Array = arrayify(computeHmac(SupportedAlgorithms.sha512, MasterSecret, seedArray));
return new HDNode(_constructorGuard, bytes32(I.slice(0, 32)), null, "0x00000000", bytes32(I.slice(32)), 0, 0, mnemonic, "m");
}