@babylonlabs-io/ts-sdk 0.27.1 → 0.28.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/dist/PeginManager-Da4uSHzl.cjs +2 -0
- package/dist/PeginManager-Da4uSHzl.cjs.map +1 -0
- package/dist/{context-ktqanzXE.js → PeginManager-DzMSIQ0I.js} +1100 -1058
- package/dist/PeginManager-DzMSIQ0I.js.map +1 -0
- package/dist/buildAndBroadcastRefund-DkEpTFkv.cjs +2 -0
- package/dist/buildAndBroadcastRefund-DkEpTFkv.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-BzYJv-Fv.js → buildAndBroadcastRefund-xWS8frc6.js} +338 -348
- package/dist/buildAndBroadcastRefund-xWS8frc6.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +55 -55
- package/dist/sha2-6wN58S6R.js +280 -0
- package/dist/sha2-6wN58S6R.js.map +1 -0
- package/dist/sha2-CsTynrfJ.cjs +2 -0
- package/dist/sha2-CsTynrfJ.cjs.map +1 -0
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/wallets/index.d.ts +2 -1
- package/dist/shared/wallets/index.d.ts.map +1 -1
- package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts +8 -0
- package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts.map +1 -1
- package/dist/signing-BZigafm0.js.map +1 -1
- package/dist/signing-DHSXjhLM.cjs.map +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +2 -2
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +80 -70
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +52 -52
- package/dist/tbv/core/managers/PeginManager.d.ts +64 -27
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.d.ts +1 -1
- package/dist/tbv/core/managers/index.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/peginState.d.ts +1 -1
- package/dist/tbv/core/services/deposit/peginState.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/validation.d.ts +0 -4
- package/dist/tbv/core/services/deposit/validation.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +1 -1
- package/dist/tbv/core/vault-secrets/__tests__/deriveVaultRoot.test.d.ts +13 -0
- package/dist/tbv/core/vault-secrets/__tests__/deriveVaultRoot.test.d.ts.map +1 -0
- package/dist/tbv/core/vault-secrets/context.d.ts +9 -0
- package/dist/tbv/core/vault-secrets/context.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts +56 -0
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts.map +1 -0
- package/dist/tbv/core/vault-secrets/expand.d.ts +18 -3
- package/dist/tbv/core/vault-secrets/expand.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/index.d.ts +6 -3
- package/dist/tbv/core/vault-secrets/index.d.ts.map +1 -1
- package/dist/tbv/core/wots/blockDerivation.d.ts +20 -24
- package/dist/tbv/core/wots/blockDerivation.d.ts.map +1 -1
- package/dist/tbv/core/wots/errors.d.ts +3 -1
- package/dist/tbv/core/wots/errors.d.ts.map +1 -1
- package/dist/tbv/core/wots/index.d.ts +1 -2
- package/dist/tbv/core/wots/index.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +52 -52
- package/dist/testing/MockBitcoinWallet.d.ts +10 -3
- package/dist/testing/MockBitcoinWallet.d.ts.map +1 -1
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.js +67 -55
- package/dist/testing/index.js.map +1 -1
- package/dist/types-CnG3JsRs.js +680 -0
- package/dist/types-CnG3JsRs.js.map +1 -0
- package/dist/types-jmEyzzhY.cjs +2 -0
- package/dist/types-jmEyzzhY.cjs.map +1 -0
- package/dist/{vault-registry-reader-CpCOte7w.js → vault-registry-reader-BywZhqJL.js} +65 -64
- package/dist/{vault-registry-reader-CpCOte7w.js.map → vault-registry-reader-BywZhqJL.js.map} +1 -1
- package/dist/vault-registry-reader-DdruADqa.cjs +2 -0
- package/dist/{vault-registry-reader-BizmBSBV.cjs.map → vault-registry-reader-DdruADqa.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/buildAndBroadcastRefund-BEASMFsz.cjs +0 -2
- package/dist/buildAndBroadcastRefund-BEASMFsz.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-BzYJv-Fv.js.map +0 -1
- package/dist/context-B4fYDTxy.cjs +0 -2
- package/dist/context-B4fYDTxy.cjs.map +0 -1
- package/dist/context-ktqanzXE.js.map +0 -1
- package/dist/sha2-1XZuToHP.cjs +0 -2
- package/dist/sha2-1XZuToHP.cjs.map +0 -1
- package/dist/sha2-ZzfZqQSw.js +0 -1123
- package/dist/sha2-ZzfZqQSw.js.map +0 -1
- package/dist/tbv/core/wots/deriveWotsPkHash.d.ts +0 -9
- package/dist/tbv/core/wots/deriveWotsPkHash.d.ts.map +0 -1
- package/dist/vault-registry-reader-BizmBSBV.cjs +0 -2
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
var U = Object.defineProperty;
|
|
2
|
+
var B = (t, e, s) => e in t ? U(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var a = (t, e, s) => B(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
function I(t) {
|
|
5
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
6
|
+
}
|
|
7
|
+
function E(t, e = "") {
|
|
8
|
+
if (!Number.isSafeInteger(t) || t < 0) {
|
|
9
|
+
const s = e && `"${e}" `;
|
|
10
|
+
throw new Error(`${s}expected integer >= 0, got ${t}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function m(t, e, s = "") {
|
|
14
|
+
const i = I(t), n = t == null ? void 0 : t.length, c = e !== void 0;
|
|
15
|
+
if (!i || c && n !== e) {
|
|
16
|
+
const o = s && `"${s}" `, f = c ? ` of length ${e}` : "", h = i ? `length=${n}` : `type=${typeof t}`;
|
|
17
|
+
throw new Error(o + "expected Uint8Array" + f + ", got " + h);
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
}
|
|
21
|
+
function N(t) {
|
|
22
|
+
if (typeof t != "function" || typeof t.create != "function")
|
|
23
|
+
throw new Error("Hash must wrapped by utils.createHasher");
|
|
24
|
+
E(t.outputLen), E(t.blockLen);
|
|
25
|
+
}
|
|
26
|
+
function H(t, e = !0) {
|
|
27
|
+
if (t.destroyed)
|
|
28
|
+
throw new Error("Hash instance has been destroyed");
|
|
29
|
+
if (e && t.finished)
|
|
30
|
+
throw new Error("Hash#digest() has already been called");
|
|
31
|
+
}
|
|
32
|
+
function _(t, e) {
|
|
33
|
+
m(t, void 0, "digestInto() output");
|
|
34
|
+
const s = e.outputLen;
|
|
35
|
+
if (t.length < s)
|
|
36
|
+
throw new Error('"digestInto() output" expected to be of length >=' + s);
|
|
37
|
+
}
|
|
38
|
+
function T(t) {
|
|
39
|
+
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
40
|
+
}
|
|
41
|
+
function L(...t) {
|
|
42
|
+
for (let e = 0; e < t.length; e++)
|
|
43
|
+
t[e].fill(0);
|
|
44
|
+
}
|
|
45
|
+
function w(t) {
|
|
46
|
+
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
47
|
+
}
|
|
48
|
+
function x(t, e) {
|
|
49
|
+
return t << 32 - e | t >>> e;
|
|
50
|
+
}
|
|
51
|
+
function z(t, e) {
|
|
52
|
+
return t << e | t >>> 32 - e >>> 0;
|
|
53
|
+
}
|
|
54
|
+
const k = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
55
|
+
function S(t) {
|
|
56
|
+
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
57
|
+
}
|
|
58
|
+
function C(t) {
|
|
59
|
+
for (let e = 0; e < t.length; e++)
|
|
60
|
+
t[e] = S(t[e]);
|
|
61
|
+
return t;
|
|
62
|
+
}
|
|
63
|
+
const K = k ? (t) => t : C;
|
|
64
|
+
function D(t, e = {}) {
|
|
65
|
+
const s = (n, c) => t(c).update(n).digest(), i = t(void 0);
|
|
66
|
+
return s.outputLen = i.outputLen, s.blockLen = i.blockLen, s.create = (n) => t(n), Object.assign(s, e), Object.freeze(s);
|
|
67
|
+
}
|
|
68
|
+
const O = (t) => ({
|
|
69
|
+
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, t])
|
|
70
|
+
});
|
|
71
|
+
function $(t, e, s) {
|
|
72
|
+
return t & e ^ ~t & s;
|
|
73
|
+
}
|
|
74
|
+
function F(t, e, s) {
|
|
75
|
+
return t & e ^ t & s ^ e & s;
|
|
76
|
+
}
|
|
77
|
+
class G {
|
|
78
|
+
constructor(e, s, i, n) {
|
|
79
|
+
a(this, "blockLen");
|
|
80
|
+
a(this, "outputLen");
|
|
81
|
+
a(this, "padOffset");
|
|
82
|
+
a(this, "isLE");
|
|
83
|
+
// For partial updates less than block size
|
|
84
|
+
a(this, "buffer");
|
|
85
|
+
a(this, "view");
|
|
86
|
+
a(this, "finished", !1);
|
|
87
|
+
a(this, "length", 0);
|
|
88
|
+
a(this, "pos", 0);
|
|
89
|
+
a(this, "destroyed", !1);
|
|
90
|
+
this.blockLen = e, this.outputLen = s, this.padOffset = i, this.isLE = n, this.buffer = new Uint8Array(e), this.view = w(this.buffer);
|
|
91
|
+
}
|
|
92
|
+
update(e) {
|
|
93
|
+
H(this), m(e);
|
|
94
|
+
const { view: s, buffer: i, blockLen: n } = this, c = e.length;
|
|
95
|
+
for (let o = 0; o < c; ) {
|
|
96
|
+
const f = Math.min(n - this.pos, c - o);
|
|
97
|
+
if (f === n) {
|
|
98
|
+
const h = w(e);
|
|
99
|
+
for (; n <= c - o; o += n)
|
|
100
|
+
this.process(h, o);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
i.set(e.subarray(o, o + f), this.pos), this.pos += f, o += f, this.pos === n && (this.process(s, 0), this.pos = 0);
|
|
104
|
+
}
|
|
105
|
+
return this.length += e.length, this.roundClean(), this;
|
|
106
|
+
}
|
|
107
|
+
digestInto(e) {
|
|
108
|
+
H(this), _(e, this), this.finished = !0;
|
|
109
|
+
const { buffer: s, view: i, blockLen: n, isLE: c } = this;
|
|
110
|
+
let { pos: o } = this;
|
|
111
|
+
s[o++] = 128, L(this.buffer.subarray(o)), this.padOffset > n - o && (this.process(i, 0), o = 0);
|
|
112
|
+
for (let r = o; r < n; r++)
|
|
113
|
+
s[r] = 0;
|
|
114
|
+
i.setBigUint64(n - 8, BigInt(this.length * 8), c), this.process(i, 0);
|
|
115
|
+
const f = w(e), h = this.outputLen;
|
|
116
|
+
if (h % 4)
|
|
117
|
+
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
118
|
+
const u = h / 4, b = this.get();
|
|
119
|
+
if (u > b.length)
|
|
120
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
121
|
+
for (let r = 0; r < u; r++)
|
|
122
|
+
f.setUint32(4 * r, b[r], c);
|
|
123
|
+
}
|
|
124
|
+
digest() {
|
|
125
|
+
const { buffer: e, outputLen: s } = this;
|
|
126
|
+
this.digestInto(e);
|
|
127
|
+
const i = e.slice(0, s);
|
|
128
|
+
return this.destroy(), i;
|
|
129
|
+
}
|
|
130
|
+
_cloneInto(e) {
|
|
131
|
+
e || (e = new this.constructor()), e.set(...this.get());
|
|
132
|
+
const { blockLen: s, buffer: i, length: n, finished: c, destroyed: o, pos: f } = this;
|
|
133
|
+
return e.destroyed = o, e.finished = c, e.length = n, e.pos = f, n % s && e.buffer.set(i), e;
|
|
134
|
+
}
|
|
135
|
+
clone() {
|
|
136
|
+
return this._cloneInto();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const d = /* @__PURE__ */ Uint32Array.from([
|
|
140
|
+
1779033703,
|
|
141
|
+
3144134277,
|
|
142
|
+
1013904242,
|
|
143
|
+
2773480762,
|
|
144
|
+
1359893119,
|
|
145
|
+
2600822924,
|
|
146
|
+
528734635,
|
|
147
|
+
1541459225
|
|
148
|
+
]), V = /* @__PURE__ */ Uint32Array.from([
|
|
149
|
+
1116352408,
|
|
150
|
+
1899447441,
|
|
151
|
+
3049323471,
|
|
152
|
+
3921009573,
|
|
153
|
+
961987163,
|
|
154
|
+
1508970993,
|
|
155
|
+
2453635748,
|
|
156
|
+
2870763221,
|
|
157
|
+
3624381080,
|
|
158
|
+
310598401,
|
|
159
|
+
607225278,
|
|
160
|
+
1426881987,
|
|
161
|
+
1925078388,
|
|
162
|
+
2162078206,
|
|
163
|
+
2614888103,
|
|
164
|
+
3248222580,
|
|
165
|
+
3835390401,
|
|
166
|
+
4022224774,
|
|
167
|
+
264347078,
|
|
168
|
+
604807628,
|
|
169
|
+
770255983,
|
|
170
|
+
1249150122,
|
|
171
|
+
1555081692,
|
|
172
|
+
1996064986,
|
|
173
|
+
2554220882,
|
|
174
|
+
2821834349,
|
|
175
|
+
2952996808,
|
|
176
|
+
3210313671,
|
|
177
|
+
3336571891,
|
|
178
|
+
3584528711,
|
|
179
|
+
113926993,
|
|
180
|
+
338241895,
|
|
181
|
+
666307205,
|
|
182
|
+
773529912,
|
|
183
|
+
1294757372,
|
|
184
|
+
1396182291,
|
|
185
|
+
1695183700,
|
|
186
|
+
1986661051,
|
|
187
|
+
2177026350,
|
|
188
|
+
2456956037,
|
|
189
|
+
2730485921,
|
|
190
|
+
2820302411,
|
|
191
|
+
3259730800,
|
|
192
|
+
3345764771,
|
|
193
|
+
3516065817,
|
|
194
|
+
3600352804,
|
|
195
|
+
4094571909,
|
|
196
|
+
275423344,
|
|
197
|
+
430227734,
|
|
198
|
+
506948616,
|
|
199
|
+
659060556,
|
|
200
|
+
883997877,
|
|
201
|
+
958139571,
|
|
202
|
+
1322822218,
|
|
203
|
+
1537002063,
|
|
204
|
+
1747873779,
|
|
205
|
+
1955562222,
|
|
206
|
+
2024104815,
|
|
207
|
+
2227730452,
|
|
208
|
+
2361852424,
|
|
209
|
+
2428436474,
|
|
210
|
+
2756734187,
|
|
211
|
+
3204031479,
|
|
212
|
+
3329325298
|
|
213
|
+
]), p = /* @__PURE__ */ new Uint32Array(64);
|
|
214
|
+
class M extends G {
|
|
215
|
+
constructor(e) {
|
|
216
|
+
super(64, e, 8, !1);
|
|
217
|
+
}
|
|
218
|
+
get() {
|
|
219
|
+
const { A: e, B: s, C: i, D: n, E: c, F: o, G: f, H: h } = this;
|
|
220
|
+
return [e, s, i, n, c, o, f, h];
|
|
221
|
+
}
|
|
222
|
+
// prettier-ignore
|
|
223
|
+
set(e, s, i, n, c, o, f, h) {
|
|
224
|
+
this.A = e | 0, this.B = s | 0, this.C = i | 0, this.D = n | 0, this.E = c | 0, this.F = o | 0, this.G = f | 0, this.H = h | 0;
|
|
225
|
+
}
|
|
226
|
+
process(e, s) {
|
|
227
|
+
for (let r = 0; r < 16; r++, s += 4)
|
|
228
|
+
p[r] = e.getUint32(s, !1);
|
|
229
|
+
for (let r = 16; r < 64; r++) {
|
|
230
|
+
const g = p[r - 15], l = p[r - 2], A = x(g, 7) ^ x(g, 18) ^ g >>> 3, y = x(l, 17) ^ x(l, 19) ^ l >>> 10;
|
|
231
|
+
p[r] = y + p[r - 7] + A + p[r - 16] | 0;
|
|
232
|
+
}
|
|
233
|
+
let { A: i, B: n, C: c, D: o, E: f, F: h, G: u, H: b } = this;
|
|
234
|
+
for (let r = 0; r < 64; r++) {
|
|
235
|
+
const g = x(f, 6) ^ x(f, 11) ^ x(f, 25), l = b + g + $(f, h, u) + V[r] + p[r] | 0, y = (x(i, 2) ^ x(i, 13) ^ x(i, 22)) + F(i, n, c) | 0;
|
|
236
|
+
b = u, u = h, h = f, f = o + l | 0, o = c, c = n, n = i, i = l + y | 0;
|
|
237
|
+
}
|
|
238
|
+
i = i + this.A | 0, n = n + this.B | 0, c = c + this.C | 0, o = o + this.D | 0, f = f + this.E | 0, h = h + this.F | 0, u = u + this.G | 0, b = b + this.H | 0, this.set(i, n, c, o, f, h, u, b);
|
|
239
|
+
}
|
|
240
|
+
roundClean() {
|
|
241
|
+
L(p);
|
|
242
|
+
}
|
|
243
|
+
destroy() {
|
|
244
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), L(this.buffer);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
class j extends M {
|
|
248
|
+
constructor() {
|
|
249
|
+
super(32);
|
|
250
|
+
// We cannot use array here since array allows indexing by variable
|
|
251
|
+
// which means optimizer/compiler cannot use registers.
|
|
252
|
+
a(this, "A", d[0] | 0);
|
|
253
|
+
a(this, "B", d[1] | 0);
|
|
254
|
+
a(this, "C", d[2] | 0);
|
|
255
|
+
a(this, "D", d[3] | 0);
|
|
256
|
+
a(this, "E", d[4] | 0);
|
|
257
|
+
a(this, "F", d[5] | 0);
|
|
258
|
+
a(this, "G", d[6] | 0);
|
|
259
|
+
a(this, "H", d[7] | 0);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const q = /* @__PURE__ */ D(
|
|
263
|
+
() => new j(),
|
|
264
|
+
/* @__PURE__ */ O(1)
|
|
265
|
+
);
|
|
266
|
+
export {
|
|
267
|
+
G as H,
|
|
268
|
+
N as a,
|
|
269
|
+
m as b,
|
|
270
|
+
L as c,
|
|
271
|
+
H as d,
|
|
272
|
+
E as e,
|
|
273
|
+
D as f,
|
|
274
|
+
K as g,
|
|
275
|
+
_ as h,
|
|
276
|
+
z as r,
|
|
277
|
+
q as s,
|
|
278
|
+
T as u
|
|
279
|
+
};
|
|
280
|
+
//# sourceMappingURL=sha2-6wN58S6R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha2-6wN58S6R.js","sources":["../../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/utils.js","../../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/_md.js","../../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/sha2.js"],"sourcesContent":["/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is positive integer. */\nexport function anumber(n, title = '') {\n if (!Number.isSafeInteger(n) || n < 0) {\n const prefix = title && `\"${title}\" `;\n throw new Error(`${prefix}expected integer >= 0, got ${n}`);\n }\n}\n/** Asserts something is Uint8Array. */\nexport function abytes(value, length, title = '') {\n const bytes = isBytes(value);\n const len = value?.length;\n const needsLen = length !== undefined;\n if (!bytes || (needsLen && len !== length)) {\n const prefix = title && `\"${title}\" `;\n const ofLen = needsLen ? ` of length ${length}` : '';\n const got = bytes ? `length=${len}` : `type=${typeof value}`;\n throw new Error(prefix + 'expected Uint8Array' + ofLen + ', got ' + got);\n }\n return value;\n}\n/** Asserts something is hash */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash must wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'digestInto() output');\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('\"digestInto() output\" expected to be of length >=' + min);\n }\n}\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/** The byte swap operation for uint32 */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n);\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin)\n return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async () => { };\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/** Merges default options and passed options. */\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options must be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\n/** Creates function with outputLen, blockLen, create properties from a class constructor. */\nexport function createHasher(hashCons, info = {}) {\n const hashC = (msg, opts) => hashCons(opts).update(msg).digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32) {\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/** Creates OID opts for NIST hashes, with prefix 06 09 60 86 48 01 65 03 04 02. */\nexport const oidNist = (suffix) => ({\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n//# sourceMappingURL=utils.js.map","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { abytes, aexists, aoutput, clean, createView } from \"./utils.js\";\n/** Choice: a ? b : c */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/** Majority function, true if any two inputs is true. */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nexport class HashMD {\n blockLen;\n outputLen;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen must be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to ||= new this.constructor();\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n//# sourceMappingURL=_md.js.map","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://www.rfc-editor.org/rfc/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal 32-byte base SHA2 hash class. */\nclass SHA2_32B extends HashMD {\n constructor(outputLen) {\n super(64, outputLen, 8, false);\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n clean(SHA256_W);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA2-256 hash class. */\nexport class _SHA256 extends SHA2_32B {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n A = SHA256_IV[0] | 0;\n B = SHA256_IV[1] | 0;\n C = SHA256_IV[2] | 0;\n D = SHA256_IV[3] | 0;\n E = SHA256_IV[4] | 0;\n F = SHA256_IV[5] | 0;\n G = SHA256_IV[6] | 0;\n H = SHA256_IV[7] | 0;\n constructor() {\n super(32);\n }\n}\n/** Internal SHA2-224 hash class. */\nexport class _SHA224 extends SHA2_32B {\n A = SHA224_IV[0] | 0;\n B = SHA224_IV[1] | 0;\n C = SHA224_IV[2] | 0;\n D = SHA224_IV[3] | 0;\n E = SHA224_IV[4] | 0;\n F = SHA224_IV[5] | 0;\n G = SHA224_IV[6] | 0;\n H = SHA224_IV[7] | 0;\n constructor() {\n super(28);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal 64-byte base SHA2 hash class. */\nclass SHA2_64B extends HashMD {\n constructor(outputLen) {\n super(128, outputLen, 16, false);\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA2-512 hash class. */\nexport class _SHA512 extends SHA2_64B {\n Ah = SHA512_IV[0] | 0;\n Al = SHA512_IV[1] | 0;\n Bh = SHA512_IV[2] | 0;\n Bl = SHA512_IV[3] | 0;\n Ch = SHA512_IV[4] | 0;\n Cl = SHA512_IV[5] | 0;\n Dh = SHA512_IV[6] | 0;\n Dl = SHA512_IV[7] | 0;\n Eh = SHA512_IV[8] | 0;\n El = SHA512_IV[9] | 0;\n Fh = SHA512_IV[10] | 0;\n Fl = SHA512_IV[11] | 0;\n Gh = SHA512_IV[12] | 0;\n Gl = SHA512_IV[13] | 0;\n Hh = SHA512_IV[14] | 0;\n Hl = SHA512_IV[15] | 0;\n constructor() {\n super(64);\n }\n}\n/** Internal SHA2-384 hash class. */\nexport class _SHA384 extends SHA2_64B {\n Ah = SHA384_IV[0] | 0;\n Al = SHA384_IV[1] | 0;\n Bh = SHA384_IV[2] | 0;\n Bl = SHA384_IV[3] | 0;\n Ch = SHA384_IV[4] | 0;\n Cl = SHA384_IV[5] | 0;\n Dh = SHA384_IV[6] | 0;\n Dl = SHA384_IV[7] | 0;\n Eh = SHA384_IV[8] | 0;\n El = SHA384_IV[9] | 0;\n Fh = SHA384_IV[10] | 0;\n Fl = SHA384_IV[11] | 0;\n Gh = SHA384_IV[12] | 0;\n Gl = SHA384_IV[13] | 0;\n Hh = SHA384_IV[14] | 0;\n Hl = SHA384_IV[15] | 0;\n constructor() {\n super(48);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA2-512/224 hash class. */\nexport class _SHA512_224 extends SHA2_64B {\n Ah = T224_IV[0] | 0;\n Al = T224_IV[1] | 0;\n Bh = T224_IV[2] | 0;\n Bl = T224_IV[3] | 0;\n Ch = T224_IV[4] | 0;\n Cl = T224_IV[5] | 0;\n Dh = T224_IV[6] | 0;\n Dl = T224_IV[7] | 0;\n Eh = T224_IV[8] | 0;\n El = T224_IV[9] | 0;\n Fh = T224_IV[10] | 0;\n Fl = T224_IV[11] | 0;\n Gh = T224_IV[12] | 0;\n Gl = T224_IV[13] | 0;\n Hh = T224_IV[14] | 0;\n Hl = T224_IV[15] | 0;\n constructor() {\n super(28);\n }\n}\n/** Internal SHA2-512/256 hash class. */\nexport class _SHA512_256 extends SHA2_64B {\n Ah = T256_IV[0] | 0;\n Al = T256_IV[1] | 0;\n Bh = T256_IV[2] | 0;\n Bl = T256_IV[3] | 0;\n Ch = T256_IV[4] | 0;\n Cl = T256_IV[5] | 0;\n Dh = T256_IV[6] | 0;\n Dl = T256_IV[7] | 0;\n Eh = T256_IV[8] | 0;\n El = T256_IV[9] | 0;\n Fh = T256_IV[10] | 0;\n Fl = T256_IV[11] | 0;\n Gh = T256_IV[12] | 0;\n Gl = T256_IV[13] | 0;\n Hh = T256_IV[14] | 0;\n Hl = T256_IV[15] | 0;\n constructor() {\n super(32);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n//# sourceMappingURL=sha2.js.map"],"names":["isBytes","a","anumber","n","title","prefix","abytes","value","length","bytes","len","needsLen","ofLen","got","ahash","h","aexists","instance","checkFinished","aoutput","out","min","u32","arr","clean","arrays","i","createView","rotr","word","shift","rotl","isLE","byteSwap","byteSwap32","swap32IfBE","u","createHasher","hashCons","info","hashC","msg","opts","tmp","oidNist","suffix","Chi","b","c","Maj","HashMD","blockLen","outputLen","padOffset","__publicField","data","view","buffer","pos","take","dataView","oview","outLen","state","res","to","finished","destroyed","SHA256_IV","SHA256_K","SHA256_W","SHA2_32B","A","B","C","D","E","F","G","H","offset","W15","W2","s0","s1","sigma1","T1","T2","_SHA256","sha256"],"mappings":";;;AAMO,SAASA,EAAQC,GAAG;AACvB,SAAOA,aAAa,cAAe,YAAY,OAAOA,CAAC,KAAKA,EAAE,YAAY,SAAS;AACvF;AAEO,SAASC,EAAQC,GAAGC,IAAQ,IAAI;AACnC,MAAI,CAAC,OAAO,cAAcD,CAAC,KAAKA,IAAI,GAAG;AACnC,UAAME,IAASD,KAAS,IAAIA,CAAK;AACjC,UAAM,IAAI,MAAM,GAA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Ac;AACV,UAAM,EAAE;AATZ;AAAA;AAAA,IAAAjB,EAAA,WAAIc,EAAU,CAAC,IAAI;AACnB,IAAAd,EAAA,WAAIc,EAAU,CAAC,IAAI;AACnB,IAAAd,EAAA,WAAIc,EAAU,CAAC,IAAI;AACnB,IAAAd,EAAA,WAAIc,EAAU,CAAC,IAAI;AACnB,IAAAd,EAAA,WAAIc,EAAU,CAAC,IAAI;AACnB,IAAAd,EAAA,WAAIc,EAAU,CAAC,IAAI;AACnB,IAAAd,EAAA,WAAIc,EAAU,CAAC,IAAI;AACnB,IAAAd,EAAA,WAAIc,EAAU,CAAC,IAAI;AAAA,EAGnB;AACJ;AAyQY,MAACqB,IAAyB,gBAAApD;AAAA,EAAa,MAAM,IAAImD,EAAO;AAAA,EACpD,gBAAA5C,EAAQ,CAAI;AAAC;","x_google_ignoreList":[0,1,2]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var _=Object.defineProperty;var k=(t,e,s)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var a=(t,e,s)=>k(t,typeof e!="symbol"?e+"":e,s);function D(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function A(t,e=""){if(!Number.isSafeInteger(t)||t<0){const s=e&&`"${e}" `;throw new Error(`${s}expected integer >= 0, got ${t}`)}}function H(t,e,s=""){const i=D(t),n=t==null?void 0:t.length,c=e!==void 0;if(!i||c&&n!==e){const o=s&&`"${s}" `,f=c?` of length ${e}`:"",h=i?`length=${n}`:`type=${typeof t}`;throw new Error(o+"expected Uint8Array"+f+", got "+h)}return t}function S(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash must wrapped by utils.createHasher");A(t.outputLen),A(t.blockLen)}function E(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function U(t,e){H(t,void 0,"digestInto() output");const s=e.outputLen;if(t.length<s)throw new Error('"digestInto() output" expected to be of length >='+s)}function C(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function y(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function L(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function x(t,e){return t<<32-e|t>>>e}function O(t,e){return t<<e|t>>>32-e>>>0}const $=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function F(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function G(t){for(let e=0;e<t.length;e++)t[e]=F(t[e]);return t}const M=$?t=>t:G;function B(t,e={}){const s=(n,c)=>t(c).update(n).digest(),i=t(void 0);return s.outputLen=i.outputLen,s.blockLen=i.blockLen,s.create=n=>t(n),Object.assign(s,e),Object.freeze(s)}const V=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function j(t,e,s){return t&e^~t&s}function W(t,e,s){return t&e^t&s^e&s}class I{constructor(e,s,i,n){a(this,"blockLen");a(this,"outputLen");a(this,"padOffset");a(this,"isLE");a(this,"buffer");a(this,"view");a(this,"finished",!1);a(this,"length",0);a(this,"pos",0);a(this,"destroyed",!1);this.blockLen=e,this.outputLen=s,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(e),this.view=L(this.buffer)}update(e){E(this),H(e);const{view:s,buffer:i,blockLen:n}=this,c=e.length;for(let o=0;o<c;){const f=Math.min(n-this.pos,c-o);if(f===n){const h=L(e);for(;n<=c-o;o+=n)this.process(h,o);continue}i.set(e.subarray(o,o+f),this.pos),this.pos+=f,o+=f,this.pos===n&&(this.process(s,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){E(this),U(e,this),this.finished=!0;const{buffer:s,view:i,blockLen:n,isLE:c}=this;let{pos:o}=this;s[o++]=128,y(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(i,0),o=0);for(let r=o;r<n;r++)s[r]=0;i.setBigUint64(n-8,BigInt(this.length*8),c),this.process(i,0);const f=L(e),h=this.outputLen;if(h%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const u=h/4,b=this.get();if(u>b.length)throw new Error("_sha2: outputLen bigger than state");for(let r=0;r<u;r++)f.setUint32(4*r,b[r],c)}digest(){const{buffer:e,outputLen:s}=this;this.digestInto(e);const i=e.slice(0,s);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:s,buffer:i,length:n,finished:c,destroyed:o,pos:f}=this;return e.destroyed=o,e.finished=c,e.length=n,e.pos=f,n%s&&e.buffer.set(i),e}clone(){return this._cloneInto()}}const d=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),N=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),p=new Uint32Array(64);class T extends I{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:s,C:i,D:n,E:c,F:o,G:f,H:h}=this;return[e,s,i,n,c,o,f,h]}set(e,s,i,n,c,o,f,h){this.A=e|0,this.B=s|0,this.C=i|0,this.D=n|0,this.E=c|0,this.F=o|0,this.G=f|0,this.H=h|0}process(e,s){for(let r=0;r<16;r++,s+=4)p[r]=e.getUint32(s,!1);for(let r=16;r<64;r++){const g=p[r-15],l=p[r-2],m=x(g,7)^x(g,18)^g>>>3,w=x(l,17)^x(l,19)^l>>>10;p[r]=w+p[r-7]+m+p[r-16]|0}let{A:i,B:n,C:c,D:o,E:f,F:h,G:u,H:b}=this;for(let r=0;r<64;r++){const g=x(f,6)^x(f,11)^x(f,25),l=b+g+j(f,h,u)+N[r]+p[r]|0,w=(x(i,2)^x(i,13)^x(i,22))+W(i,n,c)|0;b=u,u=h,h=f,f=o+l|0,o=c,c=n,n=i,i=l+w|0}i=i+this.A|0,n=n+this.B|0,c=c+this.C|0,o=o+this.D|0,f=f+this.E|0,h=h+this.F|0,u=u+this.G|0,b=b+this.H|0,this.set(i,n,c,o,f,h,u,b)}roundClean(){y(p)}destroy(){this.set(0,0,0,0,0,0,0,0),y(this.buffer)}}class z extends T{constructor(){super(32);a(this,"A",d[0]|0);a(this,"B",d[1]|0);a(this,"C",d[2]|0);a(this,"D",d[3]|0);a(this,"E",d[4]|0);a(this,"F",d[5]|0);a(this,"G",d[6]|0);a(this,"H",d[7]|0)}}const K=B(()=>new z,V(1));exports.HashMD=I;exports.abytes=H;exports.aexists=E;exports.ahash=S;exports.anumber=A;exports.aoutput=U;exports.clean=y;exports.createHasher=B;exports.rotl=O;exports.sha256=K;exports.swap32IfBE=M;exports.u32=C;
|
|
2
|
+
//# sourceMappingURL=sha2-CsTynrfJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha2-CsTynrfJ.cjs","sources":["../../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/utils.js","../../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/_md.js","../../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/sha2.js"],"sourcesContent":["/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is positive integer. */\nexport function anumber(n, title = '') {\n if (!Number.isSafeInteger(n) || n < 0) {\n const prefix = title && `\"${title}\" `;\n throw new Error(`${prefix}expected integer >= 0, got ${n}`);\n }\n}\n/** Asserts something is Uint8Array. */\nexport function abytes(value, length, title = '') {\n const bytes = isBytes(value);\n const len = value?.length;\n const needsLen = length !== undefined;\n if (!bytes || (needsLen && len !== length)) {\n const prefix = title && `\"${title}\" `;\n const ofLen = needsLen ? ` of length ${length}` : '';\n const got = bytes ? `length=${len}` : `type=${typeof value}`;\n throw new Error(prefix + 'expected Uint8Array' + ofLen + ', got ' + got);\n }\n return value;\n}\n/** Asserts something is hash */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash must wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'digestInto() output');\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('\"digestInto() output\" expected to be of length >=' + min);\n }\n}\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/** The byte swap operation for uint32 */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n);\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin)\n return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async () => { };\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/** Merges default options and passed options. */\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options must be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\n/** Creates function with outputLen, blockLen, create properties from a class constructor. */\nexport function createHasher(hashCons, info = {}) {\n const hashC = (msg, opts) => hashCons(opts).update(msg).digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32) {\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/** Creates OID opts for NIST hashes, with prefix 06 09 60 86 48 01 65 03 04 02. */\nexport const oidNist = (suffix) => ({\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n//# sourceMappingURL=utils.js.map","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { abytes, aexists, aoutput, clean, createView } from \"./utils.js\";\n/** Choice: a ? b : c */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/** Majority function, true if any two inputs is true. */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nexport class HashMD {\n blockLen;\n outputLen;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen must be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to ||= new this.constructor();\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n//# sourceMappingURL=_md.js.map","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://www.rfc-editor.org/rfc/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal 32-byte base SHA2 hash class. */\nclass SHA2_32B extends HashMD {\n constructor(outputLen) {\n super(64, outputLen, 8, false);\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n clean(SHA256_W);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA2-256 hash class. */\nexport class _SHA256 extends SHA2_32B {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n A = SHA256_IV[0] | 0;\n B = SHA256_IV[1] | 0;\n C = SHA256_IV[2] | 0;\n D = SHA256_IV[3] | 0;\n E = SHA256_IV[4] | 0;\n F = SHA256_IV[5] | 0;\n G = SHA256_IV[6] | 0;\n H = SHA256_IV[7] | 0;\n constructor() {\n super(32);\n }\n}\n/** Internal SHA2-224 hash class. */\nexport class _SHA224 extends SHA2_32B {\n A = SHA224_IV[0] | 0;\n B = SHA224_IV[1] | 0;\n C = SHA224_IV[2] | 0;\n D = SHA224_IV[3] | 0;\n E = SHA224_IV[4] | 0;\n F = SHA224_IV[5] | 0;\n G = SHA224_IV[6] | 0;\n H = SHA224_IV[7] | 0;\n constructor() {\n super(28);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal 64-byte base SHA2 hash class. */\nclass SHA2_64B extends HashMD {\n constructor(outputLen) {\n super(128, outputLen, 16, false);\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA2-512 hash class. */\nexport class _SHA512 extends SHA2_64B {\n Ah = SHA512_IV[0] | 0;\n Al = SHA512_IV[1] | 0;\n Bh = SHA512_IV[2] | 0;\n Bl = SHA512_IV[3] | 0;\n Ch = SHA512_IV[4] | 0;\n Cl = SHA512_IV[5] | 0;\n Dh = SHA512_IV[6] | 0;\n Dl = SHA512_IV[7] | 0;\n Eh = SHA512_IV[8] | 0;\n El = SHA512_IV[9] | 0;\n Fh = SHA512_IV[10] | 0;\n Fl = SHA512_IV[11] | 0;\n Gh = SHA512_IV[12] | 0;\n Gl = SHA512_IV[13] | 0;\n Hh = SHA512_IV[14] | 0;\n Hl = SHA512_IV[15] | 0;\n constructor() {\n super(64);\n }\n}\n/** Internal SHA2-384 hash class. */\nexport class _SHA384 extends SHA2_64B {\n Ah = SHA384_IV[0] | 0;\n Al = SHA384_IV[1] | 0;\n Bh = SHA384_IV[2] | 0;\n Bl = SHA384_IV[3] | 0;\n Ch = SHA384_IV[4] | 0;\n Cl = SHA384_IV[5] | 0;\n Dh = SHA384_IV[6] | 0;\n Dl = SHA384_IV[7] | 0;\n Eh = SHA384_IV[8] | 0;\n El = SHA384_IV[9] | 0;\n Fh = SHA384_IV[10] | 0;\n Fl = SHA384_IV[11] | 0;\n Gh = SHA384_IV[12] | 0;\n Gl = SHA384_IV[13] | 0;\n Hh = SHA384_IV[14] | 0;\n Hl = SHA384_IV[15] | 0;\n constructor() {\n super(48);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA2-512/224 hash class. */\nexport class _SHA512_224 extends SHA2_64B {\n Ah = T224_IV[0] | 0;\n Al = T224_IV[1] | 0;\n Bh = T224_IV[2] | 0;\n Bl = T224_IV[3] | 0;\n Ch = T224_IV[4] | 0;\n Cl = T224_IV[5] | 0;\n Dh = T224_IV[6] | 0;\n Dl = T224_IV[7] | 0;\n Eh = T224_IV[8] | 0;\n El = T224_IV[9] | 0;\n Fh = T224_IV[10] | 0;\n Fl = T224_IV[11] | 0;\n Gh = T224_IV[12] | 0;\n Gl = T224_IV[13] | 0;\n Hh = T224_IV[14] | 0;\n Hl = T224_IV[15] | 0;\n constructor() {\n super(28);\n }\n}\n/** Internal SHA2-512/256 hash class. */\nexport class _SHA512_256 extends SHA2_64B {\n Ah = T256_IV[0] | 0;\n Al = T256_IV[1] | 0;\n Bh = T256_IV[2] | 0;\n Bl = T256_IV[3] | 0;\n Ch = T256_IV[4] | 0;\n Cl = T256_IV[5] | 0;\n Dh = T256_IV[6] | 0;\n Dl = T256_IV[7] | 0;\n Eh = T256_IV[8] | 0;\n El = T256_IV[9] | 0;\n Fh = T256_IV[10] | 0;\n Fl = T256_IV[11] | 0;\n Gh = T256_IV[12] | 0;\n Gl = T256_IV[13] | 0;\n Hh = T256_IV[14] | 0;\n Hl = T256_IV[15] | 0;\n constructor() {\n super(32);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n//# sourceMappingURL=sha2.js.map"],"names":["isBytes","a","anumber","n","title","prefix","abytes","value","length","bytes","len","needsLen","ofLen","got","ahash","h","aexists","instance","checkFinished","aoutput","out","min","u32","arr","clean","arrays","i","createView","rotr","word","shift","rotl","isLE","byteSwap","byteSwap32","swap32IfBE","u","createHasher","hashCons","info","hashC","msg","opts","tmp","oidNist","suffix","Chi","b","c","Maj","HashMD","blockLen","outputLen","padOffset","__publicField","data","view","buffer","pos","take","dataView","oview","outLen","state","res","to","finished","destroyed","SHA256_IV","SHA256_K","SHA256_W","SHA2_32B","A","B","C","D","E","F","G","H","offset","W15","W2","s0","s1","sigma1","T1","T2","_SHA256","sha256"],"mappings":"iLAMO,SAASA,EAAQC,EAAG,CACvB,OAAOA,aAAa,YAAe,YAAY,OAAOA,CAAC,GAAKA,EAAE,YAAY,OAAS,YACvF,CAEO,SAASC,EAAQC,EAAGC,EAAQ,GAAI,CACnC,GAAI,CAAC,OAAO,cAAcD,CAAC,GAAKA,EAAI,EAAG,CACnC,MAAME,EAASD,GAAS,IAAIA,CAAK,KACjC,MAAM,IAAI,MAAM,GAAGC,CAAM,8BAA8BF,CAAC,EAAE,CAC9D,CACJ,CAEO,SAASG,EAAOC,EAAOC,EAAQJ,EAAQ,GAAI,CAC9C,MAAMK,EAAQT,EAAQO,CAAK,EACrBG,EAAMH,GAAA,YAAAA,EAAO,OACbI,EAAWH,IAAW,OAC5B,GAAI,CAACC,GAAUE,GAAYD,IAAQF,EAAS,CACxC,MAAMH,EAASD,GAAS,IAAIA,CAAK,KAC3BQ,EAAQD,EAAW,cAAcH,CAAM,GAAK,GAC5CK,EAAMJ,EAAQ,UAAUC,CAAG,GAAK,QAAQ,OAAOH,CAAK,GAC1D,MAAM,IAAI,MAAMF,EAAS,sBAAwBO,EAAQ,SAAWC,CAAG,CAC3E,CACA,OAAON,CACX,CAEO,SAASO,EAAMC,EAAG,CACrB,GAAI,OAAOA,GAAM,YAAc,OAAOA,EAAE,QAAW,WAC/C,MAA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Bd,EAAA,SAAIc,EAAU,CAAC,EAAI,GACnBd,EAAA,SAAIc,EAAU,CAAC,EAAI,GACnBd,EAAA,SAAIc,EAAU,CAAC,EAAI,GACnBd,EAAA,SAAIc,EAAU,CAAC,EAAI,GACnBd,EAAA,SAAIc,EAAU,CAAC,EAAI,EAGnB,CACJ,CAyQY,MAACqB,EAAyBpD,EAAa,IAAM,IAAImD,EAC7C5C,EAAQ,CAAI,CAAC","x_google_ignoreList":[0,1,2]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/shared/wallets/interfaces/BitcoinWallet.ts"],"sourcesContent":["/**\n * Bitcoin network types.\n * Using string literal union for maximum compatibility with wallet providers.\n */\nexport type BitcoinNetwork = \"mainnet\" | \"testnet\" | \"signet\";\n\n/**\n * Bitcoin network constants\n */\nexport const BitcoinNetworks = {\n MAINNET: \"mainnet\",\n TESTNET: \"testnet\",\n SIGNET: \"signet\",\n} as const;\n\n/**\n * Options for signing a specific input in a PSBT.\n */\nexport interface SignInputOptions {\n /** Input index to sign */\n index: number;\n /** Address for signing (optional) */\n address?: string;\n /** Public key for signing (optional, hex string) */\n publicKey?: string;\n /** Sighash types (optional) */\n sighashTypes?: number[];\n /**\n * Whether the wallet should sign with the tweaked (key-path) signer.\n * Set `false` for Taproot script-path spends, where signing uses the\n * untweaked internal key. If omitted, the wallet's default behavior\n * applies.\n */\n useTweakedSigner?: boolean;\n /**\n * @deprecated Use `useTweakedSigner` instead. `disableTweakSigner: true`\n * is equivalent to `useTweakedSigner: false`; `useTweakedSigner` takes\n * precedence when both are set.\n *\n * `useTweakedSigner` is the canonical field used by UniSat and newer OKX\n * wallet versions. Migrating aligns our interface with the wallet-side\n * convention and avoids the historical divergence in OKX's\n * `disableTweakSigner` implementation.\n */\n disableTweakSigner?: boolean;\n}\n\n/**\n * SignPsbt options for advanced signing scenarios.\n */\nexport interface SignPsbtOptions {\n /** Whether to automatically finalize the PSBT after signing */\n autoFinalized?: boolean;\n /**\n * Specific inputs to sign.\n * If not provided, wallet will attempt to sign all inputs it can.\n * Use this to restrict signing to specific inputs (e.g., only depositor's input).\n */\n signInputs?: SignInputOptions[];\n /** Contract information for the signing operation. */\n contracts?: Array<{\n /** Contract identifier. */\n id: string;\n /** Contract parameters. */\n params: Record<string, string | number | string[] | number[]>;\n }>;\n /** Action metadata. */\n action?: {\n /** Action name for tracking. */\n name: string;\n };\n}\n\n/**\n * This interface is designed to be compatible with @babylonlabs-io/wallet-connector's IBTCProvider\n *\n * Supports Unisat, Ledger, OKX, OneKey, Keystone, and other Bitcoin wallets.\n */\nexport interface BitcoinWallet {\n /**\n * Returns the wallet's public key as a hex string.\n *\n * For Taproot addresses, this should return the x-only public key\n * (32 bytes = 64 hex characters without 0x prefix).\n *\n * For compressed public keys (33 bytes = 66 hex characters),\n * consumers should strip the first byte to get x-only format.\n */\n getPublicKeyHex(): Promise<string>;\n\n /**\n * Returns the wallet's Bitcoin address.\n */\n getAddress(): Promise<string>;\n\n /**\n * Signs a PSBT and returns the signed PSBT as hex.\n *\n * @param psbtHex - The PSBT to sign in hex format\n * @param options - Optional signing parameters (e.g., autoFinalized, contracts)\n * @throws {Error} If the PSBT is invalid or signing fails\n */\n signPsbt(psbtHex: string, options?: SignPsbtOptions): Promise<string>;\n\n /**\n * Signs multiple PSBTs and returns the signed PSBTs as hex.\n * This allows batch signing with a single wallet interaction.\n *\n * @param psbtsHexes - Array of PSBTs to sign in hex format\n * @param options - Optional array of signing parameters for each PSBT\n * @throws {Error} If any PSBT is invalid or signing fails\n */\n signPsbts(\n psbtsHexes: string[],\n options?: SignPsbtOptions[],\n ): Promise<string[]>;\n\n /**\n * Signs a message for authentication or proof of ownership.\n *\n * @param message - The message to sign\n * @param type - The signing method: \"ecdsa\" for standard signatures, \"bip322-simple\" for BIP-322\n * @returns Base64-encoded signature\n */\n signMessage(\n message: string,\n type: \"bip322-simple\" | \"ecdsa\",\n ): Promise<string>;\n\n /**\n * Returns the Bitcoin network the wallet is connected to.\n *\n * @returns BitcoinNetwork enum value (MAINNET, TESTNET, SIGNET)\n */\n getNetwork(): Promise<BitcoinNetwork>;\n}\n"],"names":["BitcoinNetworks"],"mappings":"gFASO,MAAMA,EAAkB,CAC7B,QAAS,UACT,QAAS,UACT,OAAQ,QACV"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/shared/wallets/interfaces/BitcoinWallet.ts"],"sourcesContent":["/**\n * Bitcoin network types.\n * Using string literal union for maximum compatibility with wallet providers.\n */\nexport type BitcoinNetwork = \"mainnet\" | \"testnet\" | \"signet\";\n\n/**\n * Bitcoin network constants\n */\nexport const BitcoinNetworks = {\n MAINNET: \"mainnet\",\n TESTNET: \"testnet\",\n SIGNET: \"signet\",\n} as const;\n\n/**\n * Options for signing a specific input in a PSBT.\n */\nexport interface SignInputOptions {\n /** Input index to sign */\n index: number;\n /** Address for signing (optional) */\n address?: string;\n /** Public key for signing (optional, hex string) */\n publicKey?: string;\n /** Sighash types (optional) */\n sighashTypes?: number[];\n /**\n * Whether the wallet should sign with the tweaked (key-path) signer.\n * Set `false` for Taproot script-path spends, where signing uses the\n * untweaked internal key. If omitted, the wallet's default behavior\n * applies.\n */\n useTweakedSigner?: boolean;\n /**\n * @deprecated Use `useTweakedSigner` instead. `disableTweakSigner: true`\n * is equivalent to `useTweakedSigner: false`; `useTweakedSigner` takes\n * precedence when both are set.\n *\n * `useTweakedSigner` is the canonical field used by UniSat and newer OKX\n * wallet versions. Migrating aligns our interface with the wallet-side\n * convention and avoids the historical divergence in OKX's\n * `disableTweakSigner` implementation.\n */\n disableTweakSigner?: boolean;\n}\n\n/**\n * SignPsbt options for advanced signing scenarios.\n */\nexport interface SignPsbtOptions {\n /** Whether to automatically finalize the PSBT after signing */\n autoFinalized?: boolean;\n /**\n * Specific inputs to sign.\n * If not provided, wallet will attempt to sign all inputs it can.\n * Use this to restrict signing to specific inputs (e.g., only depositor's input).\n */\n signInputs?: SignInputOptions[];\n /** Contract information for the signing operation. */\n contracts?: Array<{\n /** Contract identifier. */\n id: string;\n /** Contract parameters. */\n params: Record<string, string | number | string[] | number[]>;\n }>;\n /** Action metadata. */\n action?: {\n /** Action name for tracking. */\n name: string;\n };\n}\n\n/**\n * This interface is designed to be compatible with @babylonlabs-io/wallet-connector's IBTCProvider\n *\n * Supports Unisat, Ledger, OKX, OneKey, Keystone, and other Bitcoin wallets.\n */\nexport interface BitcoinWallet {\n /**\n * Returns the wallet's public key as a hex string.\n *\n * For Taproot addresses, this should return the x-only public key\n * (32 bytes = 64 hex characters without 0x prefix).\n *\n * For compressed public keys (33 bytes = 66 hex characters),\n * consumers should strip the first byte to get x-only format.\n */\n getPublicKeyHex(): Promise<string>;\n\n /**\n * Returns the wallet's Bitcoin address.\n */\n getAddress(): Promise<string>;\n\n /**\n * Signs a PSBT and returns the signed PSBT as hex.\n *\n * @param psbtHex - The PSBT to sign in hex format\n * @param options - Optional signing parameters (e.g., autoFinalized, contracts)\n * @throws {Error} If the PSBT is invalid or signing fails\n */\n signPsbt(psbtHex: string, options?: SignPsbtOptions): Promise<string>;\n\n /**\n * Signs multiple PSBTs and returns the signed PSBTs as hex.\n * This allows batch signing with a single wallet interaction.\n *\n * @param psbtsHexes - Array of PSBTs to sign in hex format\n * @param options - Optional array of signing parameters for each PSBT\n * @throws {Error} If any PSBT is invalid or signing fails\n */\n signPsbts(\n psbtsHexes: string[],\n options?: SignPsbtOptions[],\n ): Promise<string[]>;\n\n /**\n * Signs a message for authentication or proof of ownership.\n *\n * @param message - The message to sign\n * @param type - The signing method: \"ecdsa\" for standard signatures, \"bip322-simple\" for BIP-322\n * @returns Base64-encoded signature\n */\n signMessage(\n message: string,\n type: \"bip322-simple\" | \"ecdsa\",\n ): Promise<string>;\n\n /**\n * Returns the Bitcoin network the wallet is connected to.\n *\n * @returns BitcoinNetwork enum value (MAINNET, TESTNET, SIGNET)\n */\n getNetwork(): Promise<BitcoinNetwork>;\n\n /**\n * Derives a deterministic 32-byte value per\n * `docs/specs/derive-context-hash.md` rev 1.0. Throws with code\n * `WALLET_METHOD_NOT_SUPPORTED` if unimplemented.\n *\n * @returns 64-char lowercase hex (32 bytes).\n */\n deriveContextHash(appName: string, context: string): Promise<string>;\n}\n"],"names":["BitcoinNetworks"],"mappings":"gFASO,MAAMA,EAAkB,CAC7B,QAAS,UACT,QAAS,UACT,OAAQ,QACV"}
|
package/dist/shared/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/shared/wallets/interfaces/BitcoinWallet.ts"],"sourcesContent":["/**\n * Bitcoin network types.\n * Using string literal union for maximum compatibility with wallet providers.\n */\nexport type BitcoinNetwork = \"mainnet\" | \"testnet\" | \"signet\";\n\n/**\n * Bitcoin network constants\n */\nexport const BitcoinNetworks = {\n MAINNET: \"mainnet\",\n TESTNET: \"testnet\",\n SIGNET: \"signet\",\n} as const;\n\n/**\n * Options for signing a specific input in a PSBT.\n */\nexport interface SignInputOptions {\n /** Input index to sign */\n index: number;\n /** Address for signing (optional) */\n address?: string;\n /** Public key for signing (optional, hex string) */\n publicKey?: string;\n /** Sighash types (optional) */\n sighashTypes?: number[];\n /**\n * Whether the wallet should sign with the tweaked (key-path) signer.\n * Set `false` for Taproot script-path spends, where signing uses the\n * untweaked internal key. If omitted, the wallet's default behavior\n * applies.\n */\n useTweakedSigner?: boolean;\n /**\n * @deprecated Use `useTweakedSigner` instead. `disableTweakSigner: true`\n * is equivalent to `useTweakedSigner: false`; `useTweakedSigner` takes\n * precedence when both are set.\n *\n * `useTweakedSigner` is the canonical field used by UniSat and newer OKX\n * wallet versions. Migrating aligns our interface with the wallet-side\n * convention and avoids the historical divergence in OKX's\n * `disableTweakSigner` implementation.\n */\n disableTweakSigner?: boolean;\n}\n\n/**\n * SignPsbt options for advanced signing scenarios.\n */\nexport interface SignPsbtOptions {\n /** Whether to automatically finalize the PSBT after signing */\n autoFinalized?: boolean;\n /**\n * Specific inputs to sign.\n * If not provided, wallet will attempt to sign all inputs it can.\n * Use this to restrict signing to specific inputs (e.g., only depositor's input).\n */\n signInputs?: SignInputOptions[];\n /** Contract information for the signing operation. */\n contracts?: Array<{\n /** Contract identifier. */\n id: string;\n /** Contract parameters. */\n params: Record<string, string | number | string[] | number[]>;\n }>;\n /** Action metadata. */\n action?: {\n /** Action name for tracking. */\n name: string;\n };\n}\n\n/**\n * This interface is designed to be compatible with @babylonlabs-io/wallet-connector's IBTCProvider\n *\n * Supports Unisat, Ledger, OKX, OneKey, Keystone, and other Bitcoin wallets.\n */\nexport interface BitcoinWallet {\n /**\n * Returns the wallet's public key as a hex string.\n *\n * For Taproot addresses, this should return the x-only public key\n * (32 bytes = 64 hex characters without 0x prefix).\n *\n * For compressed public keys (33 bytes = 66 hex characters),\n * consumers should strip the first byte to get x-only format.\n */\n getPublicKeyHex(): Promise<string>;\n\n /**\n * Returns the wallet's Bitcoin address.\n */\n getAddress(): Promise<string>;\n\n /**\n * Signs a PSBT and returns the signed PSBT as hex.\n *\n * @param psbtHex - The PSBT to sign in hex format\n * @param options - Optional signing parameters (e.g., autoFinalized, contracts)\n * @throws {Error} If the PSBT is invalid or signing fails\n */\n signPsbt(psbtHex: string, options?: SignPsbtOptions): Promise<string>;\n\n /**\n * Signs multiple PSBTs and returns the signed PSBTs as hex.\n * This allows batch signing with a single wallet interaction.\n *\n * @param psbtsHexes - Array of PSBTs to sign in hex format\n * @param options - Optional array of signing parameters for each PSBT\n * @throws {Error} If any PSBT is invalid or signing fails\n */\n signPsbts(\n psbtsHexes: string[],\n options?: SignPsbtOptions[],\n ): Promise<string[]>;\n\n /**\n * Signs a message for authentication or proof of ownership.\n *\n * @param message - The message to sign\n * @param type - The signing method: \"ecdsa\" for standard signatures, \"bip322-simple\" for BIP-322\n * @returns Base64-encoded signature\n */\n signMessage(\n message: string,\n type: \"bip322-simple\" | \"ecdsa\",\n ): Promise<string>;\n\n /**\n * Returns the Bitcoin network the wallet is connected to.\n *\n * @returns BitcoinNetwork enum value (MAINNET, TESTNET, SIGNET)\n */\n getNetwork(): Promise<BitcoinNetwork>;\n}\n"],"names":["BitcoinNetworks"],"mappings":"AASO,MAAMA,IAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/shared/wallets/interfaces/BitcoinWallet.ts"],"sourcesContent":["/**\n * Bitcoin network types.\n * Using string literal union for maximum compatibility with wallet providers.\n */\nexport type BitcoinNetwork = \"mainnet\" | \"testnet\" | \"signet\";\n\n/**\n * Bitcoin network constants\n */\nexport const BitcoinNetworks = {\n MAINNET: \"mainnet\",\n TESTNET: \"testnet\",\n SIGNET: \"signet\",\n} as const;\n\n/**\n * Options for signing a specific input in a PSBT.\n */\nexport interface SignInputOptions {\n /** Input index to sign */\n index: number;\n /** Address for signing (optional) */\n address?: string;\n /** Public key for signing (optional, hex string) */\n publicKey?: string;\n /** Sighash types (optional) */\n sighashTypes?: number[];\n /**\n * Whether the wallet should sign with the tweaked (key-path) signer.\n * Set `false` for Taproot script-path spends, where signing uses the\n * untweaked internal key. If omitted, the wallet's default behavior\n * applies.\n */\n useTweakedSigner?: boolean;\n /**\n * @deprecated Use `useTweakedSigner` instead. `disableTweakSigner: true`\n * is equivalent to `useTweakedSigner: false`; `useTweakedSigner` takes\n * precedence when both are set.\n *\n * `useTweakedSigner` is the canonical field used by UniSat and newer OKX\n * wallet versions. Migrating aligns our interface with the wallet-side\n * convention and avoids the historical divergence in OKX's\n * `disableTweakSigner` implementation.\n */\n disableTweakSigner?: boolean;\n}\n\n/**\n * SignPsbt options for advanced signing scenarios.\n */\nexport interface SignPsbtOptions {\n /** Whether to automatically finalize the PSBT after signing */\n autoFinalized?: boolean;\n /**\n * Specific inputs to sign.\n * If not provided, wallet will attempt to sign all inputs it can.\n * Use this to restrict signing to specific inputs (e.g., only depositor's input).\n */\n signInputs?: SignInputOptions[];\n /** Contract information for the signing operation. */\n contracts?: Array<{\n /** Contract identifier. */\n id: string;\n /** Contract parameters. */\n params: Record<string, string | number | string[] | number[]>;\n }>;\n /** Action metadata. */\n action?: {\n /** Action name for tracking. */\n name: string;\n };\n}\n\n/**\n * This interface is designed to be compatible with @babylonlabs-io/wallet-connector's IBTCProvider\n *\n * Supports Unisat, Ledger, OKX, OneKey, Keystone, and other Bitcoin wallets.\n */\nexport interface BitcoinWallet {\n /**\n * Returns the wallet's public key as a hex string.\n *\n * For Taproot addresses, this should return the x-only public key\n * (32 bytes = 64 hex characters without 0x prefix).\n *\n * For compressed public keys (33 bytes = 66 hex characters),\n * consumers should strip the first byte to get x-only format.\n */\n getPublicKeyHex(): Promise<string>;\n\n /**\n * Returns the wallet's Bitcoin address.\n */\n getAddress(): Promise<string>;\n\n /**\n * Signs a PSBT and returns the signed PSBT as hex.\n *\n * @param psbtHex - The PSBT to sign in hex format\n * @param options - Optional signing parameters (e.g., autoFinalized, contracts)\n * @throws {Error} If the PSBT is invalid or signing fails\n */\n signPsbt(psbtHex: string, options?: SignPsbtOptions): Promise<string>;\n\n /**\n * Signs multiple PSBTs and returns the signed PSBTs as hex.\n * This allows batch signing with a single wallet interaction.\n *\n * @param psbtsHexes - Array of PSBTs to sign in hex format\n * @param options - Optional array of signing parameters for each PSBT\n * @throws {Error} If any PSBT is invalid or signing fails\n */\n signPsbts(\n psbtsHexes: string[],\n options?: SignPsbtOptions[],\n ): Promise<string[]>;\n\n /**\n * Signs a message for authentication or proof of ownership.\n *\n * @param message - The message to sign\n * @param type - The signing method: \"ecdsa\" for standard signatures, \"bip322-simple\" for BIP-322\n * @returns Base64-encoded signature\n */\n signMessage(\n message: string,\n type: \"bip322-simple\" | \"ecdsa\",\n ): Promise<string>;\n\n /**\n * Returns the Bitcoin network the wallet is connected to.\n *\n * @returns BitcoinNetwork enum value (MAINNET, TESTNET, SIGNET)\n */\n getNetwork(): Promise<BitcoinNetwork>;\n\n /**\n * Derives a deterministic 32-byte value per\n * `docs/specs/derive-context-hash.md` rev 1.0. Throws with code\n * `WALLET_METHOD_NOT_SUPPORTED` if unimplemented.\n *\n * @returns 64-char lowercase hex (32 bytes).\n */\n deriveContextHash(appName: string, context: string): Promise<string>;\n}\n"],"names":["BitcoinNetworks"],"mappings":"AASO,MAAMA,IAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Framework-agnostic BTC wallet interface. ETH uses viem's `WalletClient` directly.
|
|
3
3
|
*
|
|
4
4
|
* See the [Wallet Interfaces Guide](https://github.com/babylonlabs-io/babylon-toolkit/blob/main/packages/babylon-ts-sdk/docs/guides/wallet-interfaces.md)
|
|
5
|
-
* for adapter patterns and the
|
|
5
|
+
* for adapter patterns and the canonical `deriveContextHash` flow
|
|
6
|
+
* (vault root → WOTS / hashlock / auth-anchor secrets).
|
|
6
7
|
*
|
|
7
8
|
* @module wallets
|
|
8
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/wallets/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/wallets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EACV,cAAc,EACd,aAAa,EACb,IAAI,EACJ,gBAAgB,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC"}
|
|
@@ -118,5 +118,13 @@ export interface BitcoinWallet {
|
|
|
118
118
|
* @returns BitcoinNetwork enum value (MAINNET, TESTNET, SIGNET)
|
|
119
119
|
*/
|
|
120
120
|
getNetwork(): Promise<BitcoinNetwork>;
|
|
121
|
+
/**
|
|
122
|
+
* Derives a deterministic 32-byte value per
|
|
123
|
+
* `docs/specs/derive-context-hash.md` rev 1.0. Throws with code
|
|
124
|
+
* `WALLET_METHOD_NOT_SUPPORTED` if unimplemented.
|
|
125
|
+
*
|
|
126
|
+
* @returns 64-char lowercase hex (32 bytes).
|
|
127
|
+
*/
|
|
128
|
+
deriveContextHash(appName: string, context: string): Promise<string>;
|
|
121
129
|
}
|
|
122
130
|
//# sourceMappingURL=BitcoinWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitcoinWallet.d.ts","sourceRoot":"","sources":["../../../../src/shared/wallets/interfaces/BitcoinWallet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC,sDAAsD;IACtD,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,2BAA2B;QAC3B,EAAE,EAAE,MAAM,CAAC;QACX,2BAA2B;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;KAC/D,CAAC,CAAC;IACH,uBAAuB;IACvB,MAA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