mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
refactor: turn hkdf functions to async and remove extra deps (#1272)
* refactor: remove futoin-hkdf dependency and update hkdf implementation * refactor: use crypto subtle and update functions to async --------- Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
committed by
GitHub
parent
e6f98c3902
commit
8083754621
@@ -35,15 +35,15 @@ class d {
|
||||
var n = this
|
||||
return n.add(n.subtract(e, r), t)
|
||||
}
|
||||
_addSingle(e, t) {
|
||||
async _addSingle(e, t) {
|
||||
var r = this
|
||||
const n = new Uint8Array(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))
|
||||
}
|
||||
_subtractSingle(e, t) {
|
||||
async _subtractSingle(e, t) {
|
||||
var r = this
|
||||
|
||||
const n = new Uint8Array(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))
|
||||
}
|
||||
performPointwiseWithOverflow(e, t, r) {
|
||||
|
||||
Reference in New Issue
Block a user