@settlemint/sdk-mcp 2.2.3-prf12d764a → 2.2.3-prf8d0b522
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/mcp.js +451 -573
- package/dist/mcp.js.map +24 -22
- package/package.json +4 -4
package/dist/mcp.js
CHANGED
|
@@ -29422,54 +29422,21 @@ var require_webcrypto = __commonJS((exports) => {
|
|
|
29422
29422
|
exports.gcm = /* @__PURE__ */ (() => generate(mode.GCM))();
|
|
29423
29423
|
});
|
|
29424
29424
|
|
|
29425
|
-
// ../../node_modules/eciesjs/node_modules/@noble/hashes/
|
|
29426
|
-
var
|
|
29425
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_assert.js
|
|
29426
|
+
var require__assert = __commonJS((exports) => {
|
|
29427
29427
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29428
|
-
exports.crypto = undefined;
|
|
29429
|
-
var nc = __require("node:crypto");
|
|
29430
|
-
exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
|
|
29431
|
-
});
|
|
29432
|
-
|
|
29433
|
-
// ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
|
|
29434
|
-
var require_utils7 = __commonJS((exports) => {
|
|
29435
|
-
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
29436
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29437
|
-
exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = undefined;
|
|
29438
|
-
exports.isBytes = isBytes;
|
|
29439
29428
|
exports.anumber = anumber;
|
|
29440
29429
|
exports.abytes = abytes;
|
|
29441
29430
|
exports.ahash = ahash;
|
|
29442
29431
|
exports.aexists = aexists;
|
|
29443
29432
|
exports.aoutput = aoutput;
|
|
29444
|
-
exports.u8 = u8;
|
|
29445
|
-
exports.u32 = u32;
|
|
29446
|
-
exports.clean = clean;
|
|
29447
|
-
exports.createView = createView;
|
|
29448
|
-
exports.rotr = rotr;
|
|
29449
|
-
exports.rotl = rotl;
|
|
29450
|
-
exports.byteSwap = byteSwap;
|
|
29451
|
-
exports.byteSwap32 = byteSwap32;
|
|
29452
|
-
exports.bytesToHex = bytesToHex;
|
|
29453
|
-
exports.hexToBytes = hexToBytes;
|
|
29454
|
-
exports.asyncLoop = asyncLoop;
|
|
29455
|
-
exports.utf8ToBytes = utf8ToBytes;
|
|
29456
|
-
exports.bytesToUtf8 = bytesToUtf8;
|
|
29457
|
-
exports.toBytes = toBytes;
|
|
29458
|
-
exports.kdfInputToBytes = kdfInputToBytes;
|
|
29459
|
-
exports.concatBytes = concatBytes;
|
|
29460
|
-
exports.checkOpts = checkOpts;
|
|
29461
|
-
exports.createHasher = createHasher;
|
|
29462
|
-
exports.createOptHasher = createOptHasher;
|
|
29463
|
-
exports.createXOFer = createXOFer;
|
|
29464
|
-
exports.randomBytes = randomBytes;
|
|
29465
|
-
var crypto_1 = require_cryptoNode2();
|
|
29466
|
-
function isBytes(a) {
|
|
29467
|
-
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
29468
|
-
}
|
|
29469
29433
|
function anumber(n) {
|
|
29470
29434
|
if (!Number.isSafeInteger(n) || n < 0)
|
|
29471
29435
|
throw new Error("positive integer expected, got " + n);
|
|
29472
29436
|
}
|
|
29437
|
+
function isBytes(a) {
|
|
29438
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
29439
|
+
}
|
|
29473
29440
|
function abytes(b, ...lengths) {
|
|
29474
29441
|
if (!isBytes(b))
|
|
29475
29442
|
throw new Error("Uint8Array expected");
|
|
@@ -29478,7 +29445,7 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29478
29445
|
}
|
|
29479
29446
|
function ahash(h) {
|
|
29480
29447
|
if (typeof h !== "function" || typeof h.create !== "function")
|
|
29481
|
-
throw new Error("Hash should be wrapped by utils.
|
|
29448
|
+
throw new Error("Hash should be wrapped by utils.wrapConstructor");
|
|
29482
29449
|
anumber(h.outputLen);
|
|
29483
29450
|
anumber(h.blockLen);
|
|
29484
29451
|
}
|
|
@@ -29495,17 +29462,51 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29495
29462
|
throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
29496
29463
|
}
|
|
29497
29464
|
}
|
|
29465
|
+
});
|
|
29466
|
+
|
|
29467
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
|
|
29468
|
+
var require_cryptoNode2 = __commonJS((exports) => {
|
|
29469
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29470
|
+
exports.crypto = undefined;
|
|
29471
|
+
var nc = __require("node:crypto");
|
|
29472
|
+
exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
|
|
29473
|
+
});
|
|
29474
|
+
|
|
29475
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
|
|
29476
|
+
var require_utils7 = __commonJS((exports) => {
|
|
29477
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
29478
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29479
|
+
exports.Hash = exports.nextTick = exports.byteSwapIfBE = exports.isLE = undefined;
|
|
29480
|
+
exports.isBytes = isBytes;
|
|
29481
|
+
exports.u8 = u8;
|
|
29482
|
+
exports.u32 = u32;
|
|
29483
|
+
exports.createView = createView;
|
|
29484
|
+
exports.rotr = rotr;
|
|
29485
|
+
exports.rotl = rotl;
|
|
29486
|
+
exports.byteSwap = byteSwap;
|
|
29487
|
+
exports.byteSwap32 = byteSwap32;
|
|
29488
|
+
exports.bytesToHex = bytesToHex;
|
|
29489
|
+
exports.hexToBytes = hexToBytes;
|
|
29490
|
+
exports.asyncLoop = asyncLoop;
|
|
29491
|
+
exports.utf8ToBytes = utf8ToBytes;
|
|
29492
|
+
exports.toBytes = toBytes;
|
|
29493
|
+
exports.concatBytes = concatBytes;
|
|
29494
|
+
exports.checkOpts = checkOpts;
|
|
29495
|
+
exports.wrapConstructor = wrapConstructor;
|
|
29496
|
+
exports.wrapConstructorWithOpts = wrapConstructorWithOpts;
|
|
29497
|
+
exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;
|
|
29498
|
+
exports.randomBytes = randomBytes;
|
|
29499
|
+
var crypto_1 = require_cryptoNode2();
|
|
29500
|
+
var _assert_ts_1 = require__assert();
|
|
29501
|
+
function isBytes(a) {
|
|
29502
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
29503
|
+
}
|
|
29498
29504
|
function u8(arr) {
|
|
29499
29505
|
return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
29500
29506
|
}
|
|
29501
29507
|
function u32(arr) {
|
|
29502
29508
|
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
29503
29509
|
}
|
|
29504
|
-
function clean(...arrays) {
|
|
29505
|
-
for (let i = 0;i < arrays.length; i++) {
|
|
29506
|
-
arrays[i].fill(0);
|
|
29507
|
-
}
|
|
29508
|
-
}
|
|
29509
29510
|
function createView(arr) {
|
|
29510
29511
|
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
29511
29512
|
}
|
|
@@ -29519,19 +29520,16 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29519
29520
|
function byteSwap(word) {
|
|
29520
29521
|
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
|
29521
29522
|
}
|
|
29522
|
-
exports.
|
|
29523
|
-
exports.byteSwapIfBE = exports.swap8IfBE;
|
|
29523
|
+
exports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => byteSwap(n);
|
|
29524
29524
|
function byteSwap32(arr) {
|
|
29525
29525
|
for (let i = 0;i < arr.length; i++) {
|
|
29526
29526
|
arr[i] = byteSwap(arr[i]);
|
|
29527
29527
|
}
|
|
29528
|
-
return arr;
|
|
29529
29528
|
}
|
|
29530
|
-
|
|
29531
|
-
var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
|
|
29529
|
+
var hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
|
|
29532
29530
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
29533
29531
|
function bytesToHex(bytes) {
|
|
29534
|
-
abytes(bytes);
|
|
29532
|
+
(0, _assert_ts_1.abytes)(bytes);
|
|
29535
29533
|
if (hasHexBuiltin)
|
|
29536
29534
|
return bytes.toHex();
|
|
29537
29535
|
let hex = "";
|
|
@@ -29586,29 +29584,20 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29586
29584
|
}
|
|
29587
29585
|
function utf8ToBytes(str) {
|
|
29588
29586
|
if (typeof str !== "string")
|
|
29589
|
-
throw new Error("string
|
|
29587
|
+
throw new Error("utf8ToBytes expected string, got " + typeof str);
|
|
29590
29588
|
return new Uint8Array(new TextEncoder().encode(str));
|
|
29591
29589
|
}
|
|
29592
|
-
function bytesToUtf8(bytes) {
|
|
29593
|
-
return new TextDecoder().decode(bytes);
|
|
29594
|
-
}
|
|
29595
29590
|
function toBytes(data) {
|
|
29596
29591
|
if (typeof data === "string")
|
|
29597
29592
|
data = utf8ToBytes(data);
|
|
29598
|
-
abytes(data);
|
|
29599
|
-
return data;
|
|
29600
|
-
}
|
|
29601
|
-
function kdfInputToBytes(data) {
|
|
29602
|
-
if (typeof data === "string")
|
|
29603
|
-
data = utf8ToBytes(data);
|
|
29604
|
-
abytes(data);
|
|
29593
|
+
(0, _assert_ts_1.abytes)(data);
|
|
29605
29594
|
return data;
|
|
29606
29595
|
}
|
|
29607
29596
|
function concatBytes(...arrays) {
|
|
29608
29597
|
let sum = 0;
|
|
29609
29598
|
for (let i = 0;i < arrays.length; i++) {
|
|
29610
29599
|
const a = arrays[i];
|
|
29611
|
-
abytes(a);
|
|
29600
|
+
(0, _assert_ts_1.abytes)(a);
|
|
29612
29601
|
sum += a.length;
|
|
29613
29602
|
}
|
|
29614
29603
|
const res = new Uint8Array(sum);
|
|
@@ -29619,17 +29608,20 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29619
29608
|
}
|
|
29620
29609
|
return res;
|
|
29621
29610
|
}
|
|
29611
|
+
|
|
29612
|
+
class Hash {
|
|
29613
|
+
clone() {
|
|
29614
|
+
return this._cloneInto();
|
|
29615
|
+
}
|
|
29616
|
+
}
|
|
29617
|
+
exports.Hash = Hash;
|
|
29622
29618
|
function checkOpts(defaults, opts) {
|
|
29623
29619
|
if (opts !== undefined && {}.toString.call(opts) !== "[object Object]")
|
|
29624
|
-
throw new Error("
|
|
29620
|
+
throw new Error("Options should be object or undefined");
|
|
29625
29621
|
const merged = Object.assign(defaults, opts);
|
|
29626
29622
|
return merged;
|
|
29627
29623
|
}
|
|
29628
|
-
|
|
29629
|
-
class Hash {
|
|
29630
|
-
}
|
|
29631
|
-
exports.Hash = Hash;
|
|
29632
|
-
function createHasher(hashCons) {
|
|
29624
|
+
function wrapConstructor(hashCons) {
|
|
29633
29625
|
const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
|
|
29634
29626
|
const tmp = hashCons();
|
|
29635
29627
|
hashC.outputLen = tmp.outputLen;
|
|
@@ -29637,7 +29629,7 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29637
29629
|
hashC.create = () => hashCons();
|
|
29638
29630
|
return hashC;
|
|
29639
29631
|
}
|
|
29640
|
-
function
|
|
29632
|
+
function wrapConstructorWithOpts(hashCons) {
|
|
29641
29633
|
const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
|
|
29642
29634
|
const tmp = hashCons({});
|
|
29643
29635
|
hashC.outputLen = tmp.outputLen;
|
|
@@ -29645,7 +29637,7 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29645
29637
|
hashC.create = (opts) => hashCons(opts);
|
|
29646
29638
|
return hashC;
|
|
29647
29639
|
}
|
|
29648
|
-
function
|
|
29640
|
+
function wrapXOFConstructorWithOpts(hashCons) {
|
|
29649
29641
|
const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
|
|
29650
29642
|
const tmp = hashCons({});
|
|
29651
29643
|
hashC.outputLen = tmp.outputLen;
|
|
@@ -29653,9 +29645,6 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29653
29645
|
hashC.create = (opts) => hashCons(opts);
|
|
29654
29646
|
return hashC;
|
|
29655
29647
|
}
|
|
29656
|
-
exports.wrapConstructor = createHasher;
|
|
29657
|
-
exports.wrapConstructorWithOpts = createOptHasher;
|
|
29658
|
-
exports.wrapXOFConstructorWithOpts = createXOFer;
|
|
29659
29648
|
function randomBytes(bytesLength = 32) {
|
|
29660
29649
|
if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
|
|
29661
29650
|
return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
|
|
@@ -29670,10 +29659,11 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
29670
29659
|
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_md.js
|
|
29671
29660
|
var require__md = __commonJS((exports) => {
|
|
29672
29661
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29673
|
-
exports.
|
|
29662
|
+
exports.HashMD = undefined;
|
|
29674
29663
|
exports.setBigUint64 = setBigUint64;
|
|
29675
29664
|
exports.Chi = Chi;
|
|
29676
29665
|
exports.Maj = Maj;
|
|
29666
|
+
var _assert_ts_1 = require__assert();
|
|
29677
29667
|
var utils_ts_1 = require_utils7();
|
|
29678
29668
|
function setBigUint64(view, byteOffset, value, isLE) {
|
|
29679
29669
|
if (typeof view.setBigUint64 === "function")
|
|
@@ -29709,10 +29699,9 @@ var require__md = __commonJS((exports) => {
|
|
|
29709
29699
|
this.view = (0, utils_ts_1.createView)(this.buffer);
|
|
29710
29700
|
}
|
|
29711
29701
|
update(data) {
|
|
29712
|
-
(0,
|
|
29713
|
-
data = (0, utils_ts_1.toBytes)(data);
|
|
29714
|
-
(0, utils_ts_1.abytes)(data);
|
|
29702
|
+
(0, _assert_ts_1.aexists)(this);
|
|
29715
29703
|
const { view, buffer, blockLen } = this;
|
|
29704
|
+
data = (0, utils_ts_1.toBytes)(data);
|
|
29716
29705
|
const len = data.length;
|
|
29717
29706
|
for (let pos = 0;pos < len; ) {
|
|
29718
29707
|
const take = Math.min(blockLen - this.pos, len - pos);
|
|
@@ -29735,13 +29724,13 @@ var require__md = __commonJS((exports) => {
|
|
|
29735
29724
|
return this;
|
|
29736
29725
|
}
|
|
29737
29726
|
digestInto(out) {
|
|
29738
|
-
(0,
|
|
29739
|
-
(0,
|
|
29727
|
+
(0, _assert_ts_1.aexists)(this);
|
|
29728
|
+
(0, _assert_ts_1.aoutput)(out, this);
|
|
29740
29729
|
this.finished = true;
|
|
29741
29730
|
const { buffer, view, blockLen, isLE } = this;
|
|
29742
29731
|
let { pos } = this;
|
|
29743
29732
|
buffer[pos++] = 128;
|
|
29744
|
-
|
|
29733
|
+
this.buffer.subarray(pos).fill(0);
|
|
29745
29734
|
if (this.padOffset > blockLen - pos) {
|
|
29746
29735
|
this.process(view, 0);
|
|
29747
29736
|
pos = 0;
|
|
@@ -29772,178 +29761,25 @@ var require__md = __commonJS((exports) => {
|
|
|
29772
29761
|
to || (to = new this.constructor);
|
|
29773
29762
|
to.set(...this.get());
|
|
29774
29763
|
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
29775
|
-
to.destroyed = destroyed;
|
|
29776
|
-
to.finished = finished;
|
|
29777
29764
|
to.length = length;
|
|
29778
29765
|
to.pos = pos;
|
|
29766
|
+
to.finished = finished;
|
|
29767
|
+
to.destroyed = destroyed;
|
|
29779
29768
|
if (length % blockLen)
|
|
29780
29769
|
to.buffer.set(buffer);
|
|
29781
29770
|
return to;
|
|
29782
29771
|
}
|
|
29783
|
-
clone() {
|
|
29784
|
-
return this._cloneInto();
|
|
29785
|
-
}
|
|
29786
29772
|
}
|
|
29787
29773
|
exports.HashMD = HashMD;
|
|
29788
|
-
exports.SHA256_IV = Uint32Array.from([
|
|
29789
|
-
1779033703,
|
|
29790
|
-
3144134277,
|
|
29791
|
-
1013904242,
|
|
29792
|
-
2773480762,
|
|
29793
|
-
1359893119,
|
|
29794
|
-
2600822924,
|
|
29795
|
-
528734635,
|
|
29796
|
-
1541459225
|
|
29797
|
-
]);
|
|
29798
|
-
exports.SHA224_IV = Uint32Array.from([
|
|
29799
|
-
3238371032,
|
|
29800
|
-
914150663,
|
|
29801
|
-
812702999,
|
|
29802
|
-
4144912697,
|
|
29803
|
-
4290775857,
|
|
29804
|
-
1750603025,
|
|
29805
|
-
1694076839,
|
|
29806
|
-
3204075428
|
|
29807
|
-
]);
|
|
29808
|
-
exports.SHA384_IV = Uint32Array.from([
|
|
29809
|
-
3418070365,
|
|
29810
|
-
3238371032,
|
|
29811
|
-
1654270250,
|
|
29812
|
-
914150663,
|
|
29813
|
-
2438529370,
|
|
29814
|
-
812702999,
|
|
29815
|
-
355462360,
|
|
29816
|
-
4144912697,
|
|
29817
|
-
1731405415,
|
|
29818
|
-
4290775857,
|
|
29819
|
-
2394180231,
|
|
29820
|
-
1750603025,
|
|
29821
|
-
3675008525,
|
|
29822
|
-
1694076839,
|
|
29823
|
-
1203062813,
|
|
29824
|
-
3204075428
|
|
29825
|
-
]);
|
|
29826
|
-
exports.SHA512_IV = Uint32Array.from([
|
|
29827
|
-
1779033703,
|
|
29828
|
-
4089235720,
|
|
29829
|
-
3144134277,
|
|
29830
|
-
2227873595,
|
|
29831
|
-
1013904242,
|
|
29832
|
-
4271175723,
|
|
29833
|
-
2773480762,
|
|
29834
|
-
1595750129,
|
|
29835
|
-
1359893119,
|
|
29836
|
-
2917565137,
|
|
29837
|
-
2600822924,
|
|
29838
|
-
725511199,
|
|
29839
|
-
528734635,
|
|
29840
|
-
4215389547,
|
|
29841
|
-
1541459225,
|
|
29842
|
-
327033209
|
|
29843
|
-
]);
|
|
29844
29774
|
});
|
|
29845
29775
|
|
|
29846
|
-
// ../../node_modules/eciesjs/node_modules/@noble/hashes/
|
|
29847
|
-
var
|
|
29848
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29849
|
-
exports.toBig = exports.shrSL = exports.shrSH = exports.rotrSL = exports.rotrSH = exports.rotrBL = exports.rotrBH = exports.rotr32L = exports.rotr32H = exports.rotlSL = exports.rotlSH = exports.rotlBL = exports.rotlBH = exports.add5L = exports.add5H = exports.add4L = exports.add4H = exports.add3L = exports.add3H = undefined;
|
|
29850
|
-
exports.add = add;
|
|
29851
|
-
exports.fromBig = fromBig;
|
|
29852
|
-
exports.split = split;
|
|
29853
|
-
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
29854
|
-
var _32n = /* @__PURE__ */ BigInt(32);
|
|
29855
|
-
function fromBig(n, le = false) {
|
|
29856
|
-
if (le)
|
|
29857
|
-
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
29858
|
-
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
29859
|
-
}
|
|
29860
|
-
function split(lst, le = false) {
|
|
29861
|
-
const len = lst.length;
|
|
29862
|
-
let Ah = new Uint32Array(len);
|
|
29863
|
-
let Al = new Uint32Array(len);
|
|
29864
|
-
for (let i = 0;i < len; i++) {
|
|
29865
|
-
const { h, l } = fromBig(lst[i], le);
|
|
29866
|
-
[Ah[i], Al[i]] = [h, l];
|
|
29867
|
-
}
|
|
29868
|
-
return [Ah, Al];
|
|
29869
|
-
}
|
|
29870
|
-
var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
|
|
29871
|
-
exports.toBig = toBig;
|
|
29872
|
-
var shrSH = (h, _l, s) => h >>> s;
|
|
29873
|
-
exports.shrSH = shrSH;
|
|
29874
|
-
var shrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
29875
|
-
exports.shrSL = shrSL;
|
|
29876
|
-
var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
|
29877
|
-
exports.rotrSH = rotrSH;
|
|
29878
|
-
var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
29879
|
-
exports.rotrSL = rotrSL;
|
|
29880
|
-
var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
|
29881
|
-
exports.rotrBH = rotrBH;
|
|
29882
|
-
var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
|
29883
|
-
exports.rotrBL = rotrBL;
|
|
29884
|
-
var rotr32H = (_h, l) => l;
|
|
29885
|
-
exports.rotr32H = rotr32H;
|
|
29886
|
-
var rotr32L = (h, _l) => h;
|
|
29887
|
-
exports.rotr32L = rotr32L;
|
|
29888
|
-
var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
29889
|
-
exports.rotlSH = rotlSH;
|
|
29890
|
-
var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
29891
|
-
exports.rotlSL = rotlSL;
|
|
29892
|
-
var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
29893
|
-
exports.rotlBH = rotlBH;
|
|
29894
|
-
var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
29895
|
-
exports.rotlBL = rotlBL;
|
|
29896
|
-
function add(Ah, Al, Bh, Bl) {
|
|
29897
|
-
const l = (Al >>> 0) + (Bl >>> 0);
|
|
29898
|
-
return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
|
29899
|
-
}
|
|
29900
|
-
var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
29901
|
-
exports.add3L = add3L;
|
|
29902
|
-
var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
|
29903
|
-
exports.add3H = add3H;
|
|
29904
|
-
var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
29905
|
-
exports.add4L = add4L;
|
|
29906
|
-
var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
|
|
29907
|
-
exports.add4H = add4H;
|
|
29908
|
-
var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
29909
|
-
exports.add5L = add5L;
|
|
29910
|
-
var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
|
29911
|
-
exports.add5H = add5H;
|
|
29912
|
-
var u64 = {
|
|
29913
|
-
fromBig,
|
|
29914
|
-
split,
|
|
29915
|
-
toBig,
|
|
29916
|
-
shrSH,
|
|
29917
|
-
shrSL,
|
|
29918
|
-
rotrSH,
|
|
29919
|
-
rotrSL,
|
|
29920
|
-
rotrBH,
|
|
29921
|
-
rotrBL,
|
|
29922
|
-
rotr32H,
|
|
29923
|
-
rotr32L,
|
|
29924
|
-
rotlSH,
|
|
29925
|
-
rotlSL,
|
|
29926
|
-
rotlBH,
|
|
29927
|
-
rotlBL,
|
|
29928
|
-
add,
|
|
29929
|
-
add3L,
|
|
29930
|
-
add3H,
|
|
29931
|
-
add4L,
|
|
29932
|
-
add4H,
|
|
29933
|
-
add5H,
|
|
29934
|
-
add5L
|
|
29935
|
-
};
|
|
29936
|
-
exports.default = u64;
|
|
29937
|
-
});
|
|
29938
|
-
|
|
29939
|
-
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha2.js
|
|
29940
|
-
var require_sha2 = __commonJS((exports) => {
|
|
29776
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
|
|
29777
|
+
var require_sha256 = __commonJS((exports) => {
|
|
29941
29778
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29942
|
-
exports.
|
|
29779
|
+
exports.sha224 = exports.sha256 = exports.SHA256 = undefined;
|
|
29943
29780
|
var _md_ts_1 = require__md();
|
|
29944
|
-
var u64 = require__u64();
|
|
29945
29781
|
var utils_ts_1 = require_utils7();
|
|
29946
|
-
var SHA256_K = /* @__PURE__ */ Uint32Array
|
|
29782
|
+
var SHA256_K = /* @__PURE__ */ new Uint32Array([
|
|
29947
29783
|
1116352408,
|
|
29948
29784
|
1899447441,
|
|
29949
29785
|
3049323471,
|
|
@@ -30009,19 +29845,29 @@ var require_sha2 = __commonJS((exports) => {
|
|
|
30009
29845
|
3204031479,
|
|
30010
29846
|
3329325298
|
|
30011
29847
|
]);
|
|
29848
|
+
var SHA256_IV = /* @__PURE__ */ new Uint32Array([
|
|
29849
|
+
1779033703,
|
|
29850
|
+
3144134277,
|
|
29851
|
+
1013904242,
|
|
29852
|
+
2773480762,
|
|
29853
|
+
1359893119,
|
|
29854
|
+
2600822924,
|
|
29855
|
+
528734635,
|
|
29856
|
+
1541459225
|
|
29857
|
+
]);
|
|
30012
29858
|
var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
30013
29859
|
|
|
30014
29860
|
class SHA256 extends _md_ts_1.HashMD {
|
|
30015
29861
|
constructor(outputLen = 32) {
|
|
30016
29862
|
super(64, outputLen, 8, false);
|
|
30017
|
-
this.A =
|
|
30018
|
-
this.B =
|
|
30019
|
-
this.C =
|
|
30020
|
-
this.D =
|
|
30021
|
-
this.E =
|
|
30022
|
-
this.F =
|
|
30023
|
-
this.G =
|
|
30024
|
-
this.H =
|
|
29863
|
+
this.A = SHA256_IV[0] | 0;
|
|
29864
|
+
this.B = SHA256_IV[1] | 0;
|
|
29865
|
+
this.C = SHA256_IV[2] | 0;
|
|
29866
|
+
this.D = SHA256_IV[3] | 0;
|
|
29867
|
+
this.E = SHA256_IV[4] | 0;
|
|
29868
|
+
this.F = SHA256_IV[5] | 0;
|
|
29869
|
+
this.G = SHA256_IV[6] | 0;
|
|
29870
|
+
this.H = SHA256_IV[7] | 0;
|
|
30025
29871
|
}
|
|
30026
29872
|
get() {
|
|
30027
29873
|
const { A, B, C, D, E, F, G, H } = this;
|
|
@@ -30073,11 +29919,11 @@ var require_sha2 = __commonJS((exports) => {
|
|
|
30073
29919
|
this.set(A, B, C, D, E, F, G, H);
|
|
30074
29920
|
}
|
|
30075
29921
|
roundClean() {
|
|
30076
|
-
(0
|
|
29922
|
+
SHA256_W.fill(0);
|
|
30077
29923
|
}
|
|
30078
29924
|
destroy() {
|
|
30079
29925
|
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
30080
|
-
|
|
29926
|
+
this.buffer.fill(0);
|
|
30081
29927
|
}
|
|
30082
29928
|
}
|
|
30083
29929
|
exports.SHA256 = SHA256;
|
|
@@ -30085,18 +29931,120 @@ var require_sha2 = __commonJS((exports) => {
|
|
|
30085
29931
|
class SHA224 extends SHA256 {
|
|
30086
29932
|
constructor() {
|
|
30087
29933
|
super(28);
|
|
30088
|
-
this.A =
|
|
30089
|
-
this.B =
|
|
30090
|
-
this.C =
|
|
30091
|
-
this.D =
|
|
30092
|
-
this.E =
|
|
30093
|
-
this.F =
|
|
30094
|
-
this.G =
|
|
30095
|
-
this.H =
|
|
30096
|
-
}
|
|
30097
|
-
}
|
|
30098
|
-
exports.
|
|
30099
|
-
|
|
29934
|
+
this.A = 3238371032 | 0;
|
|
29935
|
+
this.B = 914150663 | 0;
|
|
29936
|
+
this.C = 812702999 | 0;
|
|
29937
|
+
this.D = 4144912697 | 0;
|
|
29938
|
+
this.E = 4290775857 | 0;
|
|
29939
|
+
this.F = 1750603025 | 0;
|
|
29940
|
+
this.G = 1694076839 | 0;
|
|
29941
|
+
this.H = 3204075428 | 0;
|
|
29942
|
+
}
|
|
29943
|
+
}
|
|
29944
|
+
exports.sha256 = (0, utils_ts_1.wrapConstructor)(() => new SHA256);
|
|
29945
|
+
exports.sha224 = (0, utils_ts_1.wrapConstructor)(() => new SHA224);
|
|
29946
|
+
});
|
|
29947
|
+
|
|
29948
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
|
|
29949
|
+
var require__u64 = __commonJS((exports) => {
|
|
29950
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29951
|
+
exports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = undefined;
|
|
29952
|
+
exports.fromBig = fromBig;
|
|
29953
|
+
exports.split = split;
|
|
29954
|
+
exports.add = add;
|
|
29955
|
+
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
29956
|
+
var _32n = /* @__PURE__ */ BigInt(32);
|
|
29957
|
+
function fromBig(n, le = false) {
|
|
29958
|
+
if (le)
|
|
29959
|
+
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
29960
|
+
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
29961
|
+
}
|
|
29962
|
+
function split(lst, le = false) {
|
|
29963
|
+
let Ah = new Uint32Array(lst.length);
|
|
29964
|
+
let Al = new Uint32Array(lst.length);
|
|
29965
|
+
for (let i = 0;i < lst.length; i++) {
|
|
29966
|
+
const { h, l } = fromBig(lst[i], le);
|
|
29967
|
+
[Ah[i], Al[i]] = [h, l];
|
|
29968
|
+
}
|
|
29969
|
+
return [Ah, Al];
|
|
29970
|
+
}
|
|
29971
|
+
var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0);
|
|
29972
|
+
exports.toBig = toBig;
|
|
29973
|
+
var shrSH = (h, _l, s) => h >>> s;
|
|
29974
|
+
exports.shrSH = shrSH;
|
|
29975
|
+
var shrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
29976
|
+
exports.shrSL = shrSL;
|
|
29977
|
+
var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
|
29978
|
+
exports.rotrSH = rotrSH;
|
|
29979
|
+
var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
29980
|
+
exports.rotrSL = rotrSL;
|
|
29981
|
+
var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
|
29982
|
+
exports.rotrBH = rotrBH;
|
|
29983
|
+
var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
|
29984
|
+
exports.rotrBL = rotrBL;
|
|
29985
|
+
var rotr32H = (_h, l) => l;
|
|
29986
|
+
exports.rotr32H = rotr32H;
|
|
29987
|
+
var rotr32L = (h, _l) => h;
|
|
29988
|
+
exports.rotr32L = rotr32L;
|
|
29989
|
+
var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
29990
|
+
exports.rotlSH = rotlSH;
|
|
29991
|
+
var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
29992
|
+
exports.rotlSL = rotlSL;
|
|
29993
|
+
var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
29994
|
+
exports.rotlBH = rotlBH;
|
|
29995
|
+
var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
29996
|
+
exports.rotlBL = rotlBL;
|
|
29997
|
+
function add(Ah, Al, Bh, Bl) {
|
|
29998
|
+
const l = (Al >>> 0) + (Bl >>> 0);
|
|
29999
|
+
return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
|
30000
|
+
}
|
|
30001
|
+
var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
30002
|
+
exports.add3L = add3L;
|
|
30003
|
+
var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
|
30004
|
+
exports.add3H = add3H;
|
|
30005
|
+
var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
30006
|
+
exports.add4L = add4L;
|
|
30007
|
+
var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
|
|
30008
|
+
exports.add4H = add4H;
|
|
30009
|
+
var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
30010
|
+
exports.add5L = add5L;
|
|
30011
|
+
var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
|
30012
|
+
exports.add5H = add5H;
|
|
30013
|
+
var u64 = {
|
|
30014
|
+
fromBig,
|
|
30015
|
+
split,
|
|
30016
|
+
toBig,
|
|
30017
|
+
shrSH,
|
|
30018
|
+
shrSL,
|
|
30019
|
+
rotrSH,
|
|
30020
|
+
rotrSL,
|
|
30021
|
+
rotrBH,
|
|
30022
|
+
rotrBL,
|
|
30023
|
+
rotr32H,
|
|
30024
|
+
rotr32L,
|
|
30025
|
+
rotlSH,
|
|
30026
|
+
rotlSL,
|
|
30027
|
+
rotlBH,
|
|
30028
|
+
rotlBL,
|
|
30029
|
+
add,
|
|
30030
|
+
add3L,
|
|
30031
|
+
add3H,
|
|
30032
|
+
add4L,
|
|
30033
|
+
add4H,
|
|
30034
|
+
add5H,
|
|
30035
|
+
add5L
|
|
30036
|
+
};
|
|
30037
|
+
exports.default = u64;
|
|
30038
|
+
});
|
|
30039
|
+
|
|
30040
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha512.js
|
|
30041
|
+
var require_sha512 = __commonJS((exports) => {
|
|
30042
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30043
|
+
exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA384 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA512 = undefined;
|
|
30044
|
+
var _md_ts_1 = require__md();
|
|
30045
|
+
var _u64_ts_1 = require__u64();
|
|
30046
|
+
var utils_ts_1 = require_utils7();
|
|
30047
|
+
var [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => _u64_ts_1.default.split([
|
|
30100
30048
|
"0x428a2f98d728ae22",
|
|
30101
30049
|
"0x7137449123ef65cd",
|
|
30102
30050
|
"0xb5c0fbcfec4d3b2f",
|
|
@@ -30178,30 +30126,28 @@ var require_sha2 = __commonJS((exports) => {
|
|
|
30178
30126
|
"0x5fcb6fab3ad6faec",
|
|
30179
30127
|
"0x6c44198c4a475817"
|
|
30180
30128
|
].map((n) => BigInt(n))))();
|
|
30181
|
-
var SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
|
|
30182
|
-
var SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
|
|
30183
30129
|
var SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
|
|
30184
30130
|
var SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
|
|
30185
30131
|
|
|
30186
30132
|
class SHA512 extends _md_ts_1.HashMD {
|
|
30187
30133
|
constructor(outputLen = 64) {
|
|
30188
30134
|
super(128, outputLen, 16, false);
|
|
30189
|
-
this.Ah =
|
|
30190
|
-
this.Al =
|
|
30191
|
-
this.Bh =
|
|
30192
|
-
this.Bl =
|
|
30193
|
-
this.Ch =
|
|
30194
|
-
this.Cl =
|
|
30195
|
-
this.Dh =
|
|
30196
|
-
this.Dl =
|
|
30197
|
-
this.Eh =
|
|
30198
|
-
this.El =
|
|
30199
|
-
this.Fh =
|
|
30200
|
-
this.Fl =
|
|
30201
|
-
this.Gh =
|
|
30202
|
-
this.Gl =
|
|
30203
|
-
this.Hh =
|
|
30204
|
-
this.Hl =
|
|
30135
|
+
this.Ah = 1779033703 | 0;
|
|
30136
|
+
this.Al = 4089235720 | 0;
|
|
30137
|
+
this.Bh = 3144134277 | 0;
|
|
30138
|
+
this.Bl = 2227873595 | 0;
|
|
30139
|
+
this.Ch = 1013904242 | 0;
|
|
30140
|
+
this.Cl = 4271175723 | 0;
|
|
30141
|
+
this.Dh = 2773480762 | 0;
|
|
30142
|
+
this.Dl = 1595750129 | 0;
|
|
30143
|
+
this.Eh = 1359893119 | 0;
|
|
30144
|
+
this.El = 2917565137 | 0;
|
|
30145
|
+
this.Fh = 2600822924 | 0;
|
|
30146
|
+
this.Fl = 725511199 | 0;
|
|
30147
|
+
this.Gh = 528734635 | 0;
|
|
30148
|
+
this.Gl = 4215389547 | 0;
|
|
30149
|
+
this.Hh = 1541459225 | 0;
|
|
30150
|
+
this.Hl = 327033209 | 0;
|
|
30205
30151
|
}
|
|
30206
30152
|
get() {
|
|
30207
30153
|
const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
|
@@ -30233,28 +30179,28 @@ var require_sha2 = __commonJS((exports) => {
|
|
|
30233
30179
|
for (let i = 16;i < 80; i++) {
|
|
30234
30180
|
const W15h = SHA512_W_H[i - 15] | 0;
|
|
30235
30181
|
const W15l = SHA512_W_L[i - 15] | 0;
|
|
30236
|
-
const s0h =
|
|
30237
|
-
const s0l =
|
|
30182
|
+
const s0h = _u64_ts_1.default.rotrSH(W15h, W15l, 1) ^ _u64_ts_1.default.rotrSH(W15h, W15l, 8) ^ _u64_ts_1.default.shrSH(W15h, W15l, 7);
|
|
30183
|
+
const s0l = _u64_ts_1.default.rotrSL(W15h, W15l, 1) ^ _u64_ts_1.default.rotrSL(W15h, W15l, 8) ^ _u64_ts_1.default.shrSL(W15h, W15l, 7);
|
|
30238
30184
|
const W2h = SHA512_W_H[i - 2] | 0;
|
|
30239
30185
|
const W2l = SHA512_W_L[i - 2] | 0;
|
|
30240
|
-
const s1h =
|
|
30241
|
-
const s1l =
|
|
30242
|
-
const SUMl =
|
|
30243
|
-
const SUMh =
|
|
30186
|
+
const s1h = _u64_ts_1.default.rotrSH(W2h, W2l, 19) ^ _u64_ts_1.default.rotrBH(W2h, W2l, 61) ^ _u64_ts_1.default.shrSH(W2h, W2l, 6);
|
|
30187
|
+
const s1l = _u64_ts_1.default.rotrSL(W2h, W2l, 19) ^ _u64_ts_1.default.rotrBL(W2h, W2l, 61) ^ _u64_ts_1.default.shrSL(W2h, W2l, 6);
|
|
30188
|
+
const SUMl = _u64_ts_1.default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
|
|
30189
|
+
const SUMh = _u64_ts_1.default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
|
|
30244
30190
|
SHA512_W_H[i] = SUMh | 0;
|
|
30245
30191
|
SHA512_W_L[i] = SUMl | 0;
|
|
30246
30192
|
}
|
|
30247
30193
|
let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
|
30248
30194
|
for (let i = 0;i < 80; i++) {
|
|
30249
|
-
const sigma1h =
|
|
30250
|
-
const sigma1l =
|
|
30195
|
+
const sigma1h = _u64_ts_1.default.rotrSH(Eh, El, 14) ^ _u64_ts_1.default.rotrSH(Eh, El, 18) ^ _u64_ts_1.default.rotrBH(Eh, El, 41);
|
|
30196
|
+
const sigma1l = _u64_ts_1.default.rotrSL(Eh, El, 14) ^ _u64_ts_1.default.rotrSL(Eh, El, 18) ^ _u64_ts_1.default.rotrBL(Eh, El, 41);
|
|
30251
30197
|
const CHIh = Eh & Fh ^ ~Eh & Gh;
|
|
30252
30198
|
const CHIl = El & Fl ^ ~El & Gl;
|
|
30253
|
-
const T1ll =
|
|
30254
|
-
const T1h =
|
|
30199
|
+
const T1ll = _u64_ts_1.default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
|
|
30200
|
+
const T1h = _u64_ts_1.default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
|
|
30255
30201
|
const T1l = T1ll | 0;
|
|
30256
|
-
const sigma0h =
|
|
30257
|
-
const sigma0l =
|
|
30202
|
+
const sigma0h = _u64_ts_1.default.rotrSH(Ah, Al, 28) ^ _u64_ts_1.default.rotrBH(Ah, Al, 34) ^ _u64_ts_1.default.rotrBH(Ah, Al, 39);
|
|
30203
|
+
const sigma0l = _u64_ts_1.default.rotrSL(Ah, Al, 28) ^ _u64_ts_1.default.rotrBL(Ah, Al, 34) ^ _u64_ts_1.default.rotrBL(Ah, Al, 39);
|
|
30258
30204
|
const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
|
|
30259
30205
|
const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
|
|
30260
30206
|
Hh = Gh | 0;
|
|
@@ -30263,115 +30209,57 @@ var require_sha2 = __commonJS((exports) => {
|
|
|
30263
30209
|
Gl = Fl | 0;
|
|
30264
30210
|
Fh = Eh | 0;
|
|
30265
30211
|
Fl = El | 0;
|
|
30266
|
-
({ h: Eh, l: El } =
|
|
30212
|
+
({ h: Eh, l: El } = _u64_ts_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
|
|
30267
30213
|
Dh = Ch | 0;
|
|
30268
30214
|
Dl = Cl | 0;
|
|
30269
30215
|
Ch = Bh | 0;
|
|
30270
30216
|
Cl = Bl | 0;
|
|
30271
30217
|
Bh = Ah | 0;
|
|
30272
30218
|
Bl = Al | 0;
|
|
30273
|
-
const All =
|
|
30274
|
-
Ah =
|
|
30219
|
+
const All = _u64_ts_1.default.add3L(T1l, sigma0l, MAJl);
|
|
30220
|
+
Ah = _u64_ts_1.default.add3H(All, T1h, sigma0h, MAJh);
|
|
30275
30221
|
Al = All | 0;
|
|
30276
30222
|
}
|
|
30277
|
-
({ h: Ah, l: Al } =
|
|
30278
|
-
({ h: Bh, l: Bl } =
|
|
30279
|
-
({ h: Ch, l: Cl } =
|
|
30280
|
-
({ h: Dh, l: Dl } =
|
|
30281
|
-
({ h: Eh, l: El } =
|
|
30282
|
-
({ h: Fh, l: Fl } =
|
|
30283
|
-
({ h: Gh, l: Gl } =
|
|
30284
|
-
({ h: Hh, l: Hl } =
|
|
30223
|
+
({ h: Ah, l: Al } = _u64_ts_1.default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
|
|
30224
|
+
({ h: Bh, l: Bl } = _u64_ts_1.default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
|
|
30225
|
+
({ h: Ch, l: Cl } = _u64_ts_1.default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
|
|
30226
|
+
({ h: Dh, l: Dl } = _u64_ts_1.default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
|
|
30227
|
+
({ h: Eh, l: El } = _u64_ts_1.default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
|
|
30228
|
+
({ h: Fh, l: Fl } = _u64_ts_1.default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
|
|
30229
|
+
({ h: Gh, l: Gl } = _u64_ts_1.default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
|
|
30230
|
+
({ h: Hh, l: Hl } = _u64_ts_1.default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
|
|
30285
30231
|
this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
|
|
30286
30232
|
}
|
|
30287
30233
|
roundClean() {
|
|
30288
|
-
(0
|
|
30234
|
+
SHA512_W_H.fill(0);
|
|
30235
|
+
SHA512_W_L.fill(0);
|
|
30289
30236
|
}
|
|
30290
30237
|
destroy() {
|
|
30291
|
-
|
|
30238
|
+
this.buffer.fill(0);
|
|
30292
30239
|
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
30293
30240
|
}
|
|
30294
30241
|
}
|
|
30295
30242
|
exports.SHA512 = SHA512;
|
|
30296
30243
|
|
|
30297
|
-
class SHA384 extends SHA512 {
|
|
30298
|
-
constructor() {
|
|
30299
|
-
super(48);
|
|
30300
|
-
this.Ah = _md_ts_1.SHA384_IV[0] | 0;
|
|
30301
|
-
this.Al = _md_ts_1.SHA384_IV[1] | 0;
|
|
30302
|
-
this.Bh = _md_ts_1.SHA384_IV[2] | 0;
|
|
30303
|
-
this.Bl = _md_ts_1.SHA384_IV[3] | 0;
|
|
30304
|
-
this.Ch = _md_ts_1.SHA384_IV[4] | 0;
|
|
30305
|
-
this.Cl = _md_ts_1.SHA384_IV[5] | 0;
|
|
30306
|
-
this.Dh = _md_ts_1.SHA384_IV[6] | 0;
|
|
30307
|
-
this.Dl = _md_ts_1.SHA384_IV[7] | 0;
|
|
30308
|
-
this.Eh = _md_ts_1.SHA384_IV[8] | 0;
|
|
30309
|
-
this.El = _md_ts_1.SHA384_IV[9] | 0;
|
|
30310
|
-
this.Fh = _md_ts_1.SHA384_IV[10] | 0;
|
|
30311
|
-
this.Fl = _md_ts_1.SHA384_IV[11] | 0;
|
|
30312
|
-
this.Gh = _md_ts_1.SHA384_IV[12] | 0;
|
|
30313
|
-
this.Gl = _md_ts_1.SHA384_IV[13] | 0;
|
|
30314
|
-
this.Hh = _md_ts_1.SHA384_IV[14] | 0;
|
|
30315
|
-
this.Hl = _md_ts_1.SHA384_IV[15] | 0;
|
|
30316
|
-
}
|
|
30317
|
-
}
|
|
30318
|
-
exports.SHA384 = SHA384;
|
|
30319
|
-
var T224_IV = /* @__PURE__ */ Uint32Array.from([
|
|
30320
|
-
2352822216,
|
|
30321
|
-
424955298,
|
|
30322
|
-
1944164710,
|
|
30323
|
-
2312950998,
|
|
30324
|
-
502970286,
|
|
30325
|
-
855612546,
|
|
30326
|
-
1738396948,
|
|
30327
|
-
1479516111,
|
|
30328
|
-
258812777,
|
|
30329
|
-
2077511080,
|
|
30330
|
-
2011393907,
|
|
30331
|
-
79989058,
|
|
30332
|
-
1067287976,
|
|
30333
|
-
1780299464,
|
|
30334
|
-
286451373,
|
|
30335
|
-
2446758561
|
|
30336
|
-
]);
|
|
30337
|
-
var T256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
30338
|
-
573645204,
|
|
30339
|
-
4230739756,
|
|
30340
|
-
2673172387,
|
|
30341
|
-
3360449730,
|
|
30342
|
-
596883563,
|
|
30343
|
-
1867755857,
|
|
30344
|
-
2520282905,
|
|
30345
|
-
1497426621,
|
|
30346
|
-
2519219938,
|
|
30347
|
-
2827943907,
|
|
30348
|
-
3193839141,
|
|
30349
|
-
1401305490,
|
|
30350
|
-
721525244,
|
|
30351
|
-
746961066,
|
|
30352
|
-
246885852,
|
|
30353
|
-
2177182882
|
|
30354
|
-
]);
|
|
30355
|
-
|
|
30356
30244
|
class SHA512_224 extends SHA512 {
|
|
30357
30245
|
constructor() {
|
|
30358
30246
|
super(28);
|
|
30359
|
-
this.Ah =
|
|
30360
|
-
this.Al =
|
|
30361
|
-
this.Bh =
|
|
30362
|
-
this.Bl =
|
|
30363
|
-
this.Ch =
|
|
30364
|
-
this.Cl =
|
|
30365
|
-
this.Dh =
|
|
30366
|
-
this.Dl =
|
|
30367
|
-
this.Eh =
|
|
30368
|
-
this.El =
|
|
30369
|
-
this.Fh =
|
|
30370
|
-
this.Fl =
|
|
30371
|
-
this.Gh =
|
|
30372
|
-
this.Gl =
|
|
30373
|
-
this.Hh =
|
|
30374
|
-
this.Hl =
|
|
30247
|
+
this.Ah = 2352822216 | 0;
|
|
30248
|
+
this.Al = 424955298 | 0;
|
|
30249
|
+
this.Bh = 1944164710 | 0;
|
|
30250
|
+
this.Bl = 2312950998 | 0;
|
|
30251
|
+
this.Ch = 502970286 | 0;
|
|
30252
|
+
this.Cl = 855612546 | 0;
|
|
30253
|
+
this.Dh = 1738396948 | 0;
|
|
30254
|
+
this.Dl = 1479516111 | 0;
|
|
30255
|
+
this.Eh = 258812777 | 0;
|
|
30256
|
+
this.El = 2077511080 | 0;
|
|
30257
|
+
this.Fh = 2011393907 | 0;
|
|
30258
|
+
this.Fl = 79989058 | 0;
|
|
30259
|
+
this.Gh = 1067287976 | 0;
|
|
30260
|
+
this.Gl = 1780299464 | 0;
|
|
30261
|
+
this.Hh = 286451373 | 0;
|
|
30262
|
+
this.Hl = 2446758561 | 0;
|
|
30375
30263
|
}
|
|
30376
30264
|
}
|
|
30377
30265
|
exports.SHA512_224 = SHA512_224;
|
|
@@ -30379,31 +30267,78 @@ var require_sha2 = __commonJS((exports) => {
|
|
|
30379
30267
|
class SHA512_256 extends SHA512 {
|
|
30380
30268
|
constructor() {
|
|
30381
30269
|
super(32);
|
|
30382
|
-
this.Ah =
|
|
30383
|
-
this.Al =
|
|
30384
|
-
this.Bh =
|
|
30385
|
-
this.Bl =
|
|
30386
|
-
this.Ch =
|
|
30387
|
-
this.Cl =
|
|
30388
|
-
this.Dh =
|
|
30389
|
-
this.Dl =
|
|
30390
|
-
this.Eh =
|
|
30391
|
-
this.El =
|
|
30392
|
-
this.Fh =
|
|
30393
|
-
this.Fl =
|
|
30394
|
-
this.Gh =
|
|
30395
|
-
this.Gl =
|
|
30396
|
-
this.Hh =
|
|
30397
|
-
this.Hl =
|
|
30270
|
+
this.Ah = 573645204 | 0;
|
|
30271
|
+
this.Al = 4230739756 | 0;
|
|
30272
|
+
this.Bh = 2673172387 | 0;
|
|
30273
|
+
this.Bl = 3360449730 | 0;
|
|
30274
|
+
this.Ch = 596883563 | 0;
|
|
30275
|
+
this.Cl = 1867755857 | 0;
|
|
30276
|
+
this.Dh = 2520282905 | 0;
|
|
30277
|
+
this.Dl = 1497426621 | 0;
|
|
30278
|
+
this.Eh = 2519219938 | 0;
|
|
30279
|
+
this.El = 2827943907 | 0;
|
|
30280
|
+
this.Fh = 3193839141 | 0;
|
|
30281
|
+
this.Fl = 1401305490 | 0;
|
|
30282
|
+
this.Gh = 721525244 | 0;
|
|
30283
|
+
this.Gl = 746961066 | 0;
|
|
30284
|
+
this.Hh = 246885852 | 0;
|
|
30285
|
+
this.Hl = 2177182882 | 0;
|
|
30398
30286
|
}
|
|
30399
30287
|
}
|
|
30400
30288
|
exports.SHA512_256 = SHA512_256;
|
|
30401
|
-
|
|
30402
|
-
|
|
30403
|
-
|
|
30404
|
-
|
|
30405
|
-
|
|
30406
|
-
|
|
30289
|
+
|
|
30290
|
+
class SHA384 extends SHA512 {
|
|
30291
|
+
constructor() {
|
|
30292
|
+
super(48);
|
|
30293
|
+
this.Ah = 3418070365 | 0;
|
|
30294
|
+
this.Al = 3238371032 | 0;
|
|
30295
|
+
this.Bh = 1654270250 | 0;
|
|
30296
|
+
this.Bl = 914150663 | 0;
|
|
30297
|
+
this.Ch = 2438529370 | 0;
|
|
30298
|
+
this.Cl = 812702999 | 0;
|
|
30299
|
+
this.Dh = 355462360 | 0;
|
|
30300
|
+
this.Dl = 4144912697 | 0;
|
|
30301
|
+
this.Eh = 1731405415 | 0;
|
|
30302
|
+
this.El = 4290775857 | 0;
|
|
30303
|
+
this.Fh = 2394180231 | 0;
|
|
30304
|
+
this.Fl = 1750603025 | 0;
|
|
30305
|
+
this.Gh = 3675008525 | 0;
|
|
30306
|
+
this.Gl = 1694076839 | 0;
|
|
30307
|
+
this.Hh = 1203062813 | 0;
|
|
30308
|
+
this.Hl = 3204075428 | 0;
|
|
30309
|
+
}
|
|
30310
|
+
}
|
|
30311
|
+
exports.SHA384 = SHA384;
|
|
30312
|
+
exports.sha512 = (0, utils_ts_1.wrapConstructor)(() => new SHA512);
|
|
30313
|
+
exports.sha512_224 = (0, utils_ts_1.wrapConstructor)(() => new SHA512_224);
|
|
30314
|
+
exports.sha512_256 = (0, utils_ts_1.wrapConstructor)(() => new SHA512_256);
|
|
30315
|
+
exports.sha384 = (0, utils_ts_1.wrapConstructor)(() => new SHA384);
|
|
30316
|
+
});
|
|
30317
|
+
|
|
30318
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha2.js
|
|
30319
|
+
var require_sha2 = __commonJS((exports) => {
|
|
30320
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30321
|
+
exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.sha384 = exports.sha256 = exports.sha224 = undefined;
|
|
30322
|
+
var sha256_ts_1 = require_sha256();
|
|
30323
|
+
Object.defineProperty(exports, "sha224", { enumerable: true, get: function() {
|
|
30324
|
+
return sha256_ts_1.sha224;
|
|
30325
|
+
} });
|
|
30326
|
+
Object.defineProperty(exports, "sha256", { enumerable: true, get: function() {
|
|
30327
|
+
return sha256_ts_1.sha256;
|
|
30328
|
+
} });
|
|
30329
|
+
var sha512_ts_1 = require_sha512();
|
|
30330
|
+
Object.defineProperty(exports, "sha384", { enumerable: true, get: function() {
|
|
30331
|
+
return sha512_ts_1.sha384;
|
|
30332
|
+
} });
|
|
30333
|
+
Object.defineProperty(exports, "sha512", { enumerable: true, get: function() {
|
|
30334
|
+
return sha512_ts_1.sha512;
|
|
30335
|
+
} });
|
|
30336
|
+
Object.defineProperty(exports, "sha512_224", { enumerable: true, get: function() {
|
|
30337
|
+
return sha512_ts_1.sha512_224;
|
|
30338
|
+
} });
|
|
30339
|
+
Object.defineProperty(exports, "sha512_256", { enumerable: true, get: function() {
|
|
30340
|
+
return sha512_ts_1.sha512_256;
|
|
30341
|
+
} });
|
|
30407
30342
|
});
|
|
30408
30343
|
|
|
30409
30344
|
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/utils.js
|
|
@@ -30705,7 +30640,6 @@ var require_modular = __commonJS((exports) => {
|
|
|
30705
30640
|
exports.getMinHashLength = getMinHashLength;
|
|
30706
30641
|
exports.mapHashToField = mapHashToField;
|
|
30707
30642
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
30708
|
-
var utils_1 = require_utils7();
|
|
30709
30643
|
var utils_ts_1 = require_utils8();
|
|
30710
30644
|
var _0n = BigInt(0);
|
|
30711
30645
|
var _1n = BigInt(1);
|
|
@@ -30765,17 +30699,13 @@ var require_modular = __commonJS((exports) => {
|
|
|
30765
30699
|
return mod(x, modulo);
|
|
30766
30700
|
}
|
|
30767
30701
|
function tonelliShanks(P) {
|
|
30768
|
-
|
|
30769
|
-
let S
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30773
|
-
|
|
30774
|
-
|
|
30775
|
-
const _Fp = Field(P);
|
|
30776
|
-
while (Z < P && FpIsSquare(_Fp, Z)) {
|
|
30777
|
-
if (Z++ > 1000)
|
|
30778
|
-
throw new Error("Cannot find square root: probably non-prime P");
|
|
30702
|
+
const legendreC = (P - _1n) / _2n;
|
|
30703
|
+
let Q, S, Z;
|
|
30704
|
+
for (Q = P - _1n, S = 0;Q % _2n === _0n; Q /= _2n, S++)
|
|
30705
|
+
;
|
|
30706
|
+
for (Z = _2n;Z < P && pow(Z, legendreC, P) !== P - _1n; Z++) {
|
|
30707
|
+
if (Z > 1000)
|
|
30708
|
+
throw new Error("Cannot find square root: likely non-prime P");
|
|
30779
30709
|
}
|
|
30780
30710
|
if (S === 1) {
|
|
30781
30711
|
const p1div4 = (P + _1n) / _4n;
|
|
@@ -30788,7 +30718,7 @@ var require_modular = __commonJS((exports) => {
|
|
|
30788
30718
|
}
|
|
30789
30719
|
const Q1div2 = (Q + _1n) / _2n;
|
|
30790
30720
|
return function tonelliSlow(Fp, n) {
|
|
30791
|
-
if (
|
|
30721
|
+
if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))
|
|
30792
30722
|
throw new Error("Cannot find square root");
|
|
30793
30723
|
let r = S;
|
|
30794
30724
|
let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q);
|
|
@@ -30814,8 +30744,8 @@ var require_modular = __commonJS((exports) => {
|
|
|
30814
30744
|
}
|
|
30815
30745
|
function FpSqrt(P) {
|
|
30816
30746
|
if (P % _4n === _3n) {
|
|
30747
|
+
const p1div4 = (P + _1n) / _4n;
|
|
30817
30748
|
return function sqrt3mod4(Fp, n) {
|
|
30818
|
-
const p1div4 = (P + _1n) / _4n;
|
|
30819
30749
|
const root = Fp.pow(n, p1div4);
|
|
30820
30750
|
if (!Fp.eql(Fp.sqr(root), n))
|
|
30821
30751
|
throw new Error("Cannot find square root");
|
|
@@ -30823,9 +30753,9 @@ var require_modular = __commonJS((exports) => {
|
|
|
30823
30753
|
};
|
|
30824
30754
|
}
|
|
30825
30755
|
if (P % _8n === _5n) {
|
|
30756
|
+
const c1 = (P - _5n) / _8n;
|
|
30826
30757
|
return function sqrt5mod8(Fp, n) {
|
|
30827
30758
|
const n2 = Fp.mul(n, _2n);
|
|
30828
|
-
const c1 = (P - _5n) / _8n;
|
|
30829
30759
|
const v = Fp.pow(n2, c1);
|
|
30830
30760
|
const nv = Fp.mul(n, v);
|
|
30831
30761
|
const i = Fp.mul(Fp.mul(nv, _2n), v);
|
|
@@ -30872,60 +30802,55 @@ var require_modular = __commonJS((exports) => {
|
|
|
30872
30802
|
}, initial);
|
|
30873
30803
|
return (0, utils_ts_1.validateObject)(field, opts);
|
|
30874
30804
|
}
|
|
30875
|
-
function FpPow(
|
|
30805
|
+
function FpPow(f, num, power) {
|
|
30876
30806
|
if (power < _0n)
|
|
30877
30807
|
throw new Error("invalid exponent, negatives unsupported");
|
|
30878
30808
|
if (power === _0n)
|
|
30879
|
-
return
|
|
30809
|
+
return f.ONE;
|
|
30880
30810
|
if (power === _1n)
|
|
30881
30811
|
return num;
|
|
30882
|
-
let p =
|
|
30812
|
+
let p = f.ONE;
|
|
30883
30813
|
let d = num;
|
|
30884
30814
|
while (power > _0n) {
|
|
30885
30815
|
if (power & _1n)
|
|
30886
|
-
p =
|
|
30887
|
-
d =
|
|
30816
|
+
p = f.mul(p, d);
|
|
30817
|
+
d = f.sqr(d);
|
|
30888
30818
|
power >>= _1n;
|
|
30889
30819
|
}
|
|
30890
30820
|
return p;
|
|
30891
30821
|
}
|
|
30892
|
-
function FpInvertBatch(
|
|
30893
|
-
const
|
|
30894
|
-
const
|
|
30895
|
-
if (
|
|
30822
|
+
function FpInvertBatch(f, nums) {
|
|
30823
|
+
const tmp = new Array(nums.length);
|
|
30824
|
+
const lastMultiplied = nums.reduce((acc, num, i) => {
|
|
30825
|
+
if (f.is0(num))
|
|
30896
30826
|
return acc;
|
|
30897
|
-
|
|
30898
|
-
return
|
|
30899
|
-
},
|
|
30900
|
-
const
|
|
30827
|
+
tmp[i] = acc;
|
|
30828
|
+
return f.mul(acc, num);
|
|
30829
|
+
}, f.ONE);
|
|
30830
|
+
const inverted = f.inv(lastMultiplied);
|
|
30901
30831
|
nums.reduceRight((acc, num, i) => {
|
|
30902
|
-
if (
|
|
30832
|
+
if (f.is0(num))
|
|
30903
30833
|
return acc;
|
|
30904
|
-
|
|
30905
|
-
return
|
|
30906
|
-
},
|
|
30907
|
-
return
|
|
30908
|
-
}
|
|
30909
|
-
function FpDiv(
|
|
30910
|
-
return
|
|
30911
|
-
}
|
|
30912
|
-
function FpLegendre(
|
|
30913
|
-
const
|
|
30914
|
-
|
|
30915
|
-
|
|
30916
|
-
|
|
30917
|
-
const
|
|
30918
|
-
|
|
30919
|
-
|
|
30920
|
-
|
|
30921
|
-
|
|
30922
|
-
function FpIsSquare(Fp, n) {
|
|
30923
|
-
const l = FpLegendre(Fp, n);
|
|
30924
|
-
return l === 0 || l === 1;
|
|
30834
|
+
tmp[i] = f.mul(acc, tmp[i]);
|
|
30835
|
+
return f.mul(acc, num);
|
|
30836
|
+
}, inverted);
|
|
30837
|
+
return tmp;
|
|
30838
|
+
}
|
|
30839
|
+
function FpDiv(f, lhs, rhs) {
|
|
30840
|
+
return f.mul(lhs, typeof rhs === "bigint" ? invert(rhs, f.ORDER) : f.inv(rhs));
|
|
30841
|
+
}
|
|
30842
|
+
function FpLegendre(order) {
|
|
30843
|
+
const legendreConst = (order - _1n) / _2n;
|
|
30844
|
+
return (f, x) => f.pow(x, legendreConst);
|
|
30845
|
+
}
|
|
30846
|
+
function FpIsSquare(f) {
|
|
30847
|
+
const legendre = FpLegendre(f.ORDER);
|
|
30848
|
+
return (x) => {
|
|
30849
|
+
const p = legendre(f, x);
|
|
30850
|
+
return f.eql(p, f.ZERO) || f.eql(p, f.ONE);
|
|
30851
|
+
};
|
|
30925
30852
|
}
|
|
30926
30853
|
function nLength(n, nBitLength) {
|
|
30927
|
-
if (nBitLength !== undefined)
|
|
30928
|
-
(0, utils_1.anumber)(nBitLength);
|
|
30929
30854
|
const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;
|
|
30930
30855
|
const nByteLength = Math.ceil(_nBitLength / 8);
|
|
30931
30856
|
return { nBitLength: _nBitLength, nByteLength };
|
|
@@ -30971,14 +30896,14 @@ var require_modular = __commonJS((exports) => {
|
|
|
30971
30896
|
sqrtP = FpSqrt(ORDER);
|
|
30972
30897
|
return sqrtP(f, n);
|
|
30973
30898
|
}),
|
|
30899
|
+
invertBatch: (lst) => FpInvertBatch(f, lst),
|
|
30900
|
+
cmov: (a, b, c) => c ? b : a,
|
|
30974
30901
|
toBytes: (num) => isLE ? (0, utils_ts_1.numberToBytesLE)(num, BYTES) : (0, utils_ts_1.numberToBytesBE)(num, BYTES),
|
|
30975
30902
|
fromBytes: (bytes) => {
|
|
30976
30903
|
if (bytes.length !== BYTES)
|
|
30977
30904
|
throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length);
|
|
30978
30905
|
return isLE ? (0, utils_ts_1.bytesToNumberLE)(bytes) : (0, utils_ts_1.bytesToNumberBE)(bytes);
|
|
30979
|
-
}
|
|
30980
|
-
invertBatch: (lst) => FpInvertBatch(f, lst),
|
|
30981
|
-
cmov: (a, b, c) => c ? b : a
|
|
30906
|
+
}
|
|
30982
30907
|
});
|
|
30983
30908
|
return Object.freeze(f);
|
|
30984
30909
|
}
|
|
@@ -31384,7 +31309,7 @@ var require_edwards = __commonJS((exports) => {
|
|
|
31384
31309
|
return new Point(x, y, _1n, modP(x * y));
|
|
31385
31310
|
}
|
|
31386
31311
|
static normalizeZ(points) {
|
|
31387
|
-
const toInv =
|
|
31312
|
+
const toInv = Fp.invertBatch(points.map((p) => p.ez));
|
|
31388
31313
|
return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
|
|
31389
31314
|
}
|
|
31390
31315
|
static msm(points, scalars) {
|
|
@@ -31552,7 +31477,7 @@ var require_edwards = __commonJS((exports) => {
|
|
|
31552
31477
|
function getPublicKey(privKey) {
|
|
31553
31478
|
return getExtendedPublicKey(privKey).pointBytes;
|
|
31554
31479
|
}
|
|
31555
|
-
function hashDomainToScalar(context = Uint8Array
|
|
31480
|
+
function hashDomainToScalar(context = new Uint8Array, ...msgs) {
|
|
31556
31481
|
const msg = (0, utils_ts_1.concatBytes)(...msgs);
|
|
31557
31482
|
return modN_LE(cHash(domain(msg, (0, utils_ts_1.ensureBytes)("context", context), !!prehash)));
|
|
31558
31483
|
}
|
|
@@ -31723,47 +31648,43 @@ var require_hash_to_curve = __commonJS((exports) => {
|
|
|
31723
31648
|
return u;
|
|
31724
31649
|
}
|
|
31725
31650
|
function isogenyMap(field, map2) {
|
|
31726
|
-
const
|
|
31651
|
+
const COEFF = map2.map((i) => Array.from(i).reverse());
|
|
31727
31652
|
return (x, y) => {
|
|
31728
|
-
const [
|
|
31729
|
-
|
|
31730
|
-
|
|
31731
|
-
|
|
31653
|
+
const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
|
|
31654
|
+
if (field.is0(xDen) || field.is0(yDen))
|
|
31655
|
+
throw new Error("bad point: ZERO");
|
|
31656
|
+
x = field.div(xNum, xDen);
|
|
31657
|
+
y = field.mul(y, field.div(yNum, yDen));
|
|
31732
31658
|
return { x, y };
|
|
31733
31659
|
};
|
|
31734
31660
|
}
|
|
31735
|
-
function createHasher(Point, mapToCurve,
|
|
31661
|
+
function createHasher(Point, mapToCurve, def) {
|
|
31736
31662
|
if (typeof mapToCurve !== "function")
|
|
31737
31663
|
throw new Error("mapToCurve() must be defined");
|
|
31738
|
-
function map2(num) {
|
|
31739
|
-
return Point.fromAffine(mapToCurve(num));
|
|
31740
|
-
}
|
|
31741
|
-
function clear(initial) {
|
|
31742
|
-
const P = initial.clearCofactor();
|
|
31743
|
-
if (P.equals(Point.ZERO))
|
|
31744
|
-
return Point.ZERO;
|
|
31745
|
-
P.assertValidity();
|
|
31746
|
-
return P;
|
|
31747
|
-
}
|
|
31748
31664
|
return {
|
|
31749
|
-
defaults,
|
|
31750
31665
|
hashToCurve(msg, options) {
|
|
31751
|
-
const u = hash_to_field(msg, 2, { ...
|
|
31752
|
-
const u0 =
|
|
31753
|
-
const u1 =
|
|
31754
|
-
|
|
31666
|
+
const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options });
|
|
31667
|
+
const u0 = Point.fromAffine(mapToCurve(u[0]));
|
|
31668
|
+
const u1 = Point.fromAffine(mapToCurve(u[1]));
|
|
31669
|
+
const P = u0.add(u1).clearCofactor();
|
|
31670
|
+
P.assertValidity();
|
|
31671
|
+
return P;
|
|
31755
31672
|
},
|
|
31756
31673
|
encodeToCurve(msg, options) {
|
|
31757
|
-
const u = hash_to_field(msg, 1, { ...
|
|
31758
|
-
|
|
31674
|
+
const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options });
|
|
31675
|
+
const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor();
|
|
31676
|
+
P.assertValidity();
|
|
31677
|
+
return P;
|
|
31759
31678
|
},
|
|
31760
31679
|
mapToCurve(scalars) {
|
|
31761
31680
|
if (!Array.isArray(scalars))
|
|
31762
|
-
throw new Error("expected array of bigints");
|
|
31681
|
+
throw new Error("mapToCurve: expected array of bigints");
|
|
31763
31682
|
for (const i of scalars)
|
|
31764
31683
|
if (typeof i !== "bigint")
|
|
31765
|
-
throw new Error("expected array of bigints");
|
|
31766
|
-
|
|
31684
|
+
throw new Error("mapToCurve: expected array of bigints");
|
|
31685
|
+
const P = Point.fromAffine(mapToCurve(scalars)).clearCofactor();
|
|
31686
|
+
P.assertValidity();
|
|
31687
|
+
return P;
|
|
31767
31688
|
}
|
|
31768
31689
|
};
|
|
31769
31690
|
}
|
|
@@ -31794,13 +31715,12 @@ var require_montgomery = __commonJS((exports) => {
|
|
|
31794
31715
|
function montgomery(curveDef) {
|
|
31795
31716
|
const CURVE = validateOpts(curveDef);
|
|
31796
31717
|
const { P } = CURVE;
|
|
31797
|
-
const Fp = (0, modular_ts_1.Field)(P);
|
|
31798
31718
|
const modP = (n) => (0, modular_ts_1.mod)(n, P);
|
|
31799
31719
|
const montgomeryBits = CURVE.montgomeryBits;
|
|
31800
31720
|
const montgomeryBytes = Math.ceil(montgomeryBits / 8);
|
|
31801
31721
|
const fieldLen = CURVE.nByteLength;
|
|
31802
31722
|
const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes);
|
|
31803
|
-
const powPminus2 = CURVE.powPminus2 || ((x) =>
|
|
31723
|
+
const powPminus2 = CURVE.powPminus2 || ((x) => (0, modular_ts_1.pow)(x, P - BigInt(2), P));
|
|
31804
31724
|
function cswap(swap, x_2, x_3) {
|
|
31805
31725
|
const dummy = modP(swap * (x_2 - x_3));
|
|
31806
31726
|
x_2 = modP(x_2 - dummy);
|
|
@@ -31898,7 +31818,7 @@ var require_montgomery = __commonJS((exports) => {
|
|
|
31898
31818
|
// ../../node_modules/eciesjs/node_modules/@noble/curves/ed25519.js
|
|
31899
31819
|
var require_ed25519 = __commonJS((exports) => {
|
|
31900
31820
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31901
|
-
exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.RistrettoPoint = exports.encodeToCurve = exports.hashToCurve = exports.
|
|
31821
|
+
exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.RistrettoPoint = exports.encodeToCurve = exports.hashToCurve = exports.edwardsToMontgomery = exports.x25519 = exports.ed25519ph = exports.ed25519ctx = exports.ed25519 = exports.ED25519_TORSION_SUBGROUP = undefined;
|
|
31902
31822
|
exports.edwardsToMontgomeryPub = edwardsToMontgomeryPub;
|
|
31903
31823
|
exports.edwardsToMontgomeryPriv = edwardsToMontgomeryPriv;
|
|
31904
31824
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
@@ -32083,10 +32003,10 @@ var require_ed25519 = __commonJS((exports) => {
|
|
|
32083
32003
|
xd = Fp.cmov(xd, Fp.ONE, e3);
|
|
32084
32004
|
yn = Fp.cmov(yn, Fp.ONE, e3);
|
|
32085
32005
|
yd = Fp.cmov(yd, Fp.ONE, e3);
|
|
32086
|
-
const
|
|
32087
|
-
return { x: Fp.mul(xn,
|
|
32006
|
+
const inv = Fp.invertBatch([xd, yd]);
|
|
32007
|
+
return { x: Fp.mul(xn, inv[0]), y: Fp.mul(yn, inv[1]) };
|
|
32088
32008
|
}
|
|
32089
|
-
|
|
32009
|
+
var htf = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.createHasher)(exports.ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {
|
|
32090
32010
|
DST: "edwards25519_XMD:SHA-512_ELL2_RO_",
|
|
32091
32011
|
encodeDST: "edwards25519_XMD:SHA-512_ELL2_NU_",
|
|
32092
32012
|
p: Fp.ORDER,
|
|
@@ -32095,8 +32015,8 @@ var require_ed25519 = __commonJS((exports) => {
|
|
|
32095
32015
|
expand: "xmd",
|
|
32096
32016
|
hash: sha2_1.sha512
|
|
32097
32017
|
}))();
|
|
32098
|
-
exports.hashToCurve = (() =>
|
|
32099
|
-
exports.encodeToCurve = (() =>
|
|
32018
|
+
exports.hashToCurve = (() => htf.hashToCurve)();
|
|
32019
|
+
exports.encodeToCurve = (() => htf.encodeToCurve)();
|
|
32100
32020
|
function aristp(other) {
|
|
32101
32021
|
if (!(other instanceof RistPoint))
|
|
32102
32022
|
throw new Error("RistrettoPoint expected");
|
|
@@ -32266,6 +32186,7 @@ var require_ed25519 = __commonJS((exports) => {
|
|
|
32266
32186
|
var require_hmac = __commonJS((exports) => {
|
|
32267
32187
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32268
32188
|
exports.hmac = exports.HMAC = undefined;
|
|
32189
|
+
var _assert_ts_1 = require__assert();
|
|
32269
32190
|
var utils_ts_1 = require_utils7();
|
|
32270
32191
|
|
|
32271
32192
|
class HMAC extends utils_ts_1.Hash {
|
|
@@ -32273,7 +32194,7 @@ var require_hmac = __commonJS((exports) => {
|
|
|
32273
32194
|
super();
|
|
32274
32195
|
this.finished = false;
|
|
32275
32196
|
this.destroyed = false;
|
|
32276
|
-
(0,
|
|
32197
|
+
(0, _assert_ts_1.ahash)(hash);
|
|
32277
32198
|
const key = (0, utils_ts_1.toBytes)(_key);
|
|
32278
32199
|
this.iHash = hash.create();
|
|
32279
32200
|
if (typeof this.iHash.update !== "function")
|
|
@@ -32290,16 +32211,16 @@ var require_hmac = __commonJS((exports) => {
|
|
|
32290
32211
|
for (let i = 0;i < pad.length; i++)
|
|
32291
32212
|
pad[i] ^= 54 ^ 92;
|
|
32292
32213
|
this.oHash.update(pad);
|
|
32293
|
-
(0
|
|
32214
|
+
pad.fill(0);
|
|
32294
32215
|
}
|
|
32295
32216
|
update(buf) {
|
|
32296
|
-
(0,
|
|
32217
|
+
(0, _assert_ts_1.aexists)(this);
|
|
32297
32218
|
this.iHash.update(buf);
|
|
32298
32219
|
return this;
|
|
32299
32220
|
}
|
|
32300
32221
|
digestInto(out) {
|
|
32301
|
-
(0,
|
|
32302
|
-
(0,
|
|
32222
|
+
(0, _assert_ts_1.aexists)(this);
|
|
32223
|
+
(0, _assert_ts_1.abytes)(out, this.outputLen);
|
|
32303
32224
|
this.finished = true;
|
|
32304
32225
|
this.iHash.digestInto(out);
|
|
32305
32226
|
this.oHash.update(out);
|
|
@@ -32323,9 +32244,6 @@ var require_hmac = __commonJS((exports) => {
|
|
|
32323
32244
|
to.iHash = iHash._cloneInto(to.iHash);
|
|
32324
32245
|
return to;
|
|
32325
32246
|
}
|
|
32326
|
-
clone() {
|
|
32327
|
-
return this._cloneInto();
|
|
32328
|
-
}
|
|
32329
32247
|
destroy() {
|
|
32330
32248
|
this.destroyed = true;
|
|
32331
32249
|
this.oHash.destroy();
|
|
@@ -32573,7 +32491,7 @@ var require_weierstrass = __commonJS((exports) => {
|
|
|
32573
32491
|
constructor(px, py, pz) {
|
|
32574
32492
|
if (px == null || !Fp.isValid(px))
|
|
32575
32493
|
throw new Error("x required");
|
|
32576
|
-
if (py == null || !Fp.isValid(py)
|
|
32494
|
+
if (py == null || !Fp.isValid(py))
|
|
32577
32495
|
throw new Error("y required");
|
|
32578
32496
|
if (pz == null || !Fp.isValid(pz))
|
|
32579
32497
|
throw new Error("z required");
|
|
@@ -32600,7 +32518,7 @@ var require_weierstrass = __commonJS((exports) => {
|
|
|
32600
32518
|
return this.toAffine().y;
|
|
32601
32519
|
}
|
|
32602
32520
|
static normalizeZ(points) {
|
|
32603
|
-
const toInv =
|
|
32521
|
+
const toInv = Fp.invertBatch(points.map((p) => p.pz));
|
|
32604
32522
|
return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
|
|
32605
32523
|
}
|
|
32606
32524
|
static fromHex(hex) {
|
|
@@ -32961,7 +32879,7 @@ var require_weierstrass = __commonJS((exports) => {
|
|
|
32961
32879
|
return (0, utils_ts_1.hexToBytes)(this.toDERHex());
|
|
32962
32880
|
}
|
|
32963
32881
|
toDERHex() {
|
|
32964
|
-
return exports.DER.hexFromSig(this);
|
|
32882
|
+
return exports.DER.hexFromSig({ r: this.r, s: this.s });
|
|
32965
32883
|
}
|
|
32966
32884
|
toCompactRawBytes() {
|
|
32967
32885
|
return (0, utils_ts_1.hexToBytes)(this.toCompactHex());
|
|
@@ -33236,8 +33154,7 @@ var require_weierstrass = __commonJS((exports) => {
|
|
|
33236
33154
|
y = Fp.cmov(y, value, isValid2);
|
|
33237
33155
|
const e1 = Fp.isOdd(u) === Fp.isOdd(y);
|
|
33238
33156
|
y = Fp.cmov(Fp.neg(y), y, e1);
|
|
33239
|
-
|
|
33240
|
-
x = Fp.mul(x, tv4_inv);
|
|
33157
|
+
x = Fp.div(x, tv4);
|
|
33241
33158
|
return { x, y };
|
|
33242
33159
|
};
|
|
33243
33160
|
}
|
|
@@ -33268,7 +33185,7 @@ var require__shortw_utils = __commonJS((exports) => {
|
|
|
33268
33185
|
// ../../node_modules/eciesjs/node_modules/@noble/curves/secp256k1.js
|
|
33269
33186
|
var require_secp256k1 = __commonJS((exports) => {
|
|
33270
33187
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33271
|
-
exports.encodeToCurve = exports.hashToCurve = exports.
|
|
33188
|
+
exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = undefined;
|
|
33272
33189
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
33273
33190
|
var sha2_1 = require_sha2();
|
|
33274
33191
|
var utils_1 = require_utils7();
|
|
@@ -33464,7 +33381,7 @@ var require_secp256k1 = __commonJS((exports) => {
|
|
|
33464
33381
|
B: BigInt("1771"),
|
|
33465
33382
|
Z: Fpk1.create(BigInt("-11"))
|
|
33466
33383
|
}))();
|
|
33467
|
-
|
|
33384
|
+
var htf = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.ProjectivePoint, (scalars) => {
|
|
33468
33385
|
const { x, y } = mapSWU(Fpk1.create(scalars[0]));
|
|
33469
33386
|
return isoMap(x, y);
|
|
33470
33387
|
}, {
|
|
@@ -33476,8 +33393,8 @@ var require_secp256k1 = __commonJS((exports) => {
|
|
|
33476
33393
|
expand: "xmd",
|
|
33477
33394
|
hash: sha2_1.sha256
|
|
33478
33395
|
}))();
|
|
33479
|
-
exports.hashToCurve = (() =>
|
|
33480
|
-
exports.encodeToCurve = (() =>
|
|
33396
|
+
exports.hashToCurve = (() => htf.hashToCurve)();
|
|
33397
|
+
exports.encodeToCurve = (() => htf.encodeToCurve)();
|
|
33481
33398
|
});
|
|
33482
33399
|
|
|
33483
33400
|
// ../../node_modules/eciesjs/dist/utils/hex.js
|
|
@@ -33597,55 +33514,45 @@ var require_hkdf = __commonJS((exports) => {
|
|
|
33597
33514
|
exports.hkdf = undefined;
|
|
33598
33515
|
exports.extract = extract;
|
|
33599
33516
|
exports.expand = expand;
|
|
33517
|
+
var _assert_ts_1 = require__assert();
|
|
33600
33518
|
var hmac_ts_1 = require_hmac();
|
|
33601
33519
|
var utils_ts_1 = require_utils7();
|
|
33602
33520
|
function extract(hash, ikm, salt) {
|
|
33603
|
-
(0,
|
|
33521
|
+
(0, _assert_ts_1.ahash)(hash);
|
|
33604
33522
|
if (salt === undefined)
|
|
33605
33523
|
salt = new Uint8Array(hash.outputLen);
|
|
33606
33524
|
return (0, hmac_ts_1.hmac)(hash, (0, utils_ts_1.toBytes)(salt), (0, utils_ts_1.toBytes)(ikm));
|
|
33607
33525
|
}
|
|
33608
|
-
var HKDF_COUNTER = /* @__PURE__ */ Uint8Array
|
|
33609
|
-
var EMPTY_BUFFER = /* @__PURE__ */ Uint8Array
|
|
33526
|
+
var HKDF_COUNTER = /* @__PURE__ */ new Uint8Array([0]);
|
|
33527
|
+
var EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array;
|
|
33610
33528
|
function expand(hash, prk, info, length = 32) {
|
|
33611
|
-
(0,
|
|
33612
|
-
(0,
|
|
33613
|
-
|
|
33614
|
-
if (length > 255 * olen)
|
|
33529
|
+
(0, _assert_ts_1.ahash)(hash);
|
|
33530
|
+
(0, _assert_ts_1.anumber)(length);
|
|
33531
|
+
if (length > 255 * hash.outputLen)
|
|
33615
33532
|
throw new Error("Length should be <= 255*HashLen");
|
|
33616
|
-
const blocks = Math.ceil(length /
|
|
33533
|
+
const blocks = Math.ceil(length / hash.outputLen);
|
|
33617
33534
|
if (info === undefined)
|
|
33618
33535
|
info = EMPTY_BUFFER;
|
|
33619
|
-
const okm = new Uint8Array(blocks *
|
|
33536
|
+
const okm = new Uint8Array(blocks * hash.outputLen);
|
|
33620
33537
|
const HMAC = hmac_ts_1.hmac.create(hash, prk);
|
|
33621
33538
|
const HMACTmp = HMAC._cloneInto();
|
|
33622
33539
|
const T = new Uint8Array(HMAC.outputLen);
|
|
33623
33540
|
for (let counter = 0;counter < blocks; counter++) {
|
|
33624
33541
|
HKDF_COUNTER[0] = counter + 1;
|
|
33625
33542
|
HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T).update(info).update(HKDF_COUNTER).digestInto(T);
|
|
33626
|
-
okm.set(T,
|
|
33543
|
+
okm.set(T, hash.outputLen * counter);
|
|
33627
33544
|
HMAC._cloneInto(HMACTmp);
|
|
33628
33545
|
}
|
|
33629
33546
|
HMAC.destroy();
|
|
33630
33547
|
HMACTmp.destroy();
|
|
33631
|
-
(0
|
|
33548
|
+
T.fill(0);
|
|
33549
|
+
HKDF_COUNTER.fill(0);
|
|
33632
33550
|
return okm.slice(0, length);
|
|
33633
33551
|
}
|
|
33634
33552
|
var hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length);
|
|
33635
33553
|
exports.hkdf = hkdf;
|
|
33636
33554
|
});
|
|
33637
33555
|
|
|
33638
|
-
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
|
|
33639
|
-
var require_sha256 = __commonJS((exports) => {
|
|
33640
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33641
|
-
exports.sha224 = exports.SHA224 = exports.sha256 = exports.SHA256 = undefined;
|
|
33642
|
-
var sha2_ts_1 = require_sha2();
|
|
33643
|
-
exports.SHA256 = sha2_ts_1.SHA256;
|
|
33644
|
-
exports.sha256 = sha2_ts_1.sha256;
|
|
33645
|
-
exports.SHA224 = sha2_ts_1.SHA224;
|
|
33646
|
-
exports.sha224 = sha2_ts_1.sha224;
|
|
33647
|
-
});
|
|
33648
|
-
|
|
33649
33556
|
// ../../node_modules/eciesjs/dist/utils/hash.js
|
|
33650
33557
|
var require_hash = __commonJS((exports) => {
|
|
33651
33558
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -56057,6 +55964,12 @@ class McpServer {
|
|
|
56057
55964
|
if (this._registeredTools[name]) {
|
|
56058
55965
|
throw new Error(`Tool ${name} is already registered`);
|
|
56059
55966
|
}
|
|
55967
|
+
const isZodRawShape = (obj) => {
|
|
55968
|
+
if (typeof obj !== "object" || obj === null)
|
|
55969
|
+
return false;
|
|
55970
|
+
const isEmptyObject = z.object({}).strict().safeParse(obj).success;
|
|
55971
|
+
return isEmptyObject || Object.values(obj).some((v) => v instanceof ZodType);
|
|
55972
|
+
};
|
|
56060
55973
|
let description;
|
|
56061
55974
|
if (typeof rest[0] === "string") {
|
|
56062
55975
|
description = rest.shift();
|
|
@@ -56173,15 +56086,6 @@ class McpServer {
|
|
|
56173
56086
|
var EMPTY_OBJECT_JSON_SCHEMA = {
|
|
56174
56087
|
type: "object"
|
|
56175
56088
|
};
|
|
56176
|
-
function isZodRawShape(obj) {
|
|
56177
|
-
if (typeof obj !== "object" || obj === null)
|
|
56178
|
-
return false;
|
|
56179
|
-
const isEmptyObject = Object.keys(obj).length === 0;
|
|
56180
|
-
return isEmptyObject || Object.values(obj).some(isZodTypeLike);
|
|
56181
|
-
}
|
|
56182
|
-
function isZodTypeLike(value) {
|
|
56183
|
-
return value !== null && typeof value === "object" && "parse" in value && typeof value.parse === "function" && "safeParse" in value && typeof value.safeParse === "function";
|
|
56184
|
-
}
|
|
56185
56089
|
function promptArgumentsFromSchema(schema) {
|
|
56186
56090
|
return Object.entries(schema.shape).map(([name, field]) => ({
|
|
56187
56091
|
name,
|
|
@@ -61719,9 +61623,7 @@ var DotEnvSchema = z.object({
|
|
|
61719
61623
|
SETTLEMINT_PORTAL: UniqueNameSchema.optional(),
|
|
61720
61624
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema.optional(),
|
|
61721
61625
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema.optional(),
|
|
61722
|
-
SETTLEMINT_PORTAL_WS_ENDPOINT: UrlSchema.optional(),
|
|
61723
61626
|
SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema.optional(),
|
|
61724
|
-
SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS: z.string().optional(),
|
|
61725
61627
|
SETTLEMINT_ACCESSIBLE_PRIVATE_KEY: UniqueNameSchema.optional(),
|
|
61726
61628
|
SETTLEMINT_MINIO: UniqueNameSchema.optional(),
|
|
61727
61629
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema.optional(),
|
|
@@ -61829,9 +61731,7 @@ var DotEnvSchema2 = z.object({
|
|
|
61829
61731
|
SETTLEMINT_PORTAL: UniqueNameSchema2.optional(),
|
|
61830
61732
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
|
61831
61733
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
|
|
61832
|
-
SETTLEMINT_PORTAL_WS_ENDPOINT: UrlSchema2.optional(),
|
|
61833
61734
|
SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema2.optional(),
|
|
61834
|
-
SETTLEMINT_HD_PRIVATE_KEY_FORWARDER_ADDRESS: z.string().optional(),
|
|
61835
61735
|
SETTLEMINT_ACCESSIBLE_PRIVATE_KEY: UniqueNameSchema2.optional(),
|
|
61836
61736
|
SETTLEMINT_MINIO: UniqueNameSchema2.optional(),
|
|
61837
61737
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema2.optional(),
|
|
@@ -61874,7 +61774,7 @@ var {
|
|
|
61874
61774
|
var package_default = {
|
|
61875
61775
|
name: "@settlemint/sdk-mcp",
|
|
61876
61776
|
description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
61877
|
-
version: "2.2.3-
|
|
61777
|
+
version: "2.2.3-prf8d0b522",
|
|
61878
61778
|
type: "module",
|
|
61879
61779
|
private: false,
|
|
61880
61780
|
license: "FSL-1.1-MIT",
|
|
@@ -61915,9 +61815,9 @@ var package_default = {
|
|
|
61915
61815
|
dependencies: {
|
|
61916
61816
|
"@graphql-tools/load": "8.1.0",
|
|
61917
61817
|
"@graphql-tools/url-loader": "8.0.31",
|
|
61918
|
-
"@modelcontextprotocol/sdk": "1.11.
|
|
61919
|
-
"@settlemint/sdk-js": "2.2.3-
|
|
61920
|
-
"@settlemint/sdk-utils": "2.2.3-
|
|
61818
|
+
"@modelcontextprotocol/sdk": "1.11.1",
|
|
61819
|
+
"@settlemint/sdk-js": "2.2.3-prf8d0b522",
|
|
61820
|
+
"@settlemint/sdk-utils": "2.2.3-prf8d0b522",
|
|
61921
61821
|
"@commander-js/extra-typings": "11.1.0",
|
|
61922
61822
|
commander: "11.1.0",
|
|
61923
61823
|
zod: "3.24.4"
|
|
@@ -65567,12 +65467,7 @@ var getPlatformConfigQuery = graphql(`
|
|
|
65567
65467
|
disabled
|
|
65568
65468
|
}
|
|
65569
65469
|
}
|
|
65570
|
-
|
|
65571
|
-
id
|
|
65572
|
-
featureflagged
|
|
65573
|
-
abis
|
|
65574
|
-
label
|
|
65575
|
-
}
|
|
65470
|
+
preDeployedContracts
|
|
65576
65471
|
sdkVersion
|
|
65577
65472
|
kits {
|
|
65578
65473
|
id
|
|
@@ -65601,15 +65496,6 @@ var PrivateKeyFragment = graphql(`
|
|
|
65601
65496
|
provider
|
|
65602
65497
|
region
|
|
65603
65498
|
address
|
|
65604
|
-
trustedForwarderName
|
|
65605
|
-
trustedForwarderAddress
|
|
65606
|
-
relayerKey {
|
|
65607
|
-
... on PrivateKey {
|
|
65608
|
-
id
|
|
65609
|
-
name
|
|
65610
|
-
uniqueName
|
|
65611
|
-
}
|
|
65612
|
-
}
|
|
65613
65499
|
blockchainNodes {
|
|
65614
65500
|
... on BlockchainNode {
|
|
65615
65501
|
id
|
|
@@ -65645,9 +65531,6 @@ var createPrivateKey = graphql(`
|
|
|
65645
65531
|
$size: ClusterServiceSize
|
|
65646
65532
|
$type: ClusterServiceType
|
|
65647
65533
|
$blockchainNodes: [ID!]
|
|
65648
|
-
$trustedForwarderName: String
|
|
65649
|
-
$trustedForwarderAddress: String
|
|
65650
|
-
$relayerKey: ID
|
|
65651
65534
|
) {
|
|
65652
65535
|
createPrivateKey(
|
|
65653
65536
|
applicationId: $applicationId
|
|
@@ -65658,9 +65541,6 @@ var createPrivateKey = graphql(`
|
|
|
65658
65541
|
size: $size
|
|
65659
65542
|
type: $type
|
|
65660
65543
|
blockchainNodes: $blockchainNodes
|
|
65661
|
-
trustedForwarderName: $trustedForwarderName
|
|
65662
|
-
trustedForwarderAddress: $trustedForwarderAddress
|
|
65663
|
-
relayerKey: $relayerKey
|
|
65664
65544
|
) {
|
|
65665
65545
|
...PrivateKey
|
|
65666
65546
|
}
|
|
@@ -65691,10 +65571,9 @@ var privatekeyRead = (gqlClient) => {
|
|
|
65691
65571
|
};
|
|
65692
65572
|
var privateKeyCreate = (gqlClient) => {
|
|
65693
65573
|
return async (args) => {
|
|
65694
|
-
const { applicationUniqueName, blockchainNodeUniqueNames,
|
|
65574
|
+
const { applicationUniqueName, blockchainNodeUniqueNames, ...otherArgs } = args;
|
|
65695
65575
|
const application = await applicationRead(gqlClient)(applicationUniqueName);
|
|
65696
65576
|
const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName))) : [];
|
|
65697
|
-
const relayerKey = relayerKeyUniqueName ? await privatekeyRead(gqlClient)(relayerKeyUniqueName) : undefined;
|
|
65698
65577
|
const platformConfig = await getPlatformConfig(gqlClient)();
|
|
65699
65578
|
const defaultProvider = platformConfig.deploymentEngineTargets.find((target) => !target.disabled && target.clusters.some((cluster) => !cluster.disabled));
|
|
65700
65579
|
const defaultRegion = defaultProvider?.clusters.find((cluster) => !cluster.disabled);
|
|
@@ -65702,7 +65581,6 @@ var privateKeyCreate = (gqlClient) => {
|
|
|
65702
65581
|
...otherArgs,
|
|
65703
65582
|
applicationId: application.id,
|
|
65704
65583
|
blockchainNodes: blockchainNodes.map((node) => node?.id),
|
|
65705
|
-
relayerKey: relayerKey?.id,
|
|
65706
65584
|
provider: defaultProvider?.id ?? "gke",
|
|
65707
65585
|
region: defaultRegion?.id?.split("-")[1] ?? "europe",
|
|
65708
65586
|
size: "SMALL",
|
|
@@ -67687,4 +67565,4 @@ await main().catch((error2) => {
|
|
|
67687
67565
|
process.exit(1);
|
|
67688
67566
|
});
|
|
67689
67567
|
|
|
67690
|
-
//# debugId=
|
|
67568
|
+
//# debugId=2513152E5515B69964756E2164756E21
|