return Bip39.fromEntropy(entropy)
.then(bip39 => this.#load(type, key, keySalt, bip39.phrase, mnemonicSalt))
.then(({ iv, salt, encrypted }) => {
+ entropy.fill(0)
if (this.#seed == null || this.#mnemonic == null) {
throw new Error('Failed to generate seed and mnemonic')
}
}
return crypto.subtle
.deriveKey(derivationAlgorithm, derivationKey, derivedKeyType, false, [purpose])
- .then(derivedKey => derivedKey)
})
.catch(err => {
throw new Error(err)