Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 5d21dda

Browse files
Fix issue with buffer concatenation while using scrypt
1 parent 0681d67 commit 5d21dda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ export default class Wallet {
430430
}
431431

432432
const ciphertext = Buffer.from(json.crypto.ciphertext, 'hex')
433-
const mac = keccak256(Buffer.concat([derivedKey.slice(16, 32), ciphertext]))
433+
const mac = keccak256(Buffer.concat([Buffer.from(derivedKey.slice(16, 32)), ciphertext]))
434434
if (mac.toString('hex') !== json.crypto.mac) {
435435
throw new Error('Key derivation failed - possibly wrong passphrase')
436436
}

0 commit comments

Comments
 (0)