fix: resolve DataView constructor error in lt-hash (#1279)

This commit is contained in:
M Ilham Ari Pahmi
2025-03-02 17:08:43 +07:00
committed by GitHub
parent 7466a8facb
commit af17232611

View File

@@ -38,13 +38,13 @@ class d {
async _addSingle(e, t) { async _addSingle(e, t) {
var r = this var r = this
const n = new Uint8Array(await hkdf(Buffer.from(t), o, { info: r.salt })).buffer const n = new Uint8Array(await hkdf(Buffer.from(t), o, { info: r.salt })).buffer
return r.performPointwiseWithOverflow(e, n, ((e, t) => e + t)) return r.performPointwiseWithOverflow(await e, n, ((e, t) => e + t))
} }
async _subtractSingle(e, t) { async _subtractSingle(e, t) {
var r = this var r = this
const n = new Uint8Array(await hkdf(Buffer.from(t), o, { info: r.salt })).buffer const n = new Uint8Array(await hkdf(Buffer.from(t), o, { info: r.salt })).buffer
return r.performPointwiseWithOverflow(e, n, ((e, t) => e - t)) return r.performPointwiseWithOverflow(await e, n, ((e, t) => e - t))
} }
performPointwiseWithOverflow(e, t, r) { performPointwiseWithOverflow(e, t, r) {
const n = new DataView(e) const n = new DataView(e)
@@ -58,4 +58,4 @@ class d {
return a return a
} }
} }
export const LT_HASH_ANTI_TAMPERING = new d('WhatsApp Patch Integrity') export const LT_HASH_ANTI_TAMPERING = new d('WhatsApp Patch Integrity')