add loader and remove logs

This commit is contained in:
2024-04-15 22:30:49 +03:00
parent 070a6ccbe5
commit 794252ac3b
11 changed files with 377 additions and 254 deletions

View File

@@ -13,11 +13,9 @@ export const decryptStoredWallet = async (password, wallet) => {
const salt = Base58.decode(wallet.salt)
const key = await kdf(password, salt, threads)
console.log('key2', key)
const encryptionKey = key.slice(0, 32)
const macKey = key.slice(32, 63)
const mac = new HmacSha512(macKey).process(encryptedSeedBytes).finish().result
console.log(Base58.encode(mac), wallet.mac)
if (Base58.encode(mac) !== wallet.mac) {
throw new Error("Incorrect password")
}