// restrict iv to 96 bits per GCM best practice
const iv = crypto.getRandomValues(new Uint8Array(12)).buffer
const additionalData = utf8.toBuffer(`${type};${id}`)
- const s = new Uint8Array(seed)
- const m = new Uint8Array(mnemonic ?? [])
- const encoded = new Uint8Array([...s, ...m])
+ const encoded = new Uint8Array([...new Uint8Array(seed), ...new Uint8Array(mnemonic ?? [])])
return crypto.subtle
.encrypt({ name: 'AES-GCM', iv, additionalData }, key, encoded)
.then(encrypted => {