cafe-utility 36.1.0 → 36.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +22 -29
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2132,31 +2132,31 @@ function keccakPermutate(n) {
|
|
|
2132
2132
|
d = l ^ h,
|
|
2133
2133
|
m = a ^ p,
|
|
2134
2134
|
w = (s << 1) | (c >>> 31),
|
|
2135
|
-
|
|
2135
|
+
x = (c << 1) | (s >>> 31),
|
|
2136
2136
|
g = e ^ w,
|
|
2137
|
-
|
|
2137
|
+
y = r ^ x,
|
|
2138
2138
|
En = (u << 1) | (f >>> 31),
|
|
2139
|
-
|
|
2139
|
+
Mn = (f << 1) | (u >>> 31),
|
|
2140
2140
|
b = i ^ En,
|
|
2141
|
-
A = o ^
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
$ = s ^
|
|
2145
|
-
E = c ^
|
|
2141
|
+
A = o ^ Mn,
|
|
2142
|
+
Sn = (l << 1) | (a >>> 31),
|
|
2143
|
+
kn = (a << 1) | (l >>> 31),
|
|
2144
|
+
$ = s ^ Sn,
|
|
2145
|
+
E = c ^ kn,
|
|
2146
2146
|
On = (e << 1) | (r >>> 31),
|
|
2147
2147
|
Tn = (r << 1) | (e >>> 31),
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
;(n[0] ^= d), (n[1] ^= m), (n[2] ^= g), (n[3] ^=
|
|
2151
|
-
const
|
|
2148
|
+
M = u ^ On,
|
|
2149
|
+
S = f ^ Tn
|
|
2150
|
+
;(n[0] ^= d), (n[1] ^= m), (n[2] ^= g), (n[3] ^= y), (n[4] ^= b), (n[5] ^= A), (n[6] ^= $), (n[7] ^= E), (n[8] ^= M), (n[9] ^= S), (n[10] ^= d), (n[11] ^= m), (n[12] ^= g), (n[13] ^= y), (n[14] ^= b), (n[15] ^= A), (n[16] ^= $), (n[17] ^= E), (n[18] ^= M), (n[19] ^= S), (n[20] ^= d), (n[21] ^= m), (n[22] ^= g), (n[23] ^= y), (n[24] ^= b), (n[25] ^= A), (n[26] ^= $), (n[27] ^= E), (n[28] ^= M), (n[29] ^= S), (n[30] ^= d), (n[31] ^= m), (n[32] ^= g), (n[33] ^= y), (n[34] ^= b), (n[35] ^= A), (n[36] ^= $), (n[37] ^= E), (n[38] ^= M), (n[39] ^= S), (n[40] ^= d), (n[41] ^= m), (n[42] ^= g), (n[43] ^= y), (n[44] ^= b), (n[45] ^= A), (n[46] ^= $), (n[47] ^= E), (n[48] ^= M), (n[49] ^= S)
|
|
2151
|
+
const k = n[0],
|
|
2152
2152
|
O = n[1],
|
|
2153
2153
|
T = (n[2] << 1) | (n[3] >>> 31),
|
|
2154
2154
|
C = (n[3] << 1) | (n[2] >>> 31),
|
|
2155
2155
|
R = (n[5] << 30) | (n[4] >>> 2),
|
|
2156
2156
|
I = (n[4] << 30) | (n[5] >>> 2),
|
|
2157
2157
|
D = (n[6] << 28) | (n[7] >>> 4),
|
|
2158
|
-
|
|
2159
|
-
|
|
2158
|
+
P = (n[7] << 28) | (n[6] >>> 4),
|
|
2159
|
+
B = (n[8] << 27) | (n[9] >>> 5),
|
|
2160
2160
|
U = (n[9] << 27) | (n[8] >>> 5),
|
|
2161
2161
|
j = (n[11] << 4) | (n[10] >>> 28),
|
|
2162
2162
|
L = (n[10] << 4) | (n[11] >>> 28),
|
|
@@ -2193,12 +2193,12 @@ function keccakPermutate(n) {
|
|
|
2193
2193
|
mn = (n[42] << 2) | (n[43] >>> 30),
|
|
2194
2194
|
gn = (n[43] << 2) | (n[42] >>> 30),
|
|
2195
2195
|
wn = (n[45] << 29) | (n[44] >>> 3),
|
|
2196
|
-
|
|
2197
|
-
|
|
2196
|
+
xn = (n[44] << 29) | (n[45] >>> 3),
|
|
2197
|
+
yn = (n[47] << 24) | (n[46] >>> 8),
|
|
2198
2198
|
bn = (n[46] << 24) | (n[47] >>> 8),
|
|
2199
2199
|
An = (n[48] << 14) | (n[49] >>> 18),
|
|
2200
2200
|
$n = (n[49] << 14) | (n[48] >>> 18)
|
|
2201
|
-
;(n[0] =
|
|
2201
|
+
;(n[0] = k ^ (~N & G)), (n[1] = O ^ (~v & _)), (n[2] = N ^ (~G & fn)), (n[3] = v ^ (~_ & ln)), (n[4] = G ^ (~fn & An)), (n[5] = _ ^ (~ln & $n)), (n[6] = fn ^ (~An & k)), (n[7] = ln ^ (~$n & O)), (n[8] = An ^ (~k & N)), (n[9] = $n ^ (~O & v)), (n[10] = D ^ (~q & J)), (n[11] = P ^ (~V & K)), (n[12] = q ^ (~J & on)), (n[13] = V ^ (~K & sn)), (n[14] = J ^ (~on & wn)), (n[15] = K ^ (~sn & xn)), (n[16] = on ^ (~wn & D)), (n[17] = sn ^ (~xn & P)), (n[18] = wn ^ (~D & q)), (n[19] = xn ^ (~P & V)), (n[20] = T ^ (~F & Y)), (n[21] = C ^ (~z & X)), (n[22] = F ^ (~Y & an)), (n[23] = z ^ (~X & hn)), (n[24] = Y ^ (~an & dn)), (n[25] = X ^ (~hn & pn)), (n[26] = an ^ (~dn & T)), (n[27] = hn ^ (~pn & C)), (n[28] = dn ^ (~T & F)), (n[29] = pn ^ (~C & z)), (n[30] = B ^ (~j & Z)), (n[31] = U ^ (~L & Q)), (n[32] = j ^ (~Z & cn)), (n[33] = L ^ (~Q & un)), (n[34] = Z ^ (~cn & yn)), (n[35] = Q ^ (~un & bn)), (n[36] = cn ^ (~yn & B)), (n[37] = un ^ (~bn & U)), (n[38] = yn ^ (~B & j)), (n[39] = bn ^ (~U & L)), (n[40] = R ^ (~W & nn)), (n[41] = I ^ (~H & tn)), (n[42] = W ^ (~nn & en)), (n[43] = H ^ (~tn & rn)), (n[44] = nn ^ (~en & mn)), (n[45] = tn ^ (~rn & gn)), (n[46] = en ^ (~mn & R)), (n[47] = rn ^ (~gn & I)), (n[48] = mn ^ (~R & W)), (n[49] = gn ^ (~I & H)), (n[0] ^= IOTA_CONSTANTS[t * 2]), (n[1] ^= IOTA_CONSTANTS[t * 2 + 1])
|
|
2202
2202
|
}
|
|
2203
2203
|
}
|
|
2204
2204
|
function bytesToNumbers(n) {
|
|
@@ -2531,13 +2531,13 @@ function shamirWNAF(n, t, e, r, i, o) {
|
|
|
2531
2531
|
;[a, h, p] = jacobianDouble(a, h, p)
|
|
2532
2532
|
const m = d < s.length ? s[d] : 0
|
|
2533
2533
|
if (m !== 0) {
|
|
2534
|
-
const [
|
|
2535
|
-
;[a, h, p] = jacobianAddMixed(a, h, p,
|
|
2534
|
+
const [x, g] = u[(Math.abs(m) - 1) >> 1]
|
|
2535
|
+
;[a, h, p] = jacobianAddMixed(a, h, p, x, m > 0 ? g : SECP256K1_P - g)
|
|
2536
2536
|
}
|
|
2537
2537
|
const w = d < c.length ? c[d] : 0
|
|
2538
2538
|
if (w !== 0) {
|
|
2539
|
-
const [
|
|
2540
|
-
;[a, h, p] = jacobianAddMixed(a, h, p,
|
|
2539
|
+
const [x, g] = f[(Math.abs(w) - 1) >> 1]
|
|
2540
|
+
;[a, h, p] = jacobianAddMixed(a, h, p, x, w > 0 ? g : SECP256K1_P - g)
|
|
2541
2541
|
}
|
|
2542
2542
|
}
|
|
2543
2543
|
return jacobianToAffine(a, h, p)
|
|
@@ -2681,14 +2681,7 @@ class ChunkSplitter {
|
|
|
2681
2681
|
} else await this.append(i.hash(), t + 1, i.span)
|
|
2682
2682
|
}
|
|
2683
2683
|
async finalize(t = 0) {
|
|
2684
|
-
|
|
2685
|
-
if ((t >= 1 && this.onIntermediateChunk && this.onIntermediateChunk(this.chunks[t], this.hasParity[t] ?? !1), this.encrypted)) {
|
|
2686
|
-
const { key: e } = this.chunks[t].encryptedHash()
|
|
2687
|
-
await this.onBatch([{ chunk: this.chunks[t], key: e }])
|
|
2688
|
-
} else await this.onBatch([{ chunk: this.chunks[t] }])
|
|
2689
|
-
return this.chunks[t]
|
|
2690
|
-
}
|
|
2691
|
-
return this.counters[t] === 1 ? (await this.elevate(t + 1), await this.flushBatch(t + 1), (this.chunks[t + 1] = this.chunks[t]), this.finalize(t + 1)) : (await this.elevate(t), await this.flushBatch(t), this.finalize(t + 1))
|
|
2684
|
+
return this.pending[t]?.length && (await this.flushBatch(t)), this.chunks[t + 1] ? (this.counters[t] === 1 ? (await this.elevate(t + 1), await this.flushBatch(t + 1), (this.chunks[t + 1] = this.chunks[t]), this.finalize(t + 1)) : (await this.elevate(t), await this.flushBatch(t), this.finalize(t + 1))) : (t >= 1 && this.onIntermediateChunk && this.onIntermediateChunk(this.chunks[t], this.hasParity[t] ?? !1), this.chunks[t])
|
|
2692
2685
|
}
|
|
2693
2686
|
}
|
|
2694
2687
|
;(exports.ChunkSplitter = ChunkSplitter), (_a = ChunkSplitter), (ChunkSplitter.NOOP = async n => [])
|