@btc-vision/transaction 1.8.7 → 1.8.8
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/browser/btc-vision-bitcoin.js +495 -491
- package/browser/index.js +58 -50
- package/browser/noble-curves.js +4 -4
- package/browser/noble-hashes.js +88 -88
- package/browser/rolldown-runtime.js +26 -19
- package/browser/src/epoch/validator/EpochValidator.d.ts +28 -6
- package/browser/vendors.js +3065 -3027
- package/build/epoch/validator/EpochValidator.d.ts +28 -6
- package/build/epoch/validator/EpochValidator.js +44 -10
- package/package.json +1 -1
- package/src/epoch/validator/EpochValidator.ts +67 -6
- package/tsconfig.build.tsbuildinfo +1 -1
package/browser/index.js
CHANGED
|
@@ -326,7 +326,7 @@ var or = /^[0-9a-fA-F]+$/, W = class Me {
|
|
|
326
326
|
}
|
|
327
327
|
static createSimpleP2WDAWitness(e, t) {
|
|
328
328
|
const i = [e];
|
|
329
|
-
for (let r = 0; r < 10; r++) i.push(new Uint8Array(0));
|
|
329
|
+
for (let r = 0; r < 10; r++) i.push(/* @__PURE__ */ new Uint8Array(0));
|
|
330
330
|
return i.push(t), i;
|
|
331
331
|
}
|
|
332
332
|
static validateP2WDASignature(e, t, i) {
|
|
@@ -531,7 +531,7 @@ var or = /^[0-9a-fA-F]+$/, W = class Me {
|
|
|
531
531
|
return e < t ? e : t;
|
|
532
532
|
}
|
|
533
533
|
getHybridPublicKey(e, t) {
|
|
534
|
-
const i = t % 2n === 0n ? 6 : 7, r = this.bigIntTo32Bytes(e), s = this.bigIntTo32Bytes(t), n = new Uint8Array(65);
|
|
534
|
+
const i = t % 2n === 0n ? 6 : 7, r = this.bigIntTo32Bytes(e), s = this.bigIntTo32Bytes(t), n = /* @__PURE__ */ new Uint8Array(65);
|
|
535
535
|
return n[0] = i, n.set(r, 1), n.set(s, 33), n;
|
|
536
536
|
}
|
|
537
537
|
isValidX(e) {
|
|
@@ -554,7 +554,7 @@ var or = /^[0-9a-fA-F]+$/, W = class Me {
|
|
|
554
554
|
return t;
|
|
555
555
|
}
|
|
556
556
|
bigIntTo32Bytes(e) {
|
|
557
|
-
const t = new Uint8Array(32);
|
|
557
|
+
const t = /* @__PURE__ */ new Uint8Array(32);
|
|
558
558
|
for (let i = 31; i >= 0; i--)
|
|
559
559
|
t[i] = Number(e & 255n), e >>= 8n;
|
|
560
560
|
return t;
|
|
@@ -692,18 +692,19 @@ var cr = [
|
|
|
692
692
|
return new Y(t);
|
|
693
693
|
}
|
|
694
694
|
static uncompressedToCompressed(t) {
|
|
695
|
-
const i = Uint8Array.from(t), r = i.slice(1, 33), s = i.slice(33), n = new Uint8Array(33);
|
|
695
|
+
const i = Uint8Array.from(t), r = i.slice(1, 33), s = i.slice(33), n = /* @__PURE__ */ new Uint8Array(33);
|
|
696
696
|
return n[0] = 2 + (s[s.length - 1] & 1), n.set(r, 1), n;
|
|
697
697
|
}
|
|
698
698
|
static fromBigInt(t, i) {
|
|
699
|
-
|
|
699
|
+
const r = Y.bigintToUint8Array(t), s = i !== void 0 ? Y.bigintToUint8Array(i) : void 0;
|
|
700
|
+
return new Y(r, s);
|
|
700
701
|
}
|
|
701
702
|
static fromUint64Array(t, i, r, s) {
|
|
702
|
-
const n = new Uint8Array(32), o = new DataView(n.buffer);
|
|
703
|
+
const n = /* @__PURE__ */ new Uint8Array(32), o = new DataView(n.buffer);
|
|
703
704
|
return o.setBigUint64(0, t, !1), o.setBigUint64(8, i, !1), o.setBigUint64(16, r, !1), o.setBigUint64(24, s, !1), new Y(n);
|
|
704
705
|
}
|
|
705
706
|
static bigintToUint8Array(t) {
|
|
706
|
-
const i = new Uint8Array(32), r = new DataView(i.buffer);
|
|
707
|
+
const i = /* @__PURE__ */ new Uint8Array(32), r = new DataView(i.buffer);
|
|
707
708
|
return r.setBigUint64(0, t >> 192n & 18446744073709551615n, !1), r.setBigUint64(8, t >> 128n & 18446744073709551615n, !1), r.setBigUint64(16, t >> 64n & 18446744073709551615n, !1), r.setBigUint64(24, t & 18446744073709551615n, !1), i;
|
|
708
709
|
}
|
|
709
710
|
[Symbol.dispose]() {
|
|
@@ -1619,7 +1620,7 @@ var cr = [
|
|
|
1619
1620
|
super(e, t, i);
|
|
1620
1621
|
}
|
|
1621
1622
|
static getPubKeyAsBuffer(e, t) {
|
|
1622
|
-
let i = new Uint8Array(0);
|
|
1623
|
+
let i = /* @__PURE__ */ new Uint8Array(0);
|
|
1623
1624
|
for (const s of e) {
|
|
1624
1625
|
if (!I.fromPublicKey(s, t).compressed) throw new Error("Public key must be compressed");
|
|
1625
1626
|
if (s.byteLength !== 33) throw new Error(`Public key must be 33 bytes, got ${s.byteLength} bytes.`);
|
|
@@ -1878,10 +1879,10 @@ var cr = [
|
|
|
1878
1879
|
}
|
|
1879
1880
|
}, ur = class extends tt {
|
|
1880
1881
|
constructor(e, t = y.bitcoin) {
|
|
1881
|
-
super(e, new Uint8Array(0), t);
|
|
1882
|
+
super(e, /* @__PURE__ */ new Uint8Array(0), t);
|
|
1882
1883
|
}
|
|
1883
1884
|
static getPubKeyAsBuffer(e, t) {
|
|
1884
|
-
let i = new Uint8Array(0);
|
|
1885
|
+
let i = /* @__PURE__ */ new Uint8Array(0);
|
|
1885
1886
|
for (const s of e) {
|
|
1886
1887
|
if (!I.fromPublicKey(s, t).compressed) throw new Error("Public key must be compressed");
|
|
1887
1888
|
if (s.byteLength !== 33) throw new Error(`Public key must be 33 bytes, got ${s.byteLength} bytes.`);
|
|
@@ -1976,7 +1977,7 @@ var cr = [
|
|
|
1976
1977
|
}
|
|
1977
1978
|
};
|
|
1978
1979
|
function It(e) {
|
|
1979
|
-
let t = new Uint8Array(0);
|
|
1980
|
+
let t = /* @__PURE__ */ new Uint8Array(0);
|
|
1980
1981
|
function i(a, c) {
|
|
1981
1982
|
const u = new Uint8Array(a.length + c.length);
|
|
1982
1983
|
return u.set(a, 0), u.set(c, a.length), u;
|
|
@@ -2065,7 +2066,7 @@ var Ut = g("50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0"),
|
|
|
2065
2066
|
}
|
|
2066
2067
|
static buildDummyWitness(e) {
|
|
2067
2068
|
const { config: t, tapscript: i, controlBlock: r } = e, s = [];
|
|
2068
|
-
for (let n = 0; n < t.pubkeys.length; n++) t.pubkeys.length - 1 - n < t.threshold ? s.push(new Uint8Array(64)) : s.push(new Uint8Array(0));
|
|
2069
|
+
for (let n = 0; n < t.pubkeys.length; n++) t.pubkeys.length - 1 - n < t.threshold ? s.push(/* @__PURE__ */ new Uint8Array(64)) : s.push(/* @__PURE__ */ new Uint8Array(0));
|
|
2069
2070
|
return s.push(i), s.push(r), s;
|
|
2070
2071
|
}
|
|
2071
2072
|
static buildFinalWitnessFromTapScriptSigs(e, t) {
|
|
@@ -2079,7 +2080,7 @@ var Ut = g("50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0"),
|
|
|
2079
2080
|
if (l) {
|
|
2080
2081
|
if (l.length !== 64 && l.length !== 65) throw new Error(`Invalid Schnorr signature length ${l.length} for CSV multisig spend`);
|
|
2081
2082
|
o.push(l), a++;
|
|
2082
|
-
} else o.push(new Uint8Array(0));
|
|
2083
|
+
} else o.push(/* @__PURE__ */ new Uint8Array(0));
|
|
2083
2084
|
}
|
|
2084
2085
|
if (a < i.threshold) throw new Error(`CSV multisig spend needs ${i.threshold} signatures, got ${a}`);
|
|
2085
2086
|
const c = [];
|
|
@@ -2409,7 +2410,7 @@ var Tt = /* @__PURE__ */ (function(e) {
|
|
|
2409
2410
|
else if (c.length === h) p = c.subarray(0, l);
|
|
2410
2411
|
else throw new Error(`Invalid ML-DSA key length for security level ${s}. Expected ${l} bytes (private only) or ${h} bytes (private+public), got ${c.length} bytes.`);
|
|
2411
2412
|
if (n && n.length !== 32) throw new Error("Chain code must be 32 bytes");
|
|
2412
|
-
this._chainCode = n || new Uint8Array(32), this._mldsaKeypair = v.QuantumBIP32Factory.fromPrivateKey(p, this._chainCode, this.network, s);
|
|
2413
|
+
this._chainCode = n || /* @__PURE__ */ new Uint8Array(32), this._mldsaKeypair = v.QuantumBIP32Factory.fromPrivateKey(p, this._chainCode, this.network, s);
|
|
2413
2414
|
} else
|
|
2414
2415
|
this._mldsaKeypair = v.QuantumBIP32Factory.fromBase58(a), this._chainCode = new Uint8Array(this._mldsaKeypair.chainCode), this._securityLevel = this._mldsaKeypair.securityLevel;
|
|
2415
2416
|
this._bufferPubKey = this._keypair.publicKey, this._address = new z(this._mldsaKeypair.publicKey, this._keypair.publicKey), this._p2tr = this._address.p2tr(this.network), this._p2wpkh = this._address.p2wpkh(this.network), this._legacy = this._address.p2pkh(this.network), this._segwitLegacy = this._address.p2shp2wpkh(this.network), this._p2wda = this._address.p2wda(this.network), this._tweakedKey = this._address.tweakedPublicKeyToBuffer();
|
|
@@ -2566,7 +2567,8 @@ var gr = (0, v.BIP32Factory)(K), Sr = class je {
|
|
|
2566
2567
|
return mt.generateMnemonic(t);
|
|
2567
2568
|
}
|
|
2568
2569
|
static generate(t = ee.MAXIMUM, i = "", r = y.bitcoin, s = v.MLDSASecurityLevel.LEVEL2) {
|
|
2569
|
-
|
|
2570
|
+
const n = mt.generateMnemonic(t);
|
|
2571
|
+
return new je(n, i, r, s);
|
|
2570
2572
|
}
|
|
2571
2573
|
static validate(t) {
|
|
2572
2574
|
return mt.validateMnemonic(t);
|
|
@@ -3777,7 +3779,7 @@ var ke = new Uint8Array([
|
|
|
3777
3779
|
await Promise.resolve();
|
|
3778
3780
|
const t = new N({ network: this.network }), i = this.getInputs(), r = this.getOutputs();
|
|
3779
3781
|
t.addInputs(i), t.addOutputs(r);
|
|
3780
|
-
const s = new Uint8Array(64), n = new Uint8Array(72), o = new Uint8Array(33).fill(2), a = (h, p) => {
|
|
3782
|
+
const s = /* @__PURE__ */ new Uint8Array(64), n = /* @__PURE__ */ new Uint8Array(72), o = (/* @__PURE__ */ new Uint8Array(33)).fill(2), a = (h, p) => {
|
|
3781
3783
|
if (p.isPayToAnchor || this.anchorInputIndices.has(h)) return {
|
|
3782
3784
|
finalScriptSig: void 0,
|
|
3783
3785
|
finalScriptWitness: Uint8Array.from([0])
|
|
@@ -3786,8 +3788,8 @@ var ke = new Uint8Array([
|
|
|
3786
3788
|
if (w) return { finalScriptWitness: R.witnessStackToScriptWitness(rt.buildDummyWitness(w)) };
|
|
3787
3789
|
if (p.witnessScript && X.isP2WDAWitnessScript(p.witnessScript)) {
|
|
3788
3790
|
const A = [];
|
|
3789
|
-
for (let x = 0; x < 10; x++) A.push(new Uint8Array(0));
|
|
3790
|
-
const k = new Uint8Array(72);
|
|
3791
|
+
for (let x = 0; x < 10; x++) A.push(/* @__PURE__ */ new Uint8Array(0));
|
|
3792
|
+
const k = /* @__PURE__ */ new Uint8Array(72);
|
|
3791
3793
|
return { finalScriptWitness: R.witnessStackToScriptWitness([
|
|
3792
3794
|
...A,
|
|
3793
3795
|
k,
|
|
@@ -3795,7 +3797,7 @@ var ke = new Uint8Array([
|
|
|
3795
3797
|
]) };
|
|
3796
3798
|
}
|
|
3797
3799
|
if (h === 0 && this.tapLeafScript) {
|
|
3798
|
-
const A = new Uint8Array(32), k = this.tapLeafScript.script, x = this.useP2MR ? 33 : 65, yt = new Uint8Array(x);
|
|
3800
|
+
const A = /* @__PURE__ */ new Uint8Array(32), k = this.tapLeafScript.script, x = this.useP2MR ? 33 : 65, yt = new Uint8Array(x);
|
|
3799
3801
|
return { finalScriptWitness: R.witnessStackToScriptWitness([
|
|
3800
3802
|
A,
|
|
3801
3803
|
s,
|
|
@@ -3827,7 +3829,7 @@ var ke = new Uint8Array([
|
|
|
3827
3829
|
const yt = k - d.OP_1 + 1, be = [];
|
|
3828
3830
|
for (let Ee = 0; Ee < yt; Ee++) be.push(n);
|
|
3829
3831
|
return { finalScriptWitness: R.witnessStackToScriptWitness([
|
|
3830
|
-
new Uint8Array(0),
|
|
3832
|
+
/* @__PURE__ */ new Uint8Array(0),
|
|
3831
3833
|
...be,
|
|
3832
3834
|
p.witnessScript
|
|
3833
3835
|
]) };
|
|
@@ -4745,7 +4747,7 @@ var ke = new Uint8Array([
|
|
|
4745
4747
|
const r = i.partialSig[0].signature, s = ht([r, this.compiledOperationData]), n = st.signMessage(this.signer, s).signature, o = ht([n, this.compiledOperationData]), a = Z.compress(o), c = this.splitIntoWitnessChunks(a);
|
|
4746
4748
|
if (c.length > lt.MAX_WITNESS_FIELDS) throw new Error(`Compressed data needs ${c.length} witness fields, max is ${lt.MAX_WITNESS_FIELDS}`);
|
|
4747
4749
|
const u = [r];
|
|
4748
|
-
for (let l = 0; l < lt.MAX_WITNESS_FIELDS; l++) u.push(l < c.length ? c[l] : new Uint8Array(0));
|
|
4750
|
+
for (let l = 0; l < lt.MAX_WITNESS_FIELDS; l++) u.push(l < c.length ? c[l] : /* @__PURE__ */ new Uint8Array(0));
|
|
4749
4751
|
return u.push(i.witnessScript), {
|
|
4750
4752
|
finalScriptSig: void 0,
|
|
4751
4753
|
finalScriptWitness: B.witnessStackToScriptWitness(u)
|
|
@@ -4773,8 +4775,8 @@ var ke = new Uint8Array([
|
|
|
4773
4775
|
gasSatFee: 1n,
|
|
4774
4776
|
isCancellation: !0,
|
|
4775
4777
|
priorityFee: 1n,
|
|
4776
|
-
calldata: new Uint8Array(0)
|
|
4777
|
-
}), this.contractSecret = new Uint8Array(0), e.compiledTargetScript instanceof Uint8Array ? this.compiledTargetScript = e.compiledTargetScript : this.compiledTargetScript = g(e.compiledTargetScript), this.scriptTree = this.getMinimalScriptTree(), this.internalInit();
|
|
4778
|
+
calldata: /* @__PURE__ */ new Uint8Array(0)
|
|
4779
|
+
}), this.contractSecret = /* @__PURE__ */ new Uint8Array(0), e.compiledTargetScript instanceof Uint8Array ? this.compiledTargetScript = e.compiledTargetScript : this.compiledTargetScript = g(e.compiledTargetScript), this.scriptTree = this.getMinimalScriptTree(), this.internalInit();
|
|
4778
4780
|
}
|
|
4779
4781
|
async buildTransaction() {
|
|
4780
4782
|
if (!this.from) throw new Error("From address is required");
|
|
@@ -5043,7 +5045,7 @@ var ke = new Uint8Array([
|
|
|
5043
5045
|
}
|
|
5044
5046
|
}, ni = class {
|
|
5045
5047
|
debug = !1;
|
|
5046
|
-
DUMMY_PUBKEY = new Uint8Array(32).fill(1);
|
|
5048
|
+
DUMMY_PUBKEY = (/* @__PURE__ */ new Uint8Array(32)).fill(1);
|
|
5047
5049
|
P2TR_SCRIPT = Uint8Array.from([
|
|
5048
5050
|
81,
|
|
5049
5051
|
32,
|
|
@@ -5385,7 +5387,7 @@ var ke = new Uint8Array([
|
|
|
5385
5387
|
const h = new Xt();
|
|
5386
5388
|
h.addOutput(this.P2TR_SCRIPT, L(o));
|
|
5387
5389
|
const p = {
|
|
5388
|
-
transactionId: f(new Uint8Array(32)),
|
|
5390
|
+
transactionId: f(/* @__PURE__ */ new Uint8Array(32)),
|
|
5389
5391
|
outputIndex: 0,
|
|
5390
5392
|
scriptPubKey: {
|
|
5391
5393
|
hex: f(this.P2TR_SCRIPT),
|
|
@@ -5545,7 +5547,7 @@ var ke = new Uint8Array([
|
|
|
5545
5547
|
for (const u of s) {
|
|
5546
5548
|
let l = !1;
|
|
5547
5549
|
for (const h of i.tapScriptSig) C(h.pubkey, O(u)) && (o.push(h.signature), l = !0);
|
|
5548
|
-
l || o.push(new Uint8Array(0));
|
|
5550
|
+
l || o.push(/* @__PURE__ */ new Uint8Array(0));
|
|
5549
5551
|
}
|
|
5550
5552
|
o = o.reverse();
|
|
5551
5553
|
}
|
|
@@ -6369,11 +6371,17 @@ var wt = class {
|
|
|
6369
6371
|
static sha1(e) {
|
|
6370
6372
|
return D.sha1(e);
|
|
6371
6373
|
}
|
|
6372
|
-
static calculatePreimage(e, t, i) {
|
|
6374
|
+
static calculatePreimage(e, t, i, r = !1) {
|
|
6373
6375
|
if (e.length !== 32 || t.length !== 32 || i.length !== 32) throw new Error("All inputs must be 32 bytes");
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6376
|
+
if (r) return this.concatenatePreimage(e, t, i);
|
|
6377
|
+
const s = /* @__PURE__ */ new Uint8Array(32);
|
|
6378
|
+
for (let n = 0; n < 32; n++) s[n] = e[n] ^ t[n] ^ i[n];
|
|
6379
|
+
return s;
|
|
6380
|
+
}
|
|
6381
|
+
static concatenatePreimage(e, t, i) {
|
|
6382
|
+
if (e.length !== 32 || t.length !== 32 || i.length !== 32) throw new Error("All inputs must be 32 bytes");
|
|
6383
|
+
const r = /* @__PURE__ */ new Uint8Array(96);
|
|
6384
|
+
return r.set(e, 0), r.set(t, 32), r.set(i, 64), r;
|
|
6377
6385
|
}
|
|
6378
6386
|
static countMatchingBits(e, t) {
|
|
6379
6387
|
let i = 0;
|
|
@@ -6387,43 +6395,43 @@ var wt = class {
|
|
|
6387
6395
|
}
|
|
6388
6396
|
return i;
|
|
6389
6397
|
}
|
|
6390
|
-
static verifySolution(e, t = !1) {
|
|
6398
|
+
static verifySolution(e, t = !1, i = !1) {
|
|
6391
6399
|
try {
|
|
6392
|
-
const
|
|
6393
|
-
if (!C(
|
|
6394
|
-
const
|
|
6395
|
-
return !(
|
|
6396
|
-
} catch (
|
|
6397
|
-
return t && console.error("Verification error:",
|
|
6400
|
+
const r = e.verification, s = this.calculatePreimage(r.targetChecksum, e.publicKey.toBuffer(), e.salt, i), n = this.sha1(s);
|
|
6401
|
+
if (!C(n, e.solution) || this.countMatchingBits(n, r.targetHash) !== e.difficulty) return !1;
|
|
6402
|
+
const o = e.epochNumber * this.BLOCKS_PER_EPOCH, a = o + this.BLOCKS_PER_EPOCH - 1n;
|
|
6403
|
+
return !(r.startBlock !== o || r.endBlock !== a);
|
|
6404
|
+
} catch (r) {
|
|
6405
|
+
return t && console.error("Verification error:", r), !1;
|
|
6398
6406
|
}
|
|
6399
6407
|
}
|
|
6400
6408
|
static getMiningTargetBlock(e) {
|
|
6401
6409
|
return e === 0n ? null : e * this.BLOCKS_PER_EPOCH - 1n;
|
|
6402
6410
|
}
|
|
6403
|
-
static validateEpochWinner(e) {
|
|
6411
|
+
static validateEpochWinner(e, t = !1) {
|
|
6404
6412
|
try {
|
|
6405
|
-
const
|
|
6413
|
+
const i = BigInt(e.epochNumber), r = z.fromString(e.mldsaPublicKey, e.legacyPublicKey), s = M(e.solution), n = M(e.salt), o = e.difficulty, a = {
|
|
6406
6414
|
epochHash: M(e.verification.epochHash),
|
|
6407
6415
|
epochRoot: M(e.verification.epochRoot),
|
|
6408
6416
|
targetHash: M(e.verification.targetHash),
|
|
6409
6417
|
targetChecksum: M(e.verification.targetChecksum),
|
|
6410
6418
|
startBlock: BigInt(e.verification.startBlock),
|
|
6411
6419
|
endBlock: BigInt(e.verification.endBlock),
|
|
6412
|
-
proofs: Object.freeze(e.verification.proofs.map((
|
|
6413
|
-
},
|
|
6414
|
-
if (!C(
|
|
6415
|
-
const
|
|
6416
|
-
return !(
|
|
6420
|
+
proofs: Object.freeze(e.verification.proofs.map((p) => M(p)))
|
|
6421
|
+
}, c = this.calculatePreimage(a.targetChecksum, r.toBuffer(), n, t), u = this.sha1(c);
|
|
6422
|
+
if (!C(u, s) || this.countMatchingBits(u, a.targetHash) !== o) return !1;
|
|
6423
|
+
const l = i * this.BLOCKS_PER_EPOCH, h = l + this.BLOCKS_PER_EPOCH - 1n;
|
|
6424
|
+
return !(a.startBlock !== l || a.endBlock !== h);
|
|
6417
6425
|
} catch {
|
|
6418
6426
|
return !1;
|
|
6419
6427
|
}
|
|
6420
6428
|
}
|
|
6421
|
-
static validateChallengeSolution(e) {
|
|
6422
|
-
return this.verifySolution(e);
|
|
6429
|
+
static validateChallengeSolution(e, t = !1) {
|
|
6430
|
+
return this.verifySolution(e, !1, t);
|
|
6423
6431
|
}
|
|
6424
|
-
static calculateSolution(e, t, i) {
|
|
6425
|
-
const
|
|
6426
|
-
return this.sha1(
|
|
6432
|
+
static calculateSolution(e, t, i, r = !1) {
|
|
6433
|
+
const s = this.calculatePreimage(e, t, i, r);
|
|
6434
|
+
return this.sha1(s);
|
|
6427
6435
|
}
|
|
6428
6436
|
static checkDifficulty(e, t, i) {
|
|
6429
6437
|
const r = this.countMatchingBits(e, t);
|
|
@@ -7764,7 +7772,7 @@ var zr = class extends we {
|
|
|
7764
7772
|
return !0;
|
|
7765
7773
|
}
|
|
7766
7774
|
getBytes(t) {
|
|
7767
|
-
return t instanceof ArrayBuffer ? new Uint8Array(t) : ArrayBuffer.isView(t) ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength) : new Uint8Array(0);
|
|
7775
|
+
return t instanceof ArrayBuffer ? new Uint8Array(t) : ArrayBuffer.isView(t) ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength) : /* @__PURE__ */ new Uint8Array(0);
|
|
7768
7776
|
}
|
|
7769
7777
|
findIndex(t) {
|
|
7770
7778
|
let i = this.hash(t);
|
package/browser/noble-curves.js
CHANGED
|
@@ -418,8 +418,8 @@ var St, Qt, Jt, Pt, bt, wt, _t, Ht, ze, Me, Ge, Ke, Xe, We, qn = dt((() => {
|
|
|
418
418
|
process(t, e) {
|
|
419
419
|
for (let f = 0; f < 16; f++, e += 4) st[f] = t.getUint32(e, !1);
|
|
420
420
|
for (let f = 16; f < 64; f++) {
|
|
421
|
-
const g = st[f - 15], m = st[f - 2], w = nt(g, 7) ^ nt(g, 18) ^ g >>> 3;
|
|
422
|
-
st[f] =
|
|
421
|
+
const g = st[f - 15], m = st[f - 2], w = nt(g, 7) ^ nt(g, 18) ^ g >>> 3, A = nt(m, 17) ^ nt(m, 19) ^ m >>> 10;
|
|
422
|
+
st[f] = A + st[f - 7] + w + st[f - 16] | 0;
|
|
423
423
|
}
|
|
424
424
|
let { A: r, B: n, C: o, D: i, E: c, F: s, G: a, H: u } = this;
|
|
425
425
|
for (let f = 0; f < 64; f++) {
|
|
@@ -571,8 +571,8 @@ var St, Qt, Jt, Pt, bt, wt, _t, Ht, ze, Me, Ge, Ke, Xe, We, qn = dt((() => {
|
|
|
571
571
|
for (let x = 0; x < 16; x++, e += 4)
|
|
572
572
|
ct[x] = t.getUint32(e), ft[x] = t.getUint32(e += 4);
|
|
573
573
|
for (let x = 16; x < 80; x++) {
|
|
574
|
-
const q = ct[x - 15] | 0, Z = ft[x - 15] | 0, T = bt(q, Z, 1) ^ bt(q, Z, 8) ^ Jt(q, Z, 7), Q = wt(q, Z, 1) ^ wt(q, Z, 8) ^ Pt(q, Z, 7), $ = ct[x - 2] | 0, R = ft[x - 2] | 0, C = bt($, R, 19) ^ _t($, R, 61) ^ Jt($, R, 6), X = wt($, R, 19) ^ Ht($, R, 61) ^ Pt($, R, 6), F = Ge(Q, X, ft[x - 7], ft[x - 16]);
|
|
575
|
-
ct[x] =
|
|
574
|
+
const q = ct[x - 15] | 0, Z = ft[x - 15] | 0, T = bt(q, Z, 1) ^ bt(q, Z, 8) ^ Jt(q, Z, 7), Q = wt(q, Z, 1) ^ wt(q, Z, 8) ^ Pt(q, Z, 7), $ = ct[x - 2] | 0, R = ft[x - 2] | 0, C = bt($, R, 19) ^ _t($, R, 61) ^ Jt($, R, 6), X = wt($, R, 19) ^ Ht($, R, 61) ^ Pt($, R, 6), F = Ge(Q, X, ft[x - 7], ft[x - 16]), h = Ke(F, T, C, ct[x - 7], ct[x - 16]);
|
|
575
|
+
ct[x] = h | 0, ft[x] = F | 0;
|
|
576
576
|
}
|
|
577
577
|
let { Ah: r, Al: n, Bh: o, Bl: i, Ch: c, Cl: s, Dh: a, Dl: u, Eh: f, El: g, Fh: m, Fl: w, Gh: A, Gl: _, Hh: H, Hl: O } = this;
|
|
578
578
|
for (let x = 0; x < 80; x++) {
|