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:
João Lucas de Oliveira Lopes
2025-03-01 13:31:48 -03:00
committed by GitHub
parent e6f98c3902
commit 8083754621
11 changed files with 78 additions and 48 deletions

View File

@@ -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) {