@smithy/signature-v4a 3.0.4 → 3.0.6

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-cjs/index.js CHANGED
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  SignatureV4a: () => SignatureV4a
24
24
  });
25
- module.exports = __toCommonJS(src_exports);
25
+ module.exports = __toCommonJS(index_exports);
26
26
  var import_signature_v49 = require("@smithy/signature-v4");
27
27
 
28
28
  // src/SignatureV4a.ts
@@ -162,7 +162,7 @@ var __copyProps2 = /* @__PURE__ */ __name((to, from, except, desc) => {
162
162
  for (let key of __getOwnPropNames2(from))
163
163
  if (!__hasOwnProp2.call(to, key) && key !== except)
164
164
  __defProp2(to, key, {
165
- get: () => from[key],
165
+ get: /* @__PURE__ */ __name(() => from[key], "get"),
166
166
  enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
167
167
  });
168
168
  }
@@ -238,8 +238,7 @@ var require_bn = __commonJS({
238
238
  (function(module22, exports22) {
239
239
  "use strict";
240
240
  function assert(val, msg) {
241
- if (!val)
242
- throw new Error(msg || "Assertion failed");
241
+ if (!val) throw new Error(msg || "Assertion failed");
243
242
  }
244
243
  __name(assert, "assert");
245
244
  function inherits(ctor, superCtor) {
@@ -291,13 +290,11 @@ var require_bn = __commonJS({
291
290
  return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
292
291
  }, "isBN");
293
292
  BN.max = /* @__PURE__ */ __name(function max(left, right) {
294
- if (left.cmp(right) > 0)
295
- return left;
293
+ if (left.cmp(right) > 0) return left;
296
294
  return right;
297
295
  }, "max");
298
296
  BN.min = /* @__PURE__ */ __name(function min(left, right) {
299
- if (left.cmp(right) < 0)
300
- return left;
297
+ if (left.cmp(right) < 0) return left;
301
298
  return right;
302
299
  }, "min");
303
300
  BN.prototype._init = /* @__PURE__ */ __name(function init(number, base, endian) {
@@ -344,8 +341,7 @@ var require_bn = __commonJS({
344
341
  this.words = [number & 67108863, number / 67108864 & 67108863, 1];
345
342
  this.length = 3;
346
343
  }
347
- if (endian !== "le")
348
- return;
344
+ if (endian !== "le") return;
349
345
  this._initArray(this.toArray(), base, endian);
350
346
  }, "_initNumber");
351
347
  BN.prototype._initArray = /* @__PURE__ */ __name(function _initArray(number, base, endian) {
@@ -779,8 +775,7 @@ var require_bn = __commonJS({
779
775
  }, "_countBits");
780
776
  }
781
777
  BN.prototype._zeroBits = /* @__PURE__ */ __name(function _zeroBits(w) {
782
- if (w === 0)
783
- return 26;
778
+ if (w === 0) return 26;
784
779
  var t = w;
785
780
  var r = 0;
786
781
  if ((t & 8191) === 0) {
@@ -820,14 +815,12 @@ var require_bn = __commonJS({
820
815
  }
821
816
  __name(toBitArray, "toBitArray");
822
817
  BN.prototype.zeroBits = /* @__PURE__ */ __name(function zeroBits() {
823
- if (this.isZero())
824
- return 0;
818
+ if (this.isZero()) return 0;
825
819
  var r = 0;
826
820
  for (var i = 0; i < this.length; i++) {
827
821
  var b = this._zeroBits(this.words[i]);
828
822
  r += b;
829
- if (b !== 26)
830
- break;
823
+ if (b !== 26) break;
831
824
  }
832
825
  return r;
833
826
  }, "zeroBits");
@@ -872,13 +865,11 @@ var require_bn = __commonJS({
872
865
  return this.iuor(num);
873
866
  }, "ior");
874
867
  BN.prototype.or = /* @__PURE__ */ __name(function or(num) {
875
- if (this.length > num.length)
876
- return this.clone().ior(num);
868
+ if (this.length > num.length) return this.clone().ior(num);
877
869
  return num.clone().ior(this);
878
870
  }, "or");
879
871
  BN.prototype.uor = /* @__PURE__ */ __name(function uor(num) {
880
- if (this.length > num.length)
881
- return this.clone().iuor(num);
872
+ if (this.length > num.length) return this.clone().iuor(num);
882
873
  return num.clone().iuor(this);
883
874
  }, "uor");
884
875
  BN.prototype.iuand = /* @__PURE__ */ __name(function iuand(num) {
@@ -899,13 +890,11 @@ var require_bn = __commonJS({
899
890
  return this.iuand(num);
900
891
  }, "iand");
901
892
  BN.prototype.and = /* @__PURE__ */ __name(function and(num) {
902
- if (this.length > num.length)
903
- return this.clone().iand(num);
893
+ if (this.length > num.length) return this.clone().iand(num);
904
894
  return num.clone().iand(this);
905
895
  }, "and");
906
896
  BN.prototype.uand = /* @__PURE__ */ __name(function uand(num) {
907
- if (this.length > num.length)
908
- return this.clone().iuand(num);
897
+ if (this.length > num.length) return this.clone().iuand(num);
909
898
  return num.clone().iuand(this);
910
899
  }, "uand");
911
900
  BN.prototype.iuxor = /* @__PURE__ */ __name(function iuxor(num) {
@@ -934,13 +923,11 @@ var require_bn = __commonJS({
934
923
  return this.iuxor(num);
935
924
  }, "ixor");
936
925
  BN.prototype.xor = /* @__PURE__ */ __name(function xor(num) {
937
- if (this.length > num.length)
938
- return this.clone().ixor(num);
926
+ if (this.length > num.length) return this.clone().ixor(num);
939
927
  return num.clone().ixor(this);
940
928
  }, "xor");
941
929
  BN.prototype.uxor = /* @__PURE__ */ __name(function uxor(num) {
942
- if (this.length > num.length)
943
- return this.clone().iuxor(num);
930
+ if (this.length > num.length) return this.clone().iuxor(num);
944
931
  return num.clone().iuxor(this);
945
932
  }, "uxor");
946
933
  BN.prototype.inotn = /* @__PURE__ */ __name(function inotn(width) {
@@ -1030,8 +1017,7 @@ var require_bn = __commonJS({
1030
1017
  this.negative = 1;
1031
1018
  return res;
1032
1019
  }
1033
- if (this.length > num.length)
1034
- return this.clone().iadd(num);
1020
+ if (this.length > num.length) return this.clone().iadd(num);
1035
1021
  return num.clone().iadd(this);
1036
1022
  }, "add");
1037
1023
  BN.prototype.isub = /* @__PURE__ */ __name(function isub(num) {
@@ -1743,8 +1729,7 @@ var require_bn = __commonJS({
1743
1729
  return t;
1744
1730
  }, "makeRBT");
1745
1731
  FFTM.prototype.revBin = /* @__PURE__ */ __name(function revBin(x, l, N) {
1746
- if (x === 0 || x === N - 1)
1747
- return x;
1732
+ if (x === 0 || x === N - 1) return x;
1748
1733
  var rb = 0;
1749
1734
  for (var i = 0; i < l; i++) {
1750
1735
  rb |= (x & 1) << l - i - 1;
@@ -1798,8 +1783,7 @@ var require_bn = __commonJS({
1798
1783
  return 1 << i + 1 + odd;
1799
1784
  }, "guessLen13b");
1800
1785
  FFTM.prototype.conjugate = /* @__PURE__ */ __name(function conjugate(rws, iws, N) {
1801
- if (N <= 1)
1802
- return;
1786
+ if (N <= 1) return;
1803
1787
  for (var i = 0; i < N / 2; i++) {
1804
1788
  var t = rws[i];
1805
1789
  rws[i] = rws[N - i - 1];
@@ -1915,17 +1899,14 @@ var require_bn = __commonJS({
1915
1899
  }, "isqr");
1916
1900
  BN.prototype.pow = /* @__PURE__ */ __name(function pow(num) {
1917
1901
  var w = toBitArray(num);
1918
- if (w.length === 0)
1919
- return new BN(1);
1902
+ if (w.length === 0) return new BN(1);
1920
1903
  var res = this;
1921
1904
  for (var i = 0; i < w.length; i++, res = res.sqr()) {
1922
- if (w[i] !== 0)
1923
- break;
1905
+ if (w[i] !== 0) break;
1924
1906
  }
1925
1907
  if (++i < w.length) {
1926
1908
  for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
1927
- if (w[i] === 0)
1928
- continue;
1909
+ if (w[i] === 0) continue;
1929
1910
  res = res.mul(q);
1930
1911
  }
1931
1912
  }
@@ -2031,8 +2012,7 @@ var require_bn = __commonJS({
2031
2012
  var r = bit % 26;
2032
2013
  var s = (bit - r) / 26;
2033
2014
  var q = 1 << r;
2034
- if (this.length <= s)
2035
- return false;
2015
+ if (this.length <= s) return false;
2036
2016
  var w = this.words[s];
2037
2017
  return !!(w & q);
2038
2018
  }, "testn");
@@ -2060,8 +2040,7 @@ var require_bn = __commonJS({
2060
2040
  BN.prototype.iaddn = /* @__PURE__ */ __name(function iaddn(num) {
2061
2041
  assert(typeof num === "number");
2062
2042
  assert(num < 67108864);
2063
- if (num < 0)
2064
- return this.isubn(-num);
2043
+ if (num < 0) return this.isubn(-num);
2065
2044
  if (this.negative !== 0) {
2066
2045
  if (this.length === 1 && (this.words[0] | 0) < num) {
2067
2046
  this.words[0] = num - (this.words[0] | 0);
@@ -2091,8 +2070,7 @@ var require_bn = __commonJS({
2091
2070
  BN.prototype.isubn = /* @__PURE__ */ __name(function isubn(num) {
2092
2071
  assert(typeof num === "number");
2093
2072
  assert(num < 67108864);
2094
- if (num < 0)
2095
- return this.iaddn(-num);
2073
+ if (num < 0) return this.iaddn(-num);
2096
2074
  if (this.negative !== 0) {
2097
2075
  this.negative = 0;
2098
2076
  this.iaddn(num);
@@ -2142,8 +2120,7 @@ var require_bn = __commonJS({
2142
2120
  carry = w >> 26;
2143
2121
  this.words[i + shift] = w & 67108863;
2144
2122
  }
2145
- if (carry === 0)
2146
- return this.strip();
2123
+ if (carry === 0) return this.strip();
2147
2124
  assert(carry === -1);
2148
2125
  carry = 0;
2149
2126
  for (i = 0; i < this.length; i++) {
@@ -2296,14 +2273,12 @@ var require_bn = __commonJS({
2296
2273
  }, "umod");
2297
2274
  BN.prototype.divRound = /* @__PURE__ */ __name(function divRound(num) {
2298
2275
  var dm = this.divmod(num);
2299
- if (dm.mod.isZero())
2300
- return dm.div;
2276
+ if (dm.mod.isZero()) return dm.div;
2301
2277
  var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
2302
2278
  var half = num.ushrn(1);
2303
2279
  var r2 = num.andln(1);
2304
2280
  var cmp = mod.cmp(half);
2305
- if (cmp < 0 || r2 === 1 && cmp === 0)
2306
- return dm.div;
2281
+ if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
2307
2282
  return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
2308
2283
  }, "divRound");
2309
2284
  BN.prototype.modn = /* @__PURE__ */ __name(function modn(num) {
@@ -2351,8 +2326,7 @@ var require_bn = __commonJS({
2351
2326
  var yp = y.clone();
2352
2327
  var xp = x.clone();
2353
2328
  while (!x.isZero()) {
2354
- for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1)
2355
- ;
2329
+ for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
2356
2330
  if (i > 0) {
2357
2331
  x.iushrn(i);
2358
2332
  while (i-- > 0) {
@@ -2364,8 +2338,7 @@ var require_bn = __commonJS({
2364
2338
  B.iushrn(1);
2365
2339
  }
2366
2340
  }
2367
- for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)
2368
- ;
2341
+ for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
2369
2342
  if (j > 0) {
2370
2343
  y.iushrn(j);
2371
2344
  while (j-- > 0) {
@@ -2407,8 +2380,7 @@ var require_bn = __commonJS({
2407
2380
  var x2 = new BN(0);
2408
2381
  var delta = b.clone();
2409
2382
  while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
2410
- for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1)
2411
- ;
2383
+ for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
2412
2384
  if (i > 0) {
2413
2385
  a.iushrn(i);
2414
2386
  while (i-- > 0) {
@@ -2418,8 +2390,7 @@ var require_bn = __commonJS({
2418
2390
  x1.iushrn(1);
2419
2391
  }
2420
2392
  }
2421
- for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1)
2422
- ;
2393
+ for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
2423
2394
  if (j > 0) {
2424
2395
  b.iushrn(j);
2425
2396
  while (j-- > 0) {
@@ -2449,10 +2420,8 @@ var require_bn = __commonJS({
2449
2420
  return res;
2450
2421
  }, "_invmp");
2451
2422
  BN.prototype.gcd = /* @__PURE__ */ __name(function gcd(num) {
2452
- if (this.isZero())
2453
- return num.abs();
2454
- if (num.isZero())
2455
- return this.abs();
2423
+ if (this.isZero()) return num.abs();
2424
+ if (num.isZero()) return this.abs();
2456
2425
  var a = this.clone();
2457
2426
  var b = num.clone();
2458
2427
  a.negative = 0;
@@ -2521,10 +2490,8 @@ var require_bn = __commonJS({
2521
2490
  }, "isZero");
2522
2491
  BN.prototype.cmpn = /* @__PURE__ */ __name(function cmpn(num) {
2523
2492
  var negative = num < 0;
2524
- if (this.negative !== 0 && !negative)
2525
- return -1;
2526
- if (this.negative === 0 && negative)
2527
- return 1;
2493
+ if (this.negative !== 0 && !negative) return -1;
2494
+ if (this.negative === 0 && negative) return 1;
2528
2495
  this.strip();
2529
2496
  var res;
2530
2497
  if (this.length > 1) {
@@ -2537,31 +2504,24 @@ var require_bn = __commonJS({
2537
2504
  var w = this.words[0] | 0;
2538
2505
  res = w === num ? 0 : w < num ? -1 : 1;
2539
2506
  }
2540
- if (this.negative !== 0)
2541
- return -res | 0;
2507
+ if (this.negative !== 0) return -res | 0;
2542
2508
  return res;
2543
2509
  }, "cmpn");
2544
2510
  BN.prototype.cmp = /* @__PURE__ */ __name(function cmp(num) {
2545
- if (this.negative !== 0 && num.negative === 0)
2546
- return -1;
2547
- if (this.negative === 0 && num.negative !== 0)
2548
- return 1;
2511
+ if (this.negative !== 0 && num.negative === 0) return -1;
2512
+ if (this.negative === 0 && num.negative !== 0) return 1;
2549
2513
  var res = this.ucmp(num);
2550
- if (this.negative !== 0)
2551
- return -res | 0;
2514
+ if (this.negative !== 0) return -res | 0;
2552
2515
  return res;
2553
2516
  }, "cmp");
2554
2517
  BN.prototype.ucmp = /* @__PURE__ */ __name(function ucmp(num) {
2555
- if (this.length > num.length)
2556
- return 1;
2557
- if (this.length < num.length)
2558
- return -1;
2518
+ if (this.length > num.length) return 1;
2519
+ if (this.length < num.length) return -1;
2559
2520
  var res = 0;
2560
2521
  for (var i = this.length - 1; i >= 0; i--) {
2561
2522
  var a = this.words[i] | 0;
2562
2523
  var b = num.words[i] | 0;
2563
- if (a === b)
2564
- continue;
2524
+ if (a === b) continue;
2565
2525
  if (a < b) {
2566
2526
  res = -1;
2567
2527
  } else if (a > b) {
@@ -2811,8 +2771,7 @@ var require_bn = __commonJS({
2811
2771
  return num;
2812
2772
  }, "imulK");
2813
2773
  BN._prime = /* @__PURE__ */ __name(function prime(name) {
2814
- if (primes[name])
2815
- return primes[name];
2774
+ if (primes[name]) return primes[name];
2816
2775
  var prime2;
2817
2776
  if (name === "k256") {
2818
2777
  prime2 = new K256();
@@ -2849,8 +2808,7 @@ var require_bn = __commonJS({
2849
2808
  assert(a.red && a.red === b.red, "red works only with red numbers");
2850
2809
  }, "_verify2");
2851
2810
  Red.prototype.imod = /* @__PURE__ */ __name(function imod(a) {
2852
- if (this.prime)
2853
- return this.prime.ireduce(a)._forceRed(this);
2811
+ if (this.prime) return this.prime.ireduce(a)._forceRed(this);
2854
2812
  return a.umod(this.m)._forceRed(this);
2855
2813
  }, "imod");
2856
2814
  Red.prototype.neg = /* @__PURE__ */ __name(function neg(a) {
@@ -2910,8 +2868,7 @@ var require_bn = __commonJS({
2910
2868
  return this.mul(a, a);
2911
2869
  }, "sqr");
2912
2870
  Red.prototype.sqrt = /* @__PURE__ */ __name(function sqrt(a) {
2913
- if (a.isZero())
2914
- return a.clone();
2871
+ if (a.isZero()) return a.clone();
2915
2872
  var mod3 = this.m.andln(3);
2916
2873
  assert(mod3 % 2 === 1);
2917
2874
  if (mod3 === 3) {
@@ -2961,10 +2918,8 @@ var require_bn = __commonJS({
2961
2918
  }
2962
2919
  }, "invm");
2963
2920
  Red.prototype.pow = /* @__PURE__ */ __name(function pow(a, num) {
2964
- if (num.isZero())
2965
- return new BN(1).toRed(this);
2966
- if (num.cmpn(1) === 0)
2967
- return a.clone();
2921
+ if (num.isZero()) return new BN(1).toRed(this);
2922
+ if (num.cmpn(1) === 0) return a.clone();
2968
2923
  var windowSize = 4;
2969
2924
  var wnd = new Array(1 << windowSize);
2970
2925
  wnd[0] = new BN(1).toRed(this);
@@ -2993,8 +2948,7 @@ var require_bn = __commonJS({
2993
2948
  current <<= 1;
2994
2949
  current |= bit;
2995
2950
  currentLen++;
2996
- if (currentLen !== windowSize && (i !== 0 || j !== 0))
2997
- continue;
2951
+ if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
2998
2952
  res = this.mul(res, wnd[current]);
2999
2953
  currentLen = 0;
3000
2954
  current = 0;
@@ -3056,8 +3010,7 @@ var require_bn = __commonJS({
3056
3010
  return res._forceRed(this);
3057
3011
  }, "imul");
3058
3012
  Mont.prototype.mul = /* @__PURE__ */ __name(function mul(a, b) {
3059
- if (a.isZero() || b.isZero())
3060
- return new BN(0)._forceRed(this);
3013
+ if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
3061
3014
  var t = a.mul(b);
3062
3015
  var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
3063
3016
  var u = t.isub(c).iushrn(this.shift);
@@ -3080,13 +3033,11 @@ var require_minimalistic_assert = __commonJS({
3080
3033
  "../../node_modules/minimalistic-assert/index.js"(exports2, module2) {
3081
3034
  module2.exports = assert;
3082
3035
  function assert(val, msg) {
3083
- if (!val)
3084
- throw new Error(msg || "Assertion failed");
3036
+ if (!val) throw new Error(msg || "Assertion failed");
3085
3037
  }
3086
3038
  __name(assert, "assert");
3087
3039
  assert.equal = /* @__PURE__ */ __name(function assertEqual(l, r, msg) {
3088
- if (l != r)
3089
- throw new Error(msg || "Assertion failed: " + l + " != " + r);
3040
+ if (l != r) throw new Error(msg || "Assertion failed: " + l + " != " + r);
3090
3041
  }, "assertEqual");
3091
3042
  }
3092
3043
  });
@@ -3095,31 +3046,24 @@ var require_utils = __commonJS({
3095
3046
  "use strict";
3096
3047
  var utils = exports2;
3097
3048
  function toArray(msg, enc) {
3098
- if (Array.isArray(msg))
3099
- return msg.slice();
3100
- if (!msg)
3101
- return [];
3049
+ if (Array.isArray(msg)) return msg.slice();
3050
+ if (!msg) return [];
3102
3051
  var res = [];
3103
3052
  if (typeof msg !== "string") {
3104
- for (var i = 0; i < msg.length; i++)
3105
- res[i] = msg[i] | 0;
3053
+ for (var i = 0; i < msg.length; i++) res[i] = msg[i] | 0;
3106
3054
  return res;
3107
3055
  }
3108
3056
  if (enc === "hex") {
3109
3057
  msg = msg.replace(/[^a-z0-9]+/gi, "");
3110
- if (msg.length % 2 !== 0)
3111
- msg = "0" + msg;
3112
- for (var i = 0; i < msg.length; i += 2)
3113
- res.push(parseInt(msg[i] + msg[i + 1], 16));
3058
+ if (msg.length % 2 !== 0) msg = "0" + msg;
3059
+ for (var i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));
3114
3060
  } else {
3115
3061
  for (var i = 0; i < msg.length; i++) {
3116
3062
  var c = msg.charCodeAt(i);
3117
3063
  var hi = c >> 8;
3118
3064
  var lo = c & 255;
3119
- if (hi)
3120
- res.push(hi, lo);
3121
- else
3122
- res.push(lo);
3065
+ if (hi) res.push(hi, lo);
3066
+ else res.push(lo);
3123
3067
  }
3124
3068
  }
3125
3069
  return res;
@@ -3127,26 +3071,21 @@ var require_utils = __commonJS({
3127
3071
  __name(toArray, "toArray");
3128
3072
  utils.toArray = toArray;
3129
3073
  function zero2(word) {
3130
- if (word.length === 1)
3131
- return "0" + word;
3132
- else
3133
- return word;
3074
+ if (word.length === 1) return "0" + word;
3075
+ else return word;
3134
3076
  }
3135
3077
  __name(zero2, "zero2");
3136
3078
  utils.zero2 = zero2;
3137
3079
  function toHex2(msg) {
3138
3080
  var res = "";
3139
- for (var i = 0; i < msg.length; i++)
3140
- res += zero2(msg[i].toString(16));
3081
+ for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));
3141
3082
  return res;
3142
3083
  }
3143
3084
  __name(toHex2, "toHex");
3144
3085
  utils.toHex = toHex2;
3145
3086
  utils.encode = /* @__PURE__ */ __name(function encode(arr, enc) {
3146
- if (enc === "hex")
3147
- return toHex2(arr);
3148
- else
3149
- return arr;
3087
+ if (enc === "hex") return toHex2(arr);
3088
+ else return arr;
3150
3089
  }, "encode");
3151
3090
  }
3152
3091
  });
@@ -3174,10 +3113,8 @@ var require_utils2 = __commonJS({
3174
3113
  var z;
3175
3114
  var mod = k.andln(ws - 1);
3176
3115
  if (k.isOdd()) {
3177
- if (mod > (ws >> 1) - 1)
3178
- z = (ws >> 1) - mod;
3179
- else
3180
- z = mod;
3116
+ if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod;
3117
+ else z = mod;
3181
3118
  k.isubn(z);
3182
3119
  } else {
3183
3120
  z = 0;
@@ -3199,19 +3136,15 @@ var require_utils2 = __commonJS({
3199
3136
  while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
3200
3137
  var m14 = k1.andln(3) + d1 & 3;
3201
3138
  var m24 = k2.andln(3) + d2 & 3;
3202
- if (m14 === 3)
3203
- m14 = -1;
3204
- if (m24 === 3)
3205
- m24 = -1;
3139
+ if (m14 === 3) m14 = -1;
3140
+ if (m24 === 3) m24 = -1;
3206
3141
  var u1;
3207
3142
  if ((m14 & 1) === 0) {
3208
3143
  u1 = 0;
3209
3144
  } else {
3210
3145
  m8 = k1.andln(7) + d1 & 7;
3211
- if ((m8 === 3 || m8 === 5) && m24 === 2)
3212
- u1 = -m14;
3213
- else
3214
- u1 = m14;
3146
+ if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14;
3147
+ else u1 = m14;
3215
3148
  }
3216
3149
  jsf[0].push(u1);
3217
3150
  var u2;
@@ -3219,16 +3152,12 @@ var require_utils2 = __commonJS({
3219
3152
  u2 = 0;
3220
3153
  } else {
3221
3154
  m8 = k2.andln(7) + d2 & 7;
3222
- if ((m8 === 3 || m8 === 5) && m14 === 2)
3223
- u2 = -m24;
3224
- else
3225
- u2 = m24;
3155
+ if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24;
3156
+ else u2 = m24;
3226
3157
  }
3227
3158
  jsf[1].push(u2);
3228
- if (2 * d1 === u1 + 1)
3229
- d1 = 1 - d1;
3230
- if (2 * d2 === u2 + 1)
3231
- d2 = 1 - d2;
3159
+ if (2 * d1 === u1 + 1) d1 = 1 - d1;
3160
+ if (2 * d2 === u2 + 1) d2 = 1 - d2;
3232
3161
  k1.iushrn(1);
3233
3162
  k2.iushrn(1);
3234
3163
  }
@@ -3264,8 +3193,7 @@ var require_brorand = __commonJS({
3264
3193
  "../../node_modules/brorand/index.js"(exports2, module2) {
3265
3194
  var r;
3266
3195
  module2.exports = /* @__PURE__ */ __name(function rand(len) {
3267
- if (!r)
3268
- r = new Rand(null);
3196
+ if (!r) r = new Rand(null);
3269
3197
  return r.generate(len);
3270
3198
  }, "rand");
3271
3199
  function Rand(rand) {
@@ -3277,11 +3205,9 @@ var require_brorand = __commonJS({
3277
3205
  return this._rand(len);
3278
3206
  }, "generate");
3279
3207
  Rand.prototype._rand = /* @__PURE__ */ __name(function _rand(n) {
3280
- if (this.rand.getBytes)
3281
- return this.rand.getBytes(n);
3208
+ if (this.rand.getBytes) return this.rand.getBytes(n);
3282
3209
  var res = new Uint8Array(n);
3283
- for (var i = 0; i < res.length; i++)
3284
- res[i] = this.rand.getByte();
3210
+ for (var i = 0; i < res.length; i++) res[i] = this.rand.getByte();
3285
3211
  return res;
3286
3212
  }, "_rand");
3287
3213
  if (typeof self === "object") {
@@ -3305,8 +3231,7 @@ var require_brorand = __commonJS({
3305
3231
  } else {
3306
3232
  try {
3307
3233
  crypto = require_crypto();
3308
- if (typeof crypto.randomBytes !== "function")
3309
- throw new Error("Not supported");
3234
+ if (typeof crypto.randomBytes !== "function") throw new Error("Not supported");
3310
3235
  Rand.prototype._rand = /* @__PURE__ */ __name(function _rand(n) {
3311
3236
  return crypto.randomBytes(n);
3312
3237
  }, "_rand");
@@ -3365,8 +3290,7 @@ var require_base = __commonJS({
3365
3290
  var nafW;
3366
3291
  for (j = 0; j < naf.length; j += doubles.step) {
3367
3292
  nafW = 0;
3368
- for (var l = j + doubles.step - 1; l >= j; l--)
3369
- nafW = (nafW << 1) + naf[l];
3293
+ for (var l = j + doubles.step - 1; l >= j; l--) nafW = (nafW << 1) + naf[l];
3370
3294
  repr.push(nafW);
3371
3295
  }
3372
3296
  var a = this.jpoint(null, null, null);
@@ -3374,10 +3298,8 @@ var require_base = __commonJS({
3374
3298
  for (var i = I; i > 0; i--) {
3375
3299
  for (j = 0; j < repr.length; j++) {
3376
3300
  nafW = repr[j];
3377
- if (nafW === i)
3378
- b = b.mixedAdd(doubles.points[j]);
3379
- else if (nafW === -i)
3380
- b = b.mixedAdd(doubles.points[j].neg());
3301
+ if (nafW === i) b = b.mixedAdd(doubles.points[j]);
3302
+ else if (nafW === -i) b = b.mixedAdd(doubles.points[j].neg());
3381
3303
  }
3382
3304
  a = a.add(b);
3383
3305
  }
@@ -3391,25 +3313,18 @@ var require_base = __commonJS({
3391
3313
  var naf = getNAF(k, w, this._bitLength);
3392
3314
  var acc = this.jpoint(null, null, null);
3393
3315
  for (var i = naf.length - 1; i >= 0; i--) {
3394
- for (var l = 0; i >= 0 && naf[i] === 0; i--)
3395
- l++;
3396
- if (i >= 0)
3397
- l++;
3316
+ for (var l = 0; i >= 0 && naf[i] === 0; i--) l++;
3317
+ if (i >= 0) l++;
3398
3318
  acc = acc.dblp(l);
3399
- if (i < 0)
3400
- break;
3319
+ if (i < 0) break;
3401
3320
  var z = naf[i];
3402
3321
  assert(z !== 0);
3403
3322
  if (p.type === "affine") {
3404
- if (z > 0)
3405
- acc = acc.mixedAdd(wnd[z - 1 >> 1]);
3406
- else
3407
- acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg());
3323
+ if (z > 0) acc = acc.mixedAdd(wnd[z - 1 >> 1]);
3324
+ else acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg());
3408
3325
  } else {
3409
- if (z > 0)
3410
- acc = acc.add(wnd[z - 1 >> 1]);
3411
- else
3412
- acc = acc.add(wnd[-z - 1 >> 1].neg());
3326
+ if (z > 0) acc = acc.add(wnd[z - 1 >> 1]);
3327
+ else acc = acc.add(wnd[-z - 1 >> 1].neg());
3413
3328
  }
3414
3329
  }
3415
3330
  return p.type === "affine" ? acc.toP() : acc;
@@ -3490,40 +3405,28 @@ var require_base = __commonJS({
3490
3405
  var zero = true;
3491
3406
  for (j = 0; j < len; j++) {
3492
3407
  tmp[j] = naf[j][i] | 0;
3493
- if (tmp[j] !== 0)
3494
- zero = false;
3408
+ if (tmp[j] !== 0) zero = false;
3495
3409
  }
3496
- if (!zero)
3497
- break;
3410
+ if (!zero) break;
3498
3411
  k++;
3499
3412
  i--;
3500
3413
  }
3501
- if (i >= 0)
3502
- k++;
3414
+ if (i >= 0) k++;
3503
3415
  acc = acc.dblp(k);
3504
- if (i < 0)
3505
- break;
3416
+ if (i < 0) break;
3506
3417
  for (j = 0; j < len; j++) {
3507
3418
  var z = tmp[j];
3508
3419
  p;
3509
- if (z === 0)
3510
- continue;
3511
- else if (z > 0)
3512
- p = wnd[j][z - 1 >> 1];
3513
- else if (z < 0)
3514
- p = wnd[j][-z - 1 >> 1].neg();
3515
- if (p.type === "affine")
3516
- acc = acc.mixedAdd(p);
3517
- else
3518
- acc = acc.add(p);
3519
- }
3520
- }
3521
- for (i = 0; i < len; i++)
3522
- wnd[i] = null;
3523
- if (jacobianResult)
3524
- return acc;
3525
- else
3526
- return acc.toP();
3420
+ if (z === 0) continue;
3421
+ else if (z > 0) p = wnd[j][z - 1 >> 1];
3422
+ else if (z < 0) p = wnd[j][-z - 1 >> 1].neg();
3423
+ if (p.type === "affine") acc = acc.mixedAdd(p);
3424
+ else acc = acc.add(p);
3425
+ }
3426
+ }
3427
+ for (i = 0; i < len; i++) wnd[i] = null;
3428
+ if (jacobianResult) return acc;
3429
+ else return acc.toP();
3527
3430
  }, "_wnafMulAdd");
3528
3431
  function BasePoint(curve, type) {
3529
3432
  this.curve = curve;
@@ -3542,10 +3445,8 @@ var require_base = __commonJS({
3542
3445
  bytes = utils.toArray(bytes, enc);
3543
3446
  var len = this.p.byteLength();
3544
3447
  if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {
3545
- if (bytes[0] === 6)
3546
- assert(bytes[bytes.length - 1] % 2 === 0);
3547
- else if (bytes[0] === 7)
3548
- assert(bytes[bytes.length - 1] % 2 === 1);
3448
+ if (bytes[0] === 6) assert(bytes[bytes.length - 1] % 2 === 0);
3449
+ else if (bytes[0] === 7) assert(bytes[bytes.length - 1] % 2 === 1);
3549
3450
  var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));
3550
3451
  return res;
3551
3452
  } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) {
@@ -3559,16 +3460,14 @@ var require_base = __commonJS({
3559
3460
  BasePoint.prototype._encode = /* @__PURE__ */ __name(function _encode(compact) {
3560
3461
  var len = this.curve.p.byteLength();
3561
3462
  var x = this.getX().toArray("be", len);
3562
- if (compact)
3563
- return [this.getY().isEven() ? 2 : 3].concat(x);
3463
+ if (compact) return [this.getY().isEven() ? 2 : 3].concat(x);
3564
3464
  return [4].concat(x, this.getY().toArray("be", len));
3565
3465
  }, "_encode");
3566
3466
  BasePoint.prototype.encode = /* @__PURE__ */ __name(function encode(enc, compact) {
3567
3467
  return utils.encode(this._encode(compact), enc);
3568
3468
  }, "encode");
3569
3469
  BasePoint.prototype.precompute = /* @__PURE__ */ __name(function precompute(power) {
3570
- if (this.precomputed)
3571
- return this;
3470
+ if (this.precomputed) return this;
3572
3471
  var precomputed = {
3573
3472
  doubles: null,
3574
3473
  naf: null,
@@ -3581,21 +3480,17 @@ var require_base = __commonJS({
3581
3480
  return this;
3582
3481
  }, "precompute");
3583
3482
  BasePoint.prototype._hasDoubles = /* @__PURE__ */ __name(function _hasDoubles(k) {
3584
- if (!this.precomputed)
3585
- return false;
3483
+ if (!this.precomputed) return false;
3586
3484
  var doubles = this.precomputed.doubles;
3587
- if (!doubles)
3588
- return false;
3485
+ if (!doubles) return false;
3589
3486
  return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
3590
3487
  }, "_hasDoubles");
3591
3488
  BasePoint.prototype._getDoubles = /* @__PURE__ */ __name(function _getDoubles(step, power) {
3592
- if (this.precomputed && this.precomputed.doubles)
3593
- return this.precomputed.doubles;
3489
+ if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles;
3594
3490
  var doubles = [this];
3595
3491
  var acc = this;
3596
3492
  for (var i = 0; i < power; i += step) {
3597
- for (var j = 0; j < step; j++)
3598
- acc = acc.dbl();
3493
+ for (var j = 0; j < step; j++) acc = acc.dbl();
3599
3494
  doubles.push(acc);
3600
3495
  }
3601
3496
  return {
@@ -3604,13 +3499,11 @@ var require_base = __commonJS({
3604
3499
  };
3605
3500
  }, "_getDoubles");
3606
3501
  BasePoint.prototype._getNAFPoints = /* @__PURE__ */ __name(function _getNAFPoints(wnd) {
3607
- if (this.precomputed && this.precomputed.naf)
3608
- return this.precomputed.naf;
3502
+ if (this.precomputed && this.precomputed.naf) return this.precomputed.naf;
3609
3503
  var res = [this];
3610
3504
  var max = (1 << wnd) - 1;
3611
3505
  var dbl = max === 1 ? null : this.dbl();
3612
- for (var i = 1; i < max; i++)
3613
- res[i] = res[i - 1].add(dbl);
3506
+ for (var i = 1; i < max; i++) res[i] = res[i - 1].add(dbl);
3614
3507
  return {
3615
3508
  wnd,
3616
3509
  points: res
@@ -3621,8 +3514,7 @@ var require_base = __commonJS({
3621
3514
  }, "_getBeta");
3622
3515
  BasePoint.prototype.dblp = /* @__PURE__ */ __name(function dblp(k) {
3623
3516
  var r = this;
3624
- for (var i = 0; i < k; i++)
3625
- r = r.dbl();
3517
+ for (var i = 0; i < k; i++) r = r.dbl();
3626
3518
  return r;
3627
3519
  }, "dblp");
3628
3520
  }
@@ -3843,7 +3735,7 @@ var require_get_intrinsic = __commonJS({
3843
3735
  var throwTypeError = /* @__PURE__ */ __name(function() {
3844
3736
  throw new $TypeError();
3845
3737
  }, "throwTypeError");
3846
- var ThrowTypeError = $gOPD ? function() {
3738
+ var ThrowTypeError = $gOPD ? (function() {
3847
3739
  try {
3848
3740
  arguments.callee;
3849
3741
  return throwTypeError;
@@ -3854,7 +3746,7 @@ var require_get_intrinsic = __commonJS({
3854
3746
  return throwTypeError;
3855
3747
  }
3856
3748
  }
3857
- }() : throwTypeError;
3749
+ })() : throwTypeError;
3858
3750
  var hasSymbols = require_has_symbols()();
3859
3751
  var getProto = Object.getPrototypeOf || function(x) {
3860
3752
  return x.__proto__;
@@ -4192,9 +4084,9 @@ var require_is_arguments = __commonJS({
4192
4084
  }
4193
4085
  return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]";
4194
4086
  }, "isArguments");
4195
- var supportsStandardArguments = function() {
4087
+ var supportsStandardArguments = (function() {
4196
4088
  return isStandardArguments(arguments);
4197
- }();
4089
+ })();
4198
4090
  isStandardArguments.isLegacyArguments = isLegacyArguments;
4199
4091
  module2.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
4200
4092
  }
@@ -4249,9 +4141,9 @@ var require_is_callable = __commonJS({
4249
4141
  if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") {
4250
4142
  try {
4251
4143
  badArrayLike = Object.defineProperty({}, "length", {
4252
- get: function() {
4144
+ get: /* @__PURE__ */ __name(function() {
4253
4145
  throw isCallableMarker;
4254
- }
4146
+ }, "get")
4255
4147
  });
4256
4148
  isCallableMarker = {};
4257
4149
  reflectApply(
@@ -4519,7 +4411,7 @@ var require_get_intrinsic2 = __commonJS({
4519
4411
  var throwTypeError = /* @__PURE__ */ __name(function() {
4520
4412
  throw new $TypeError();
4521
4413
  }, "throwTypeError");
4522
- var ThrowTypeError = $gOPD ? function() {
4414
+ var ThrowTypeError = $gOPD ? (function() {
4523
4415
  try {
4524
4416
  arguments.callee;
4525
4417
  return throwTypeError;
@@ -4530,7 +4422,7 @@ var require_get_intrinsic2 = __commonJS({
4530
4422
  return throwTypeError;
4531
4423
  }
4532
4424
  }
4533
- }() : throwTypeError;
4425
+ })() : throwTypeError;
4534
4426
  var hasSymbols = require_has_symbols()();
4535
4427
  var getProto = Object.getPrototypeOf || function(x) {
4536
4428
  return x.__proto__;
@@ -4926,7 +4818,7 @@ var require_get_intrinsic3 = __commonJS({
4926
4818
  var throwTypeError = /* @__PURE__ */ __name(function() {
4927
4819
  throw new $TypeError();
4928
4820
  }, "throwTypeError");
4929
- var ThrowTypeError = $gOPD ? function() {
4821
+ var ThrowTypeError = $gOPD ? (function() {
4930
4822
  try {
4931
4823
  arguments.callee;
4932
4824
  return throwTypeError;
@@ -4937,7 +4829,7 @@ var require_get_intrinsic3 = __commonJS({
4937
4829
  return throwTypeError;
4938
4830
  }
4939
4831
  }
4940
- }() : throwTypeError;
4832
+ })() : throwTypeError;
4941
4833
  var hasSymbols = require_has_symbols()();
4942
4834
  var getProto = Object.getPrototypeOf || function(x) {
4943
4835
  return x.__proto__;
@@ -5601,9 +5493,9 @@ var require_types = __commonJS({
5601
5493
  ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(method) {
5602
5494
  Object.defineProperty(exports2, method, {
5603
5495
  enumerable: false,
5604
- value: function() {
5496
+ value: /* @__PURE__ */ __name(function() {
5605
5497
  throw new Error(method + " is not supported in userland");
5606
- }
5498
+ }, "value")
5607
5499
  });
5608
5500
  });
5609
5501
  }
@@ -5638,10 +5530,8 @@ var require_util = __commonJS({
5638
5530
  var args = arguments;
5639
5531
  var len = args.length;
5640
5532
  var str = String(f).replace(formatRegExp, function(x2) {
5641
- if (x2 === "%%")
5642
- return "%";
5643
- if (i >= len)
5644
- return x2;
5533
+ if (x2 === "%%") return "%";
5534
+ if (i >= len) return x2;
5645
5535
  switch (x2) {
5646
5536
  case "%s":
5647
5537
  return String(args[i++]);
@@ -5721,25 +5611,18 @@ var require_util = __commonJS({
5721
5611
  seen: [],
5722
5612
  stylize: stylizeNoColor
5723
5613
  };
5724
- if (arguments.length >= 3)
5725
- ctx.depth = arguments[2];
5726
- if (arguments.length >= 4)
5727
- ctx.colors = arguments[3];
5614
+ if (arguments.length >= 3) ctx.depth = arguments[2];
5615
+ if (arguments.length >= 4) ctx.colors = arguments[3];
5728
5616
  if (isBoolean(opts)) {
5729
5617
  ctx.showHidden = opts;
5730
5618
  } else if (opts) {
5731
5619
  exports2._extend(ctx, opts);
5732
5620
  }
5733
- if (isUndefined(ctx.showHidden))
5734
- ctx.showHidden = false;
5735
- if (isUndefined(ctx.depth))
5736
- ctx.depth = 2;
5737
- if (isUndefined(ctx.colors))
5738
- ctx.colors = false;
5739
- if (isUndefined(ctx.customInspect))
5740
- ctx.customInspect = true;
5741
- if (ctx.colors)
5742
- ctx.stylize = stylizeWithColor;
5621
+ if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
5622
+ if (isUndefined(ctx.depth)) ctx.depth = 2;
5623
+ if (isUndefined(ctx.colors)) ctx.colors = false;
5624
+ if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
5625
+ if (ctx.colors) ctx.stylize = stylizeWithColor;
5743
5626
  return formatValue(ctx, obj, ctx.depth);
5744
5627
  }
5745
5628
  __name(inspect, "inspect");
@@ -5870,18 +5753,14 @@ var require_util = __commonJS({
5870
5753
  }
5871
5754
  __name(formatValue, "formatValue");
5872
5755
  function formatPrimitive(ctx, value) {
5873
- if (isUndefined(value))
5874
- return ctx.stylize("undefined", "undefined");
5756
+ if (isUndefined(value)) return ctx.stylize("undefined", "undefined");
5875
5757
  if (isString(value)) {
5876
5758
  var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
5877
5759
  return ctx.stylize(simple, "string");
5878
5760
  }
5879
- if (isNumber(value))
5880
- return ctx.stylize("" + value, "number");
5881
- if (isBoolean(value))
5882
- return ctx.stylize("" + value, "boolean");
5883
- if (isNull(value))
5884
- return ctx.stylize("null", "null");
5761
+ if (isNumber(value)) return ctx.stylize("" + value, "number");
5762
+ if (isBoolean(value)) return ctx.stylize("" + value, "boolean");
5763
+ if (isNull(value)) return ctx.stylize("null", "null");
5885
5764
  }
5886
5765
  __name(formatPrimitive, "formatPrimitive");
5887
5766
  function formatError(value) {
@@ -5964,8 +5843,7 @@ var require_util = __commonJS({
5964
5843
  var numLinesEst = 0;
5965
5844
  var length = output.reduce(function(prev, cur) {
5966
5845
  numLinesEst++;
5967
- if (cur.indexOf("\n") >= 0)
5968
- numLinesEst++;
5846
+ if (cur.indexOf("\n") >= 0) numLinesEst++;
5969
5847
  return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
5970
5848
  }, 0);
5971
5849
  if (length > 60) {
@@ -6070,8 +5948,7 @@ var require_util = __commonJS({
6070
5948
  };
6071
5949
  exports2.inherits = require_inherits();
6072
5950
  exports2._extend = function(origin, add) {
6073
- if (!add || !isObject(add))
6074
- return origin;
5951
+ if (!add || !isObject(add)) return origin;
6075
5952
  var keys = Object.keys(add);
6076
5953
  var i = keys.length;
6077
5954
  while (i--) {
@@ -6085,8 +5962,7 @@ var require_util = __commonJS({
6085
5962
  __name(hasOwnProperty, "hasOwnProperty");
6086
5963
  var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0;
6087
5964
  exports2.promisify = /* @__PURE__ */ __name(function promisify(original) {
6088
- if (typeof original !== "function")
6089
- throw new TypeError('The "original" argument must be of type Function');
5965
+ if (typeof original !== "function") throw new TypeError('The "original" argument must be of type Function');
6090
5966
  if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
6091
5967
  var fn = original[kCustomPromisifiedSymbol];
6092
5968
  if (typeof fn !== "function") {
@@ -6214,8 +6090,7 @@ var require_inherits = __commonJS({
6214
6090
  "../../node_modules/inherits/inherits.js"(exports2, module2) {
6215
6091
  try {
6216
6092
  util = require_util();
6217
- if (typeof util.inherits !== "function")
6218
- throw "";
6093
+ if (typeof util.inherits !== "function") throw "";
6219
6094
  module2.exports = util.inherits;
6220
6095
  } catch (e) {
6221
6096
  module2.exports = require_inherits_browser();
@@ -6246,8 +6121,7 @@ var require_short = __commonJS({
6246
6121
  inherits(ShortCurve, Base);
6247
6122
  module2.exports = ShortCurve;
6248
6123
  ShortCurve.prototype._getEndomorphism = /* @__PURE__ */ __name(function _getEndomorphism(conf) {
6249
- if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
6250
- return;
6124
+ if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) return;
6251
6125
  var beta;
6252
6126
  var lambda;
6253
6127
  if (conf.beta) {
@@ -6370,20 +6244,16 @@ var require_short = __commonJS({
6370
6244
  }, "_endoSplit");
6371
6245
  ShortCurve.prototype.pointFromX = /* @__PURE__ */ __name(function pointFromX(x, odd) {
6372
6246
  x = new BN(x, 16);
6373
- if (!x.red)
6374
- x = x.toRed(this.red);
6247
+ if (!x.red) x = x.toRed(this.red);
6375
6248
  var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
6376
6249
  var y = y2.redSqrt();
6377
- if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
6378
- throw new Error("invalid point");
6250
+ if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error("invalid point");
6379
6251
  var isOdd = y.fromRed().isOdd();
6380
- if (odd && !isOdd || !odd && isOdd)
6381
- y = y.redNeg();
6252
+ if (odd && !isOdd || !odd && isOdd) y = y.redNeg();
6382
6253
  return this.point(x, y);
6383
6254
  }, "pointFromX");
6384
6255
  ShortCurve.prototype.validate = /* @__PURE__ */ __name(function validate(point) {
6385
- if (point.inf)
6386
- return true;
6256
+ if (point.inf) return true;
6387
6257
  var x = point.x;
6388
6258
  var y = point.y;
6389
6259
  var ax = this.a.redMul(x);
@@ -6430,10 +6300,8 @@ var require_short = __commonJS({
6430
6300
  this.x.forceRed(this.curve.red);
6431
6301
  this.y.forceRed(this.curve.red);
6432
6302
  }
6433
- if (!this.x.red)
6434
- this.x = this.x.toRed(this.curve.red);
6435
- if (!this.y.red)
6436
- this.y = this.y.toRed(this.curve.red);
6303
+ if (!this.x.red) this.x = this.x.toRed(this.curve.red);
6304
+ if (!this.y.red) this.y = this.y.toRed(this.curve.red);
6437
6305
  this.inf = false;
6438
6306
  }
6439
6307
  }
@@ -6446,11 +6314,9 @@ var require_short = __commonJS({
6446
6314
  return Point.fromJSON(this, obj, red);
6447
6315
  }, "pointFromJSON");
6448
6316
  Point.prototype._getBeta = /* @__PURE__ */ __name(function _getBeta() {
6449
- if (!this.curve.endo)
6450
- return;
6317
+ if (!this.curve.endo) return;
6451
6318
  var pre = this.precomputed;
6452
- if (pre && pre.beta)
6453
- return pre.beta;
6319
+ if (pre && pre.beta) return pre.beta;
6454
6320
  var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
6455
6321
  if (pre) {
6456
6322
  var curve = this.curve;
@@ -6473,8 +6339,7 @@ var require_short = __commonJS({
6473
6339
  return beta;
6474
6340
  }, "_getBeta");
6475
6341
  Point.prototype.toJSON = /* @__PURE__ */ __name(function toJSON() {
6476
- if (!this.precomputed)
6477
- return [this.x, this.y];
6342
+ if (!this.precomputed) return [this.x, this.y];
6478
6343
  return [
6479
6344
  this.x,
6480
6345
  this.y,
@@ -6491,11 +6356,9 @@ var require_short = __commonJS({
6491
6356
  ];
6492
6357
  }, "toJSON");
6493
6358
  Point.fromJSON = /* @__PURE__ */ __name(function fromJSON(curve, obj, red) {
6494
- if (typeof obj === "string")
6495
- obj = JSON.parse(obj);
6359
+ if (typeof obj === "string") obj = JSON.parse(obj);
6496
6360
  var res = curve.point(obj[0], obj[1], red);
6497
- if (!obj[2])
6498
- return res;
6361
+ if (!obj[2]) return res;
6499
6362
  function obj2point(obj2) {
6500
6363
  return curve.point(obj2[0], obj2[1], red);
6501
6364
  }
@@ -6515,37 +6378,28 @@ var require_short = __commonJS({
6515
6378
  return res;
6516
6379
  }, "fromJSON");
6517
6380
  Point.prototype.inspect = /* @__PURE__ */ __name(function inspect() {
6518
- if (this.isInfinity())
6519
- return "<EC Point Infinity>";
6381
+ if (this.isInfinity()) return "<EC Point Infinity>";
6520
6382
  return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + ">";
6521
6383
  }, "inspect");
6522
6384
  Point.prototype.isInfinity = /* @__PURE__ */ __name(function isInfinity() {
6523
6385
  return this.inf;
6524
6386
  }, "isInfinity");
6525
6387
  Point.prototype.add = /* @__PURE__ */ __name(function add(p) {
6526
- if (this.inf)
6527
- return p;
6528
- if (p.inf)
6529
- return this;
6530
- if (this.eq(p))
6531
- return this.dbl();
6532
- if (this.neg().eq(p))
6533
- return this.curve.point(null, null);
6534
- if (this.x.cmp(p.x) === 0)
6535
- return this.curve.point(null, null);
6388
+ if (this.inf) return p;
6389
+ if (p.inf) return this;
6390
+ if (this.eq(p)) return this.dbl();
6391
+ if (this.neg().eq(p)) return this.curve.point(null, null);
6392
+ if (this.x.cmp(p.x) === 0) return this.curve.point(null, null);
6536
6393
  var c = this.y.redSub(p.y);
6537
- if (c.cmpn(0) !== 0)
6538
- c = c.redMul(this.x.redSub(p.x).redInvm());
6394
+ if (c.cmpn(0) !== 0) c = c.redMul(this.x.redSub(p.x).redInvm());
6539
6395
  var nx = c.redSqr().redISub(this.x).redISub(p.x);
6540
6396
  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
6541
6397
  return this.curve.point(nx, ny);
6542
6398
  }, "add");
6543
6399
  Point.prototype.dbl = /* @__PURE__ */ __name(function dbl() {
6544
- if (this.inf)
6545
- return this;
6400
+ if (this.inf) return this;
6546
6401
  var ys1 = this.y.redAdd(this.y);
6547
- if (ys1.cmpn(0) === 0)
6548
- return this.curve.point(null, null);
6402
+ if (ys1.cmpn(0) === 0) return this.curve.point(null, null);
6549
6403
  var a = this.curve.a;
6550
6404
  var x2 = this.x.redSqr();
6551
6405
  var dyinv = ys1.redInvm();
@@ -6562,37 +6416,28 @@ var require_short = __commonJS({
6562
6416
  }, "getY");
6563
6417
  Point.prototype.mul = /* @__PURE__ */ __name(function mul(k) {
6564
6418
  k = new BN(k, 16);
6565
- if (this.isInfinity())
6566
- return this;
6567
- else if (this._hasDoubles(k))
6568
- return this.curve._fixedNafMul(this, k);
6569
- else if (this.curve.endo)
6570
- return this.curve._endoWnafMulAdd([this], [k]);
6571
- else
6572
- return this.curve._wnafMul(this, k);
6419
+ if (this.isInfinity()) return this;
6420
+ else if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k);
6421
+ else if (this.curve.endo) return this.curve._endoWnafMulAdd([this], [k]);
6422
+ else return this.curve._wnafMul(this, k);
6573
6423
  }, "mul");
6574
6424
  Point.prototype.mulAdd = /* @__PURE__ */ __name(function mulAdd(k1, p2, k2) {
6575
6425
  var points = [this, p2];
6576
6426
  var coeffs = [k1, k2];
6577
- if (this.curve.endo)
6578
- return this.curve._endoWnafMulAdd(points, coeffs);
6579
- else
6580
- return this.curve._wnafMulAdd(1, points, coeffs, 2);
6427
+ if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs);
6428
+ else return this.curve._wnafMulAdd(1, points, coeffs, 2);
6581
6429
  }, "mulAdd");
6582
6430
  Point.prototype.jmulAdd = /* @__PURE__ */ __name(function jmulAdd(k1, p2, k2) {
6583
6431
  var points = [this, p2];
6584
6432
  var coeffs = [k1, k2];
6585
- if (this.curve.endo)
6586
- return this.curve._endoWnafMulAdd(points, coeffs, true);
6587
- else
6588
- return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
6433
+ if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs, true);
6434
+ else return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
6589
6435
  }, "jmulAdd");
6590
6436
  Point.prototype.eq = /* @__PURE__ */ __name(function eq(p) {
6591
6437
  return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
6592
6438
  }, "eq");
6593
6439
  Point.prototype.neg = /* @__PURE__ */ __name(function neg(_precompute) {
6594
- if (this.inf)
6595
- return this;
6440
+ if (this.inf) return this;
6596
6441
  var res = this.curve.point(this.x, this.y.redNeg());
6597
6442
  if (_precompute && this.precomputed) {
6598
6443
  var pre = this.precomputed;
@@ -6613,8 +6458,7 @@ var require_short = __commonJS({
6613
6458
  return res;
6614
6459
  }, "neg");
6615
6460
  Point.prototype.toJ = /* @__PURE__ */ __name(function toJ() {
6616
- if (this.inf)
6617
- return this.curve.jpoint(null, null, null);
6461
+ if (this.inf) return this.curve.jpoint(null, null, null);
6618
6462
  var res = this.curve.jpoint(this.x, this.y, this.curve.one);
6619
6463
  return res;
6620
6464
  }, "toJ");
@@ -6629,12 +6473,9 @@ var require_short = __commonJS({
6629
6473
  this.y = new BN(y, 16);
6630
6474
  this.z = new BN(z, 16);
6631
6475
  }
6632
- if (!this.x.red)
6633
- this.x = this.x.toRed(this.curve.red);
6634
- if (!this.y.red)
6635
- this.y = this.y.toRed(this.curve.red);
6636
- if (!this.z.red)
6637
- this.z = this.z.toRed(this.curve.red);
6476
+ if (!this.x.red) this.x = this.x.toRed(this.curve.red);
6477
+ if (!this.y.red) this.y = this.y.toRed(this.curve.red);
6478
+ if (!this.z.red) this.z = this.z.toRed(this.curve.red);
6638
6479
  this.zOne = this.z === this.curve.one;
6639
6480
  }
6640
6481
  __name(JPoint, "JPoint");
@@ -6643,8 +6484,7 @@ var require_short = __commonJS({
6643
6484
  return new JPoint(this, x, y, z);
6644
6485
  }, "jpoint");
6645
6486
  JPoint.prototype.toP = /* @__PURE__ */ __name(function toP() {
6646
- if (this.isInfinity())
6647
- return this.curve.point(null, null);
6487
+ if (this.isInfinity()) return this.curve.point(null, null);
6648
6488
  var zinv = this.z.redInvm();
6649
6489
  var zinv2 = zinv.redSqr();
6650
6490
  var ax = this.x.redMul(zinv2);
@@ -6655,10 +6495,8 @@ var require_short = __commonJS({
6655
6495
  return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
6656
6496
  }, "neg");
6657
6497
  JPoint.prototype.add = /* @__PURE__ */ __name(function add(p) {
6658
- if (this.isInfinity())
6659
- return p;
6660
- if (p.isInfinity())
6661
- return this;
6498
+ if (this.isInfinity()) return p;
6499
+ if (p.isInfinity()) return this;
6662
6500
  var pz2 = p.z.redSqr();
6663
6501
  var z2 = this.z.redSqr();
6664
6502
  var u1 = this.x.redMul(pz2);
@@ -6668,10 +6506,8 @@ var require_short = __commonJS({
6668
6506
  var h = u1.redSub(u2);
6669
6507
  var r = s1.redSub(s2);
6670
6508
  if (h.cmpn(0) === 0) {
6671
- if (r.cmpn(0) !== 0)
6672
- return this.curve.jpoint(null, null, null);
6673
- else
6674
- return this.dbl();
6509
+ if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null);
6510
+ else return this.dbl();
6675
6511
  }
6676
6512
  var h2 = h.redSqr();
6677
6513
  var h3 = h2.redMul(h);
@@ -6682,10 +6518,8 @@ var require_short = __commonJS({
6682
6518
  return this.curve.jpoint(nx, ny, nz);
6683
6519
  }, "add");
6684
6520
  JPoint.prototype.mixedAdd = /* @__PURE__ */ __name(function mixedAdd(p) {
6685
- if (this.isInfinity())
6686
- return p.toJ();
6687
- if (p.isInfinity())
6688
- return this;
6521
+ if (this.isInfinity()) return p.toJ();
6522
+ if (p.isInfinity()) return this;
6689
6523
  var z2 = this.z.redSqr();
6690
6524
  var u1 = this.x;
6691
6525
  var u2 = p.x.redMul(z2);
@@ -6694,10 +6528,8 @@ var require_short = __commonJS({
6694
6528
  var h = u1.redSub(u2);
6695
6529
  var r = s1.redSub(s2);
6696
6530
  if (h.cmpn(0) === 0) {
6697
- if (r.cmpn(0) !== 0)
6698
- return this.curve.jpoint(null, null, null);
6699
- else
6700
- return this.dbl();
6531
+ if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null);
6532
+ else return this.dbl();
6701
6533
  }
6702
6534
  var h2 = h.redSqr();
6703
6535
  var h3 = h2.redMul(h);
@@ -6708,17 +6540,13 @@ var require_short = __commonJS({
6708
6540
  return this.curve.jpoint(nx, ny, nz);
6709
6541
  }, "mixedAdd");
6710
6542
  JPoint.prototype.dblp = /* @__PURE__ */ __name(function dblp(pow) {
6711
- if (pow === 0)
6712
- return this;
6713
- if (this.isInfinity())
6714
- return this;
6715
- if (!pow)
6716
- return this.dbl();
6543
+ if (pow === 0) return this;
6544
+ if (this.isInfinity()) return this;
6545
+ if (!pow) return this.dbl();
6717
6546
  var i;
6718
6547
  if (this.curve.zeroA || this.curve.threeA) {
6719
6548
  var r = this;
6720
- for (i = 0; i < pow; i++)
6721
- r = r.dbl();
6549
+ for (i = 0; i < pow; i++) r = r.dbl();
6722
6550
  return r;
6723
6551
  }
6724
6552
  var a = this.curve.a;
@@ -6739,8 +6567,7 @@ var require_short = __commonJS({
6739
6567
  var dny = c.redMul(t2);
6740
6568
  dny = dny.redIAdd(dny).redISub(jyd4);
6741
6569
  var nz = jyd.redMul(jz);
6742
- if (i + 1 < pow)
6743
- jz4 = jz4.redMul(jyd4);
6570
+ if (i + 1 < pow) jz4 = jz4.redMul(jyd4);
6744
6571
  jx = nx;
6745
6572
  jz = nz;
6746
6573
  jyd = dny;
@@ -6748,14 +6575,10 @@ var require_short = __commonJS({
6748
6575
  return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
6749
6576
  }, "dblp");
6750
6577
  JPoint.prototype.dbl = /* @__PURE__ */ __name(function dbl() {
6751
- if (this.isInfinity())
6752
- return this;
6753
- if (this.curve.zeroA)
6754
- return this._zeroDbl();
6755
- else if (this.curve.threeA)
6756
- return this._threeDbl();
6757
- else
6758
- return this._dbl();
6578
+ if (this.isInfinity()) return this;
6579
+ if (this.curve.zeroA) return this._zeroDbl();
6580
+ else if (this.curve.threeA) return this._threeDbl();
6581
+ else return this._dbl();
6759
6582
  }, "dbl");
6760
6583
  JPoint.prototype._zeroDbl = /* @__PURE__ */ __name(function _zeroDbl() {
6761
6584
  var nx;
@@ -6853,8 +6676,7 @@ var require_short = __commonJS({
6853
6676
  return this.curve.jpoint(nx, ny, nz);
6854
6677
  }, "_dbl");
6855
6678
  JPoint.prototype.trpl = /* @__PURE__ */ __name(function trpl() {
6856
- if (!this.curve.zeroA)
6857
- return this.dbl().add(this);
6679
+ if (!this.curve.zeroA) return this.dbl().add(this);
6858
6680
  var xx = this.x.redSqr();
6859
6681
  var yy = this.y.redSqr();
6860
6682
  var zz = this.z.redSqr();
@@ -6889,14 +6711,11 @@ var require_short = __commonJS({
6889
6711
  return this.curve._wnafMul(this, k);
6890
6712
  }, "mul");
6891
6713
  JPoint.prototype.eq = /* @__PURE__ */ __name(function eq(p) {
6892
- if (p.type === "affine")
6893
- return this.eq(p.toJ());
6894
- if (this === p)
6895
- return true;
6714
+ if (p.type === "affine") return this.eq(p.toJ());
6715
+ if (this === p) return true;
6896
6716
  var z2 = this.z.redSqr();
6897
6717
  var pz2 = p.z.redSqr();
6898
- if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
6899
- return false;
6718
+ if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) return false;
6900
6719
  var z3 = z2.redMul(this.z);
6901
6720
  var pz3 = pz2.redMul(p.z);
6902
6721
  return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
@@ -6904,22 +6723,18 @@ var require_short = __commonJS({
6904
6723
  JPoint.prototype.eqXToP = /* @__PURE__ */ __name(function eqXToP(x) {
6905
6724
  var zs = this.z.redSqr();
6906
6725
  var rx = x.toRed(this.curve.red).redMul(zs);
6907
- if (this.x.cmp(rx) === 0)
6908
- return true;
6726
+ if (this.x.cmp(rx) === 0) return true;
6909
6727
  var xc = x.clone();
6910
6728
  var t = this.curve.redN.redMul(zs);
6911
6729
  for (; ; ) {
6912
6730
  xc.iadd(this.curve.n);
6913
- if (xc.cmp(this.curve.p) >= 0)
6914
- return false;
6731
+ if (xc.cmp(this.curve.p) >= 0) return false;
6915
6732
  rx.redIAdd(t);
6916
- if (this.x.cmp(rx) === 0)
6917
- return true;
6733
+ if (this.x.cmp(rx) === 0) return true;
6918
6734
  }
6919
6735
  }, "eqXToP");
6920
6736
  JPoint.prototype.inspect = /* @__PURE__ */ __name(function inspect() {
6921
- if (this.isInfinity())
6922
- return "<EC JPoint Infinity>";
6737
+ if (this.isInfinity()) return "<EC JPoint Infinity>";
6923
6738
  return "<EC JPoint x: " + this.x.toString(16, 2) + " y: " + this.y.toString(16, 2) + " z: " + this.z.toString(16, 2) + ">";
6924
6739
  }, "inspect");
6925
6740
  JPoint.prototype.isInfinity = /* @__PURE__ */ __name(function isInfinity() {
@@ -6960,10 +6775,8 @@ var require_mont = __commonJS({
6960
6775
  } else {
6961
6776
  this.x = new BN(x, 16);
6962
6777
  this.z = new BN(z, 16);
6963
- if (!this.x.red)
6964
- this.x = this.x.toRed(this.curve.red);
6965
- if (!this.z.red)
6966
- this.z = this.z.toRed(this.curve.red);
6778
+ if (!this.x.red) this.x = this.x.toRed(this.curve.red);
6779
+ if (!this.z.red) this.z = this.z.toRed(this.curve.red);
6967
6780
  }
6968
6781
  }
6969
6782
  __name(Point, "Point");
@@ -6986,8 +6799,7 @@ var require_mont = __commonJS({
6986
6799
  return new Point(curve, obj[0], obj[1] || curve.one);
6987
6800
  }, "fromJSON");
6988
6801
  Point.prototype.inspect = /* @__PURE__ */ __name(function inspect() {
6989
- if (this.isInfinity())
6990
- return "<EC Point Infinity>";
6802
+ if (this.isInfinity()) return "<EC Point Infinity>";
6991
6803
  return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">";
6992
6804
  }, "inspect");
6993
6805
  Point.prototype.isInfinity = /* @__PURE__ */ __name(function isInfinity() {
@@ -7022,8 +6834,7 @@ var require_mont = __commonJS({
7022
6834
  var a = this;
7023
6835
  var b = this.curve.point(null, null);
7024
6836
  var c = this;
7025
- for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
7026
- bits.push(t.andln(1));
6837
+ for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) bits.push(t.andln(1));
7027
6838
  for (var i = bits.length - 1; i >= 0; i--) {
7028
6839
  if (bits[i] === 0) {
7029
6840
  a = a.diffAdd(b, c);
@@ -7081,60 +6892,47 @@ var require_edwards = __commonJS({
7081
6892
  inherits(EdwardsCurve, Base);
7082
6893
  module2.exports = EdwardsCurve;
7083
6894
  EdwardsCurve.prototype._mulA = /* @__PURE__ */ __name(function _mulA(num) {
7084
- if (this.mOneA)
7085
- return num.redNeg();
7086
- else
7087
- return this.a.redMul(num);
6895
+ if (this.mOneA) return num.redNeg();
6896
+ else return this.a.redMul(num);
7088
6897
  }, "_mulA");
7089
6898
  EdwardsCurve.prototype._mulC = /* @__PURE__ */ __name(function _mulC(num) {
7090
- if (this.oneC)
7091
- return num;
7092
- else
7093
- return this.c.redMul(num);
6899
+ if (this.oneC) return num;
6900
+ else return this.c.redMul(num);
7094
6901
  }, "_mulC");
7095
6902
  EdwardsCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint(x, y, z, t) {
7096
6903
  return this.point(x, y, z, t);
7097
6904
  }, "jpoint");
7098
6905
  EdwardsCurve.prototype.pointFromX = /* @__PURE__ */ __name(function pointFromX(x, odd) {
7099
6906
  x = new BN(x, 16);
7100
- if (!x.red)
7101
- x = x.toRed(this.red);
6907
+ if (!x.red) x = x.toRed(this.red);
7102
6908
  var x2 = x.redSqr();
7103
6909
  var rhs = this.c2.redSub(this.a.redMul(x2));
7104
6910
  var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
7105
6911
  var y2 = rhs.redMul(lhs.redInvm());
7106
6912
  var y = y2.redSqrt();
7107
- if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
7108
- throw new Error("invalid point");
6913
+ if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error("invalid point");
7109
6914
  var isOdd = y.fromRed().isOdd();
7110
- if (odd && !isOdd || !odd && isOdd)
7111
- y = y.redNeg();
6915
+ if (odd && !isOdd || !odd && isOdd) y = y.redNeg();
7112
6916
  return this.point(x, y);
7113
6917
  }, "pointFromX");
7114
6918
  EdwardsCurve.prototype.pointFromY = /* @__PURE__ */ __name(function pointFromY(y, odd) {
7115
6919
  y = new BN(y, 16);
7116
- if (!y.red)
7117
- y = y.toRed(this.red);
6920
+ if (!y.red) y = y.toRed(this.red);
7118
6921
  var y2 = y.redSqr();
7119
6922
  var lhs = y2.redSub(this.c2);
7120
6923
  var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
7121
6924
  var x2 = lhs.redMul(rhs.redInvm());
7122
6925
  if (x2.cmp(this.zero) === 0) {
7123
- if (odd)
7124
- throw new Error("invalid point");
7125
- else
7126
- return this.point(this.zero, y);
6926
+ if (odd) throw new Error("invalid point");
6927
+ else return this.point(this.zero, y);
7127
6928
  }
7128
6929
  var x = x2.redSqrt();
7129
- if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
7130
- throw new Error("invalid point");
7131
- if (x.fromRed().isOdd() !== odd)
7132
- x = x.redNeg();
6930
+ if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) throw new Error("invalid point");
6931
+ if (x.fromRed().isOdd() !== odd) x = x.redNeg();
7133
6932
  return this.point(x, y);
7134
6933
  }, "pointFromY");
7135
6934
  EdwardsCurve.prototype.validate = /* @__PURE__ */ __name(function validate(point) {
7136
- if (point.isInfinity())
7137
- return true;
6935
+ if (point.isInfinity()) return true;
7138
6936
  point.normalize();
7139
6937
  var x2 = point.x.redSqr();
7140
6938
  var y2 = point.y.redSqr();
@@ -7155,19 +6953,14 @@ var require_edwards = __commonJS({
7155
6953
  this.y = new BN(y, 16);
7156
6954
  this.z = z ? new BN(z, 16) : this.curve.one;
7157
6955
  this.t = t && new BN(t, 16);
7158
- if (!this.x.red)
7159
- this.x = this.x.toRed(this.curve.red);
7160
- if (!this.y.red)
7161
- this.y = this.y.toRed(this.curve.red);
7162
- if (!this.z.red)
7163
- this.z = this.z.toRed(this.curve.red);
7164
- if (this.t && !this.t.red)
7165
- this.t = this.t.toRed(this.curve.red);
6956
+ if (!this.x.red) this.x = this.x.toRed(this.curve.red);
6957
+ if (!this.y.red) this.y = this.y.toRed(this.curve.red);
6958
+ if (!this.z.red) this.z = this.z.toRed(this.curve.red);
6959
+ if (this.t && !this.t.red) this.t = this.t.toRed(this.curve.red);
7166
6960
  this.zOne = this.z === this.curve.one;
7167
6961
  if (this.curve.extended && !this.t) {
7168
6962
  this.t = this.x.redMul(this.y);
7169
- if (!this.zOne)
7170
- this.t = this.t.redMul(this.z.redInvm());
6963
+ if (!this.zOne) this.t = this.t.redMul(this.z.redInvm());
7171
6964
  }
7172
6965
  }
7173
6966
  }
@@ -7183,8 +6976,7 @@ var require_edwards = __commonJS({
7183
6976
  return new Point(curve, obj[0], obj[1], obj[2]);
7184
6977
  }, "fromJSON");
7185
6978
  Point.prototype.inspect = /* @__PURE__ */ __name(function inspect() {
7186
- if (this.isInfinity())
7187
- return "<EC Point Infinity>";
6979
+ if (this.isInfinity()) return "<EC Point Infinity>";
7188
6980
  return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">";
7189
6981
  }, "inspect");
7190
6982
  Point.prototype.isInfinity = /* @__PURE__ */ __name(function isInfinity() {
@@ -7241,12 +7033,9 @@ var require_edwards = __commonJS({
7241
7033
  return this.curve.point(nx, ny, nz);
7242
7034
  }, "_projDbl");
7243
7035
  Point.prototype.dbl = /* @__PURE__ */ __name(function dbl() {
7244
- if (this.isInfinity())
7245
- return this;
7246
- if (this.curve.extended)
7247
- return this._extDbl();
7248
- else
7249
- return this._projDbl();
7036
+ if (this.isInfinity()) return this;
7037
+ if (this.curve.extended) return this._extDbl();
7038
+ else return this._projDbl();
7250
7039
  }, "dbl");
7251
7040
  Point.prototype._extAdd = /* @__PURE__ */ __name(function _extAdd(p) {
7252
7041
  var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
@@ -7285,20 +7074,14 @@ var require_edwards = __commonJS({
7285
7074
  return this.curve.point(nx, ny, nz);
7286
7075
  }, "_projAdd");
7287
7076
  Point.prototype.add = /* @__PURE__ */ __name(function add(p) {
7288
- if (this.isInfinity())
7289
- return p;
7290
- if (p.isInfinity())
7291
- return this;
7292
- if (this.curve.extended)
7293
- return this._extAdd(p);
7294
- else
7295
- return this._projAdd(p);
7077
+ if (this.isInfinity()) return p;
7078
+ if (p.isInfinity()) return this;
7079
+ if (this.curve.extended) return this._extAdd(p);
7080
+ else return this._projAdd(p);
7296
7081
  }, "add");
7297
7082
  Point.prototype.mul = /* @__PURE__ */ __name(function mul(k) {
7298
- if (this._hasDoubles(k))
7299
- return this.curve._fixedNafMul(this, k);
7300
- else
7301
- return this.curve._wnafMul(this, k);
7083
+ if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k);
7084
+ else return this.curve._wnafMul(this, k);
7302
7085
  }, "mul");
7303
7086
  Point.prototype.mulAdd = /* @__PURE__ */ __name(function mulAdd(k1, p, k2) {
7304
7087
  return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, false);
@@ -7307,13 +7090,11 @@ var require_edwards = __commonJS({
7307
7090
  return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, true);
7308
7091
  }, "jmulAdd");
7309
7092
  Point.prototype.normalize = /* @__PURE__ */ __name(function normalize() {
7310
- if (this.zOne)
7311
- return this;
7093
+ if (this.zOne) return this;
7312
7094
  var zi = this.z.redInvm();
7313
7095
  this.x = this.x.redMul(zi);
7314
7096
  this.y = this.y.redMul(zi);
7315
- if (this.t)
7316
- this.t = this.t.redMul(zi);
7097
+ if (this.t) this.t = this.t.redMul(zi);
7317
7098
  this.z = this.curve.one;
7318
7099
  this.zOne = true;
7319
7100
  return this;
@@ -7334,17 +7115,14 @@ var require_edwards = __commonJS({
7334
7115
  }, "eq");
7335
7116
  Point.prototype.eqXToP = /* @__PURE__ */ __name(function eqXToP(x) {
7336
7117
  var rx = x.toRed(this.curve.red).redMul(this.z);
7337
- if (this.x.cmp(rx) === 0)
7338
- return true;
7118
+ if (this.x.cmp(rx) === 0) return true;
7339
7119
  var xc = x.clone();
7340
7120
  var t = this.curve.redN.redMul(this.z);
7341
7121
  for (; ; ) {
7342
7122
  xc.iadd(this.curve.n);
7343
- if (xc.cmp(this.curve.p) >= 0)
7344
- return false;
7123
+ if (xc.cmp(this.curve.p) >= 0) return false;
7345
7124
  rx.redIAdd(t);
7346
- if (this.x.cmp(rx) === 0)
7347
- return true;
7125
+ if (this.x.cmp(rx) === 0) return true;
7348
7126
  }
7349
7127
  }, "eqXToP");
7350
7128
  Point.prototype.toP = Point.prototype.normalize;
@@ -7378,10 +7156,8 @@ var require_utils3 = __commonJS({
7378
7156
  }
7379
7157
  __name(isSurrogatePair, "isSurrogatePair");
7380
7158
  function toArray(msg, enc) {
7381
- if (Array.isArray(msg))
7382
- return msg.slice();
7383
- if (!msg)
7384
- return [];
7159
+ if (Array.isArray(msg)) return msg.slice();
7160
+ if (!msg) return [];
7385
7161
  var res = [];
7386
7162
  if (typeof msg === "string") {
7387
7163
  if (!enc) {
@@ -7407,14 +7183,11 @@ var require_utils3 = __commonJS({
7407
7183
  }
7408
7184
  } else if (enc === "hex") {
7409
7185
  msg = msg.replace(/[^a-z0-9]+/gi, "");
7410
- if (msg.length % 2 !== 0)
7411
- msg = "0" + msg;
7412
- for (i = 0; i < msg.length; i += 2)
7413
- res.push(parseInt(msg[i] + msg[i + 1], 16));
7186
+ if (msg.length % 2 !== 0) msg = "0" + msg;
7187
+ for (i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));
7414
7188
  }
7415
7189
  } else {
7416
- for (i = 0; i < msg.length; i++)
7417
- res[i] = msg[i] | 0;
7190
+ for (i = 0; i < msg.length; i++) res[i] = msg[i] | 0;
7418
7191
  }
7419
7192
  return res;
7420
7193
  }
@@ -7422,8 +7195,7 @@ var require_utils3 = __commonJS({
7422
7195
  exports2.toArray = toArray;
7423
7196
  function toHex2(msg) {
7424
7197
  var res = "";
7425
- for (var i = 0; i < msg.length; i++)
7426
- res += zero2(msg[i].toString(16));
7198
+ for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));
7427
7199
  return res;
7428
7200
  }
7429
7201
  __name(toHex2, "toHex");
@@ -7438,8 +7210,7 @@ var require_utils3 = __commonJS({
7438
7210
  var res = "";
7439
7211
  for (var i = 0; i < msg.length; i++) {
7440
7212
  var w = msg[i];
7441
- if (endian === "little")
7442
- w = htonl(w);
7213
+ if (endian === "little") w = htonl(w);
7443
7214
  res += zero8(w.toString(16));
7444
7215
  }
7445
7216
  return res;
@@ -7447,30 +7218,20 @@ var require_utils3 = __commonJS({
7447
7218
  __name(toHex32, "toHex32");
7448
7219
  exports2.toHex32 = toHex32;
7449
7220
  function zero2(word) {
7450
- if (word.length === 1)
7451
- return "0" + word;
7452
- else
7453
- return word;
7221
+ if (word.length === 1) return "0" + word;
7222
+ else return word;
7454
7223
  }
7455
7224
  __name(zero2, "zero2");
7456
7225
  exports2.zero2 = zero2;
7457
7226
  function zero8(word) {
7458
- if (word.length === 7)
7459
- return "0" + word;
7460
- else if (word.length === 6)
7461
- return "00" + word;
7462
- else if (word.length === 5)
7463
- return "000" + word;
7464
- else if (word.length === 4)
7465
- return "0000" + word;
7466
- else if (word.length === 3)
7467
- return "00000" + word;
7468
- else if (word.length === 2)
7469
- return "000000" + word;
7470
- else if (word.length === 1)
7471
- return "0000000" + word;
7472
- else
7473
- return word;
7227
+ if (word.length === 7) return "0" + word;
7228
+ else if (word.length === 6) return "00" + word;
7229
+ else if (word.length === 5) return "000" + word;
7230
+ else if (word.length === 4) return "0000" + word;
7231
+ else if (word.length === 3) return "00000" + word;
7232
+ else if (word.length === 2) return "000000" + word;
7233
+ else if (word.length === 1) return "0000000" + word;
7234
+ else return word;
7474
7235
  }
7475
7236
  __name(zero8, "zero8");
7476
7237
  exports2.zero8 = zero8;
@@ -7480,10 +7241,8 @@ var require_utils3 = __commonJS({
7480
7241
  var res = new Array(len / 4);
7481
7242
  for (var i = 0, k = start; i < res.length; i++, k += 4) {
7482
7243
  var w;
7483
- if (endian === "big")
7484
- w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3];
7485
- else
7486
- w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k];
7244
+ if (endian === "big") w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3];
7245
+ else w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k];
7487
7246
  res[i] = w >>> 0;
7488
7247
  }
7489
7248
  return res;
@@ -7650,20 +7409,16 @@ var require_common = __commonJS({
7650
7409
  exports2.BlockHash = BlockHash;
7651
7410
  BlockHash.prototype.update = /* @__PURE__ */ __name(function update(msg, enc) {
7652
7411
  msg = utils.toArray(msg, enc);
7653
- if (!this.pending)
7654
- this.pending = msg;
7655
- else
7656
- this.pending = this.pending.concat(msg);
7412
+ if (!this.pending) this.pending = msg;
7413
+ else this.pending = this.pending.concat(msg);
7657
7414
  this.pendingTotal += msg.length;
7658
7415
  if (this.pending.length >= this._delta8) {
7659
7416
  msg = this.pending;
7660
7417
  var r = msg.length % this._delta8;
7661
7418
  this.pending = msg.slice(msg.length - r, msg.length);
7662
- if (this.pending.length === 0)
7663
- this.pending = null;
7419
+ if (this.pending.length === 0) this.pending = null;
7664
7420
  msg = utils.join32(msg, 0, msg.length - r, this.endian);
7665
- for (var i = 0; i < msg.length; i += this._delta32)
7666
- this._update(msg, i, i + this._delta32);
7421
+ for (var i = 0; i < msg.length; i += this._delta32) this._update(msg, i, i + this._delta32);
7667
7422
  }
7668
7423
  return this;
7669
7424
  }, "update");
@@ -7678,12 +7433,10 @@ var require_common = __commonJS({
7678
7433
  var k = bytes - (len + this.padLength) % bytes;
7679
7434
  var res = new Array(k + this.padLength);
7680
7435
  res[0] = 128;
7681
- for (var i = 1; i < k; i++)
7682
- res[i] = 0;
7436
+ for (var i = 1; i < k; i++) res[i] = 0;
7683
7437
  len <<= 3;
7684
7438
  if (this.endian === "big") {
7685
- for (var t = 8; t < this.padLength; t++)
7686
- res[i++] = 0;
7439
+ for (var t = 8; t < this.padLength; t++) res[i++] = 0;
7687
7440
  res[i++] = 0;
7688
7441
  res[i++] = 0;
7689
7442
  res[i++] = 0;
@@ -7701,8 +7454,7 @@ var require_common = __commonJS({
7701
7454
  res[i++] = 0;
7702
7455
  res[i++] = 0;
7703
7456
  res[i++] = 0;
7704
- for (t = 8; t < this.padLength; t++)
7705
- res[i++] = 0;
7457
+ for (t = 8; t < this.padLength; t++) res[i++] = 0;
7706
7458
  }
7707
7459
  return res;
7708
7460
  }, "pad");
@@ -7714,12 +7466,9 @@ var require_common2 = __commonJS({
7714
7466
  var utils = require_utils3();
7715
7467
  var rotr32 = utils.rotr32;
7716
7468
  function ft_1(s, x, y, z) {
7717
- if (s === 0)
7718
- return ch32(x, y, z);
7719
- if (s === 1 || s === 3)
7720
- return p32(x, y, z);
7721
- if (s === 2)
7722
- return maj32(x, y, z);
7469
+ if (s === 0) return ch32(x, y, z);
7470
+ if (s === 1 || s === 3) return p32(x, y, z);
7471
+ if (s === 2) return maj32(x, y, z);
7723
7472
  }
7724
7473
  __name(ft_1, "ft_1");
7725
7474
  exports2.ft_1 = ft_1;
@@ -7773,8 +7522,7 @@ var require__ = __commonJS({
7773
7522
  var BlockHash = common.BlockHash;
7774
7523
  var sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];
7775
7524
  function SHA1() {
7776
- if (!(this instanceof SHA1))
7777
- return new SHA1();
7525
+ if (!(this instanceof SHA1)) return new SHA1();
7778
7526
  BlockHash.call(this);
7779
7527
  this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
7780
7528
  this.W = new Array(80);
@@ -7788,10 +7536,8 @@ var require__ = __commonJS({
7788
7536
  SHA1.padLength = 64;
7789
7537
  SHA1.prototype._update = /* @__PURE__ */ __name(function _update(msg, start) {
7790
7538
  var W = this.W;
7791
- for (var i = 0; i < 16; i++)
7792
- W[i] = msg[start + i];
7793
- for (; i < W.length; i++)
7794
- W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
7539
+ for (var i = 0; i < 16; i++) W[i] = msg[start + i];
7540
+ for (; i < W.length; i++) W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
7795
7541
  var a = this.h[0];
7796
7542
  var b = this.h[1];
7797
7543
  var c = this.h[2];
@@ -7813,10 +7559,8 @@ var require__ = __commonJS({
7813
7559
  this.h[4] = sum32(this.h[4], e);
7814
7560
  }, "_update");
7815
7561
  SHA1.prototype._digest = /* @__PURE__ */ __name(function digest(enc) {
7816
- if (enc === "hex")
7817
- return utils.toHex32(this.h, "big");
7818
- else
7819
- return utils.split32(this.h, "big");
7562
+ if (enc === "hex") return utils.toHex32(this.h, "big");
7563
+ else return utils.split32(this.h, "big");
7820
7564
  }, "digest");
7821
7565
  }
7822
7566
  });
@@ -7904,8 +7648,7 @@ var require__2 = __commonJS({
7904
7648
  3329325298
7905
7649
  ];
7906
7650
  function SHA256() {
7907
- if (!(this instanceof SHA256))
7908
- return new SHA256();
7651
+ if (!(this instanceof SHA256)) return new SHA256();
7909
7652
  BlockHash.call(this);
7910
7653
  this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225];
7911
7654
  this.k = sha256_K;
@@ -7920,10 +7663,8 @@ var require__2 = __commonJS({
7920
7663
  SHA256.padLength = 64;
7921
7664
  SHA256.prototype._update = /* @__PURE__ */ __name(function _update(msg, start) {
7922
7665
  var W = this.W;
7923
- for (var i = 0; i < 16; i++)
7924
- W[i] = msg[start + i];
7925
- for (; i < W.length; i++)
7926
- W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
7666
+ for (var i = 0; i < 16; i++) W[i] = msg[start + i];
7667
+ for (; i < W.length; i++) W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
7927
7668
  var a = this.h[0];
7928
7669
  var b = this.h[1];
7929
7670
  var c = this.h[2];
@@ -7955,10 +7696,8 @@ var require__2 = __commonJS({
7955
7696
  this.h[7] = sum32(this.h[7], h);
7956
7697
  }, "_update");
7957
7698
  SHA256.prototype._digest = /* @__PURE__ */ __name(function digest(enc) {
7958
- if (enc === "hex")
7959
- return utils.toHex32(this.h, "big");
7960
- else
7961
- return utils.split32(this.h, "big");
7699
+ if (enc === "hex") return utils.toHex32(this.h, "big");
7700
+ else return utils.split32(this.h, "big");
7962
7701
  }, "digest");
7963
7702
  }
7964
7703
  });
@@ -7968,8 +7707,7 @@ var require__3 = __commonJS({
7968
7707
  var utils = require_utils3();
7969
7708
  var SHA256 = require__2();
7970
7709
  function SHA224() {
7971
- if (!(this instanceof SHA224))
7972
- return new SHA224();
7710
+ if (!(this instanceof SHA224)) return new SHA224();
7973
7711
  SHA256.call(this);
7974
7712
  this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];
7975
7713
  }
@@ -7981,10 +7719,8 @@ var require__3 = __commonJS({
7981
7719
  SHA224.hmacStrength = 192;
7982
7720
  SHA224.padLength = 64;
7983
7721
  SHA224.prototype._digest = /* @__PURE__ */ __name(function digest(enc) {
7984
- if (enc === "hex")
7985
- return utils.toHex32(this.h.slice(0, 7), "big");
7986
- else
7987
- return utils.split32(this.h.slice(0, 7), "big");
7722
+ if (enc === "hex") return utils.toHex32(this.h.slice(0, 7), "big");
7723
+ else return utils.split32(this.h.slice(0, 7), "big");
7988
7724
  }, "digest");
7989
7725
  }
7990
7726
  });
@@ -8169,8 +7905,7 @@ var require__4 = __commonJS({
8169
7905
  1246189591
8170
7906
  ];
8171
7907
  function SHA512() {
8172
- if (!(this instanceof SHA512))
8173
- return new SHA512();
7908
+ if (!(this instanceof SHA512)) return new SHA512();
8174
7909
  BlockHash.call(this);
8175
7910
  this.h = [
8176
7911
  1779033703,
@@ -8202,8 +7937,7 @@ var require__4 = __commonJS({
8202
7937
  SHA512.padLength = 128;
8203
7938
  SHA512.prototype._prepareBlock = /* @__PURE__ */ __name(function _prepareBlock(msg, start) {
8204
7939
  var W = this.W;
8205
- for (var i = 0; i < 32; i++)
8206
- W[i] = msg[start + i];
7940
+ for (var i = 0; i < 32; i++) W[i] = msg[start + i];
8207
7941
  for (; i < W.length; i += 2) {
8208
7942
  var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);
8209
7943
  var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
@@ -8283,36 +8017,30 @@ var require__4 = __commonJS({
8283
8017
  sum64(this.h, 14, hh, hl);
8284
8018
  }, "_update");
8285
8019
  SHA512.prototype._digest = /* @__PURE__ */ __name(function digest(enc) {
8286
- if (enc === "hex")
8287
- return utils.toHex32(this.h, "big");
8288
- else
8289
- return utils.split32(this.h, "big");
8020
+ if (enc === "hex") return utils.toHex32(this.h, "big");
8021
+ else return utils.split32(this.h, "big");
8290
8022
  }, "digest");
8291
8023
  function ch64_hi(xh, xl, yh, yl, zh) {
8292
8024
  var r = xh & yh ^ ~xh & zh;
8293
- if (r < 0)
8294
- r += 4294967296;
8025
+ if (r < 0) r += 4294967296;
8295
8026
  return r;
8296
8027
  }
8297
8028
  __name(ch64_hi, "ch64_hi");
8298
8029
  function ch64_lo(xh, xl, yh, yl, zh, zl) {
8299
8030
  var r = xl & yl ^ ~xl & zl;
8300
- if (r < 0)
8301
- r += 4294967296;
8031
+ if (r < 0) r += 4294967296;
8302
8032
  return r;
8303
8033
  }
8304
8034
  __name(ch64_lo, "ch64_lo");
8305
8035
  function maj64_hi(xh, xl, yh, yl, zh) {
8306
8036
  var r = xh & yh ^ xh & zh ^ yh & zh;
8307
- if (r < 0)
8308
- r += 4294967296;
8037
+ if (r < 0) r += 4294967296;
8309
8038
  return r;
8310
8039
  }
8311
8040
  __name(maj64_hi, "maj64_hi");
8312
8041
  function maj64_lo(xh, xl, yh, yl, zh, zl) {
8313
8042
  var r = xl & yl ^ xl & zl ^ yl & zl;
8314
- if (r < 0)
8315
- r += 4294967296;
8043
+ if (r < 0) r += 4294967296;
8316
8044
  return r;
8317
8045
  }
8318
8046
  __name(maj64_lo, "maj64_lo");
@@ -8321,8 +8049,7 @@ var require__4 = __commonJS({
8321
8049
  var c1_hi = rotr64_hi(xl, xh, 2);
8322
8050
  var c2_hi = rotr64_hi(xl, xh, 7);
8323
8051
  var r = c0_hi ^ c1_hi ^ c2_hi;
8324
- if (r < 0)
8325
- r += 4294967296;
8052
+ if (r < 0) r += 4294967296;
8326
8053
  return r;
8327
8054
  }
8328
8055
  __name(s0_512_hi, "s0_512_hi");
@@ -8331,8 +8058,7 @@ var require__4 = __commonJS({
8331
8058
  var c1_lo = rotr64_lo(xl, xh, 2);
8332
8059
  var c2_lo = rotr64_lo(xl, xh, 7);
8333
8060
  var r = c0_lo ^ c1_lo ^ c2_lo;
8334
- if (r < 0)
8335
- r += 4294967296;
8061
+ if (r < 0) r += 4294967296;
8336
8062
  return r;
8337
8063
  }
8338
8064
  __name(s0_512_lo, "s0_512_lo");
@@ -8341,8 +8067,7 @@ var require__4 = __commonJS({
8341
8067
  var c1_hi = rotr64_hi(xh, xl, 18);
8342
8068
  var c2_hi = rotr64_hi(xl, xh, 9);
8343
8069
  var r = c0_hi ^ c1_hi ^ c2_hi;
8344
- if (r < 0)
8345
- r += 4294967296;
8070
+ if (r < 0) r += 4294967296;
8346
8071
  return r;
8347
8072
  }
8348
8073
  __name(s1_512_hi, "s1_512_hi");
@@ -8351,8 +8076,7 @@ var require__4 = __commonJS({
8351
8076
  var c1_lo = rotr64_lo(xh, xl, 18);
8352
8077
  var c2_lo = rotr64_lo(xl, xh, 9);
8353
8078
  var r = c0_lo ^ c1_lo ^ c2_lo;
8354
- if (r < 0)
8355
- r += 4294967296;
8079
+ if (r < 0) r += 4294967296;
8356
8080
  return r;
8357
8081
  }
8358
8082
  __name(s1_512_lo, "s1_512_lo");
@@ -8361,8 +8085,7 @@ var require__4 = __commonJS({
8361
8085
  var c1_hi = rotr64_hi(xh, xl, 8);
8362
8086
  var c2_hi = shr64_hi(xh, xl, 7);
8363
8087
  var r = c0_hi ^ c1_hi ^ c2_hi;
8364
- if (r < 0)
8365
- r += 4294967296;
8088
+ if (r < 0) r += 4294967296;
8366
8089
  return r;
8367
8090
  }
8368
8091
  __name(g0_512_hi, "g0_512_hi");
@@ -8371,8 +8094,7 @@ var require__4 = __commonJS({
8371
8094
  var c1_lo = rotr64_lo(xh, xl, 8);
8372
8095
  var c2_lo = shr64_lo(xh, xl, 7);
8373
8096
  var r = c0_lo ^ c1_lo ^ c2_lo;
8374
- if (r < 0)
8375
- r += 4294967296;
8097
+ if (r < 0) r += 4294967296;
8376
8098
  return r;
8377
8099
  }
8378
8100
  __name(g0_512_lo, "g0_512_lo");
@@ -8381,8 +8103,7 @@ var require__4 = __commonJS({
8381
8103
  var c1_hi = rotr64_hi(xl, xh, 29);
8382
8104
  var c2_hi = shr64_hi(xh, xl, 6);
8383
8105
  var r = c0_hi ^ c1_hi ^ c2_hi;
8384
- if (r < 0)
8385
- r += 4294967296;
8106
+ if (r < 0) r += 4294967296;
8386
8107
  return r;
8387
8108
  }
8388
8109
  __name(g1_512_hi, "g1_512_hi");
@@ -8391,8 +8112,7 @@ var require__4 = __commonJS({
8391
8112
  var c1_lo = rotr64_lo(xl, xh, 29);
8392
8113
  var c2_lo = shr64_lo(xh, xl, 6);
8393
8114
  var r = c0_lo ^ c1_lo ^ c2_lo;
8394
- if (r < 0)
8395
- r += 4294967296;
8115
+ if (r < 0) r += 4294967296;
8396
8116
  return r;
8397
8117
  }
8398
8118
  __name(g1_512_lo, "g1_512_lo");
@@ -8404,8 +8124,7 @@ var require__5 = __commonJS({
8404
8124
  var utils = require_utils3();
8405
8125
  var SHA512 = require__4();
8406
8126
  function SHA384() {
8407
- if (!(this instanceof SHA384))
8408
- return new SHA384();
8127
+ if (!(this instanceof SHA384)) return new SHA384();
8409
8128
  SHA512.call(this);
8410
8129
  this.h = [
8411
8130
  3418070365,
@@ -8434,10 +8153,8 @@ var require__5 = __commonJS({
8434
8153
  SHA384.hmacStrength = 192;
8435
8154
  SHA384.padLength = 128;
8436
8155
  SHA384.prototype._digest = /* @__PURE__ */ __name(function digest(enc) {
8437
- if (enc === "hex")
8438
- return utils.toHex32(this.h.slice(0, 12), "big");
8439
- else
8440
- return utils.split32(this.h.slice(0, 12), "big");
8156
+ if (enc === "hex") return utils.toHex32(this.h.slice(0, 12), "big");
8157
+ else return utils.split32(this.h.slice(0, 12), "big");
8441
8158
  }, "digest");
8442
8159
  }
8443
8160
  });
@@ -8462,8 +8179,7 @@ var require_ripemd = __commonJS({
8462
8179
  var sum32_4 = utils.sum32_4;
8463
8180
  var BlockHash = common.BlockHash;
8464
8181
  function RIPEMD160() {
8465
- if (!(this instanceof RIPEMD160))
8466
- return new RIPEMD160();
8182
+ if (!(this instanceof RIPEMD160)) return new RIPEMD160();
8467
8183
  BlockHash.call(this);
8468
8184
  this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
8469
8185
  this.endian = "little";
@@ -8508,48 +8224,31 @@ var require_ripemd = __commonJS({
8508
8224
  this.h[0] = T;
8509
8225
  }, "update");
8510
8226
  RIPEMD160.prototype._digest = /* @__PURE__ */ __name(function digest(enc) {
8511
- if (enc === "hex")
8512
- return utils.toHex32(this.h, "little");
8513
- else
8514
- return utils.split32(this.h, "little");
8227
+ if (enc === "hex") return utils.toHex32(this.h, "little");
8228
+ else return utils.split32(this.h, "little");
8515
8229
  }, "digest");
8516
8230
  function f(j, x, y, z) {
8517
- if (j <= 15)
8518
- return x ^ y ^ z;
8519
- else if (j <= 31)
8520
- return x & y | ~x & z;
8521
- else if (j <= 47)
8522
- return (x | ~y) ^ z;
8523
- else if (j <= 63)
8524
- return x & z | y & ~z;
8525
- else
8526
- return x ^ (y | ~z);
8231
+ if (j <= 15) return x ^ y ^ z;
8232
+ else if (j <= 31) return x & y | ~x & z;
8233
+ else if (j <= 47) return (x | ~y) ^ z;
8234
+ else if (j <= 63) return x & z | y & ~z;
8235
+ else return x ^ (y | ~z);
8527
8236
  }
8528
8237
  __name(f, "f");
8529
8238
  function K(j) {
8530
- if (j <= 15)
8531
- return 0;
8532
- else if (j <= 31)
8533
- return 1518500249;
8534
- else if (j <= 47)
8535
- return 1859775393;
8536
- else if (j <= 63)
8537
- return 2400959708;
8538
- else
8539
- return 2840853838;
8239
+ if (j <= 15) return 0;
8240
+ else if (j <= 31) return 1518500249;
8241
+ else if (j <= 47) return 1859775393;
8242
+ else if (j <= 63) return 2400959708;
8243
+ else return 2840853838;
8540
8244
  }
8541
8245
  __name(K, "K");
8542
8246
  function Kh(j) {
8543
- if (j <= 15)
8544
- return 1352829926;
8545
- else if (j <= 31)
8546
- return 1548603684;
8547
- else if (j <= 47)
8548
- return 1836072691;
8549
- else if (j <= 63)
8550
- return 2053994217;
8551
- else
8552
- return 0;
8247
+ if (j <= 15) return 1352829926;
8248
+ else if (j <= 31) return 1548603684;
8249
+ else if (j <= 47) return 1836072691;
8250
+ else if (j <= 63) return 2053994217;
8251
+ else return 0;
8553
8252
  }
8554
8253
  __name(Kh, "Kh");
8555
8254
  var r = [
@@ -8888,8 +8587,7 @@ var require_hmac = __commonJS({
8888
8587
  var utils = require_utils3();
8889
8588
  var assert = require_minimalistic_assert();
8890
8589
  function Hmac(hash, key, enc) {
8891
- if (!(this instanceof Hmac))
8892
- return new Hmac(hash, key, enc);
8590
+ if (!(this instanceof Hmac)) return new Hmac(hash, key, enc);
8893
8591
  this.Hash = hash;
8894
8592
  this.blockSize = hash.blockSize / 8;
8895
8593
  this.outSize = hash.outSize / 8;
@@ -8900,16 +8598,12 @@ var require_hmac = __commonJS({
8900
8598
  __name(Hmac, "Hmac");
8901
8599
  module2.exports = Hmac;
8902
8600
  Hmac.prototype._init = /* @__PURE__ */ __name(function init(key) {
8903
- if (key.length > this.blockSize)
8904
- key = new this.Hash().update(key).digest();
8601
+ if (key.length > this.blockSize) key = new this.Hash().update(key).digest();
8905
8602
  assert(key.length <= this.blockSize);
8906
- for (var i = key.length; i < this.blockSize; i++)
8907
- key.push(0);
8908
- for (i = 0; i < key.length; i++)
8909
- key[i] ^= 54;
8603
+ for (var i = key.length; i < this.blockSize; i++) key.push(0);
8604
+ for (i = 0; i < key.length; i++) key[i] ^= 54;
8910
8605
  this.inner = new this.Hash().update(key);
8911
- for (i = 0; i < key.length; i++)
8912
- key[i] ^= 106;
8606
+ for (i = 0; i < key.length; i++) key[i] ^= 106;
8913
8607
  this.outer = new this.Hash().update(key);
8914
8608
  }, "init");
8915
8609
  Hmac.prototype.update = /* @__PURE__ */ __name(function update(msg, enc) {
@@ -9731,12 +9425,9 @@ var require_curves = __commonJS({
9731
9425
  var utils = require_utils2();
9732
9426
  var assert = utils.assert;
9733
9427
  function PresetCurve(options) {
9734
- if (options.type === "short")
9735
- this.curve = new curve.short(options);
9736
- else if (options.type === "edwards")
9737
- this.curve = new curve.edwards(options);
9738
- else
9739
- this.curve = new curve.mont(options);
9428
+ if (options.type === "short") this.curve = new curve.short(options);
9429
+ else if (options.type === "edwards") this.curve = new curve.edwards(options);
9430
+ else this.curve = new curve.mont(options);
9740
9431
  this.g = this.curve.g;
9741
9432
  this.n = this.curve.n;
9742
9433
  this.hash = options.hash;
@@ -9749,7 +9440,7 @@ var require_curves = __commonJS({
9749
9440
  Object.defineProperty(curves, name, {
9750
9441
  configurable: true,
9751
9442
  enumerable: true,
9752
- get: function() {
9443
+ get: /* @__PURE__ */ __name(function() {
9753
9444
  var curve2 = new PresetCurve(options);
9754
9445
  Object.defineProperty(curves, name, {
9755
9446
  configurable: true,
@@ -9757,7 +9448,7 @@ var require_curves = __commonJS({
9757
9448
  value: curve2
9758
9449
  });
9759
9450
  return curve2;
9760
- }
9451
+ }, "get")
9761
9452
  });
9762
9453
  }
9763
9454
  __name(defineCurve, "defineCurve");
@@ -9903,8 +9594,7 @@ var require_hmac_drbg = __commonJS({
9903
9594
  var utils = require_utils();
9904
9595
  var assert = require_minimalistic_assert();
9905
9596
  function HmacDRBG(options) {
9906
- if (!(this instanceof HmacDRBG))
9907
- return new HmacDRBG(options);
9597
+ if (!(this instanceof HmacDRBG)) return new HmacDRBG(options);
9908
9598
  this.hash = options.hash;
9909
9599
  this.predResist = !!options.predResist;
9910
9600
  this.outLen = this.hash.outSize;
@@ -9938,12 +9628,10 @@ var require_hmac_drbg = __commonJS({
9938
9628
  }, "hmac");
9939
9629
  HmacDRBG.prototype._update = /* @__PURE__ */ __name(function update(seed) {
9940
9630
  var kmac = this._hmac().update(this.V).update([0]);
9941
- if (seed)
9942
- kmac = kmac.update(seed);
9631
+ if (seed) kmac = kmac.update(seed);
9943
9632
  this.K = kmac.digest();
9944
9633
  this.V = this._hmac().update(this.V).digest();
9945
- if (!seed)
9946
- return;
9634
+ if (!seed) return;
9947
9635
  this.K = this._hmac().update(this.V).update([1]).update(seed).digest();
9948
9636
  this.V = this._hmac().update(this.V).digest();
9949
9637
  }, "update");
@@ -9960,8 +9648,7 @@ var require_hmac_drbg = __commonJS({
9960
9648
  this._reseed = 1;
9961
9649
  }, "reseed");
9962
9650
  HmacDRBG.prototype.generate = /* @__PURE__ */ __name(function generate(len, enc, add, addEnc) {
9963
- if (this._reseed > this.reseedInterval)
9964
- throw new Error("Reseed is required");
9651
+ if (this._reseed > this.reseedInterval) throw new Error("Reseed is required");
9965
9652
  if (typeof enc !== "string") {
9966
9653
  addEnc = add;
9967
9654
  add = enc;
@@ -9993,24 +9680,20 @@ var require_key = __commonJS({
9993
9680
  this.ec = ec2;
9994
9681
  this.priv = null;
9995
9682
  this.pub = null;
9996
- if (options.priv)
9997
- this._importPrivate(options.priv, options.privEnc);
9998
- if (options.pub)
9999
- this._importPublic(options.pub, options.pubEnc);
9683
+ if (options.priv) this._importPrivate(options.priv, options.privEnc);
9684
+ if (options.pub) this._importPublic(options.pub, options.pubEnc);
10000
9685
  }
10001
9686
  __name(KeyPair, "KeyPair");
10002
9687
  module2.exports = KeyPair;
10003
9688
  KeyPair.fromPublic = /* @__PURE__ */ __name(function fromPublic(ec2, pub, enc) {
10004
- if (pub instanceof KeyPair)
10005
- return pub;
9689
+ if (pub instanceof KeyPair) return pub;
10006
9690
  return new KeyPair(ec2, {
10007
9691
  pub,
10008
9692
  pubEnc: enc
10009
9693
  });
10010
9694
  }, "fromPublic");
10011
9695
  KeyPair.fromPrivate = /* @__PURE__ */ __name(function fromPrivate(ec2, priv, enc) {
10012
- if (priv instanceof KeyPair)
10013
- return priv;
9696
+ if (priv instanceof KeyPair) return priv;
10014
9697
  return new KeyPair(ec2, {
10015
9698
  priv,
10016
9699
  privEnc: enc
@@ -10018,12 +9701,9 @@ var require_key = __commonJS({
10018
9701
  }, "fromPrivate");
10019
9702
  KeyPair.prototype.validate = /* @__PURE__ */ __name(function validate() {
10020
9703
  var pub = this.getPublic();
10021
- if (pub.isInfinity())
10022
- return { result: false, reason: "Invalid public key" };
10023
- if (!pub.validate())
10024
- return { result: false, reason: "Public key is not a point" };
10025
- if (!pub.mul(this.ec.curve.n).isInfinity())
10026
- return { result: false, reason: "Public key * N != O" };
9704
+ if (pub.isInfinity()) return { result: false, reason: "Invalid public key" };
9705
+ if (!pub.validate()) return { result: false, reason: "Public key is not a point" };
9706
+ if (!pub.mul(this.ec.curve.n).isInfinity()) return { result: false, reason: "Public key * N != O" };
10027
9707
  return { result: true, reason: null };
10028
9708
  }, "validate");
10029
9709
  KeyPair.prototype.getPublic = /* @__PURE__ */ __name(function getPublic(compact, enc) {
@@ -10031,17 +9711,13 @@ var require_key = __commonJS({
10031
9711
  enc = compact;
10032
9712
  compact = null;
10033
9713
  }
10034
- if (!this.pub)
10035
- this.pub = this.ec.g.mul(this.priv);
10036
- if (!enc)
10037
- return this.pub;
9714
+ if (!this.pub) this.pub = this.ec.g.mul(this.priv);
9715
+ if (!enc) return this.pub;
10038
9716
  return this.pub.encode(enc, compact);
10039
9717
  }, "getPublic");
10040
9718
  KeyPair.prototype.getPrivate = /* @__PURE__ */ __name(function getPrivate(enc) {
10041
- if (enc === "hex")
10042
- return this.priv.toString(16, 2);
10043
- else
10044
- return this.priv;
9719
+ if (enc === "hex") return this.priv.toString(16, 2);
9720
+ else return this.priv;
10045
9721
  }, "getPrivate");
10046
9722
  KeyPair.prototype._importPrivate = /* @__PURE__ */ __name(function _importPrivate(key, enc) {
10047
9723
  this.priv = new BN(key, enc || 16);
@@ -10083,17 +9759,13 @@ var require_signature = __commonJS({
10083
9759
  var utils = require_utils2();
10084
9760
  var assert = utils.assert;
10085
9761
  function Signature(options, enc) {
10086
- if (options instanceof Signature)
10087
- return options;
10088
- if (this._importDER(options, enc))
10089
- return;
9762
+ if (options instanceof Signature) return options;
9763
+ if (this._importDER(options, enc)) return;
10090
9764
  assert(options.r && options.s, "Signature without r or s");
10091
9765
  this.r = new BN(options.r, 16);
10092
9766
  this.s = new BN(options.s, 16);
10093
- if (options.recoveryParam === void 0)
10094
- this.recoveryParam = null;
10095
- else
10096
- this.recoveryParam = options.recoveryParam;
9767
+ if (options.recoveryParam === void 0) this.recoveryParam = null;
9768
+ else this.recoveryParam = options.recoveryParam;
10097
9769
  }
10098
9770
  __name(Signature, "Signature");
10099
9771
  module2.exports = Signature;
@@ -10203,10 +9875,8 @@ var require_signature = __commonJS({
10203
9875
  Signature.prototype.toDER = /* @__PURE__ */ __name(function toDER(enc) {
10204
9876
  var r = this.r.toArray();
10205
9877
  var s = this.s.toArray();
10206
- if (r[0] & 128)
10207
- r = [0].concat(r);
10208
- if (s[0] & 128)
10209
- s = [0].concat(s);
9878
+ if (r[0] & 128) r = [0].concat(r);
9879
+ if (s[0] & 128) s = [0].concat(s);
10210
9880
  r = rmPadding(r);
10211
9881
  s = rmPadding(s);
10212
9882
  while (!s[0] && !(s[1] & 128)) {
@@ -10237,14 +9907,12 @@ var require_ec = __commonJS({
10237
9907
  var KeyPair = require_key();
10238
9908
  var Signature = require_signature();
10239
9909
  function EC(options) {
10240
- if (!(this instanceof EC))
10241
- return new EC(options);
9910
+ if (!(this instanceof EC)) return new EC(options);
10242
9911
  if (typeof options === "string") {
10243
9912
  assert(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options);
10244
9913
  options = curves[options];
10245
9914
  }
10246
- if (options instanceof curves.PresetCurve)
10247
- options = { curve: options };
9915
+ if (options instanceof curves.PresetCurve) options = { curve: options };
10248
9916
  this.curve = options.curve.curve;
10249
9917
  this.n = this.curve.n;
10250
9918
  this.nh = this.n.ushrn(1);
@@ -10265,8 +9933,7 @@ var require_ec = __commonJS({
10265
9933
  return KeyPair.fromPublic(this, pub, enc);
10266
9934
  }, "keyFromPublic");
10267
9935
  EC.prototype.genKeyPair = /* @__PURE__ */ __name(function genKeyPair(options) {
10268
- if (!options)
10269
- options = {};
9936
+ if (!options) options = {};
10270
9937
  var drbg = new HmacDRBG({
10271
9938
  hash: this.hash,
10272
9939
  pers: options.pers,
@@ -10279,28 +9946,23 @@ var require_ec = __commonJS({
10279
9946
  var ns2 = this.n.sub(new BN(2));
10280
9947
  for (; ; ) {
10281
9948
  var priv = new BN(drbg.generate(bytes));
10282
- if (priv.cmp(ns2) > 0)
10283
- continue;
9949
+ if (priv.cmp(ns2) > 0) continue;
10284
9950
  priv.iaddn(1);
10285
9951
  return this.keyFromPrivate(priv);
10286
9952
  }
10287
9953
  }, "genKeyPair");
10288
9954
  EC.prototype._truncateToN = /* @__PURE__ */ __name(function _truncateToN(msg, truncOnly) {
10289
9955
  var delta = msg.byteLength() * 8 - this.n.bitLength();
10290
- if (delta > 0)
10291
- msg = msg.ushrn(delta);
10292
- if (!truncOnly && msg.cmp(this.n) >= 0)
10293
- return msg.sub(this.n);
10294
- else
10295
- return msg;
9956
+ if (delta > 0) msg = msg.ushrn(delta);
9957
+ if (!truncOnly && msg.cmp(this.n) >= 0) return msg.sub(this.n);
9958
+ else return msg;
10296
9959
  }, "_truncateToN");
10297
9960
  EC.prototype.sign = /* @__PURE__ */ __name(function sign(msg, key, enc, options) {
10298
9961
  if (typeof enc === "object") {
10299
9962
  options = enc;
10300
9963
  enc = null;
10301
9964
  }
10302
- if (!options)
10303
- options = {};
9965
+ if (!options) options = {};
10304
9966
  key = this.keyFromPrivate(key, enc);
10305
9967
  msg = this._truncateToN(new BN(msg, 16));
10306
9968
  var bytes = this.n.byteLength();
@@ -10317,19 +9979,15 @@ var require_ec = __commonJS({
10317
9979
  for (var iter = 0; ; iter++) {
10318
9980
  var k = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));
10319
9981
  k = this._truncateToN(k, true);
10320
- if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
10321
- continue;
9982
+ if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) continue;
10322
9983
  var kp = this.g.mul(k);
10323
- if (kp.isInfinity())
10324
- continue;
9984
+ if (kp.isInfinity()) continue;
10325
9985
  var kpX = kp.getX();
10326
9986
  var r = kpX.umod(this.n);
10327
- if (r.cmpn(0) === 0)
10328
- continue;
9987
+ if (r.cmpn(0) === 0) continue;
10329
9988
  var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
10330
9989
  s = s.umod(this.n);
10331
- if (s.cmpn(0) === 0)
10332
- continue;
9990
+ if (s.cmpn(0) === 0) continue;
10333
9991
  var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r) !== 0 ? 2 : 0);
10334
9992
  if (options.canonical && s.cmp(this.nh) > 0) {
10335
9993
  s = this.n.sub(s);
@@ -10344,23 +10002,19 @@ var require_ec = __commonJS({
10344
10002
  signature = new Signature(signature, "hex");
10345
10003
  var r = signature.r;
10346
10004
  var s = signature.s;
10347
- if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
10348
- return false;
10349
- if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
10350
- return false;
10005
+ if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) return false;
10006
+ if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return false;
10351
10007
  var sinv = s.invm(this.n);
10352
10008
  var u1 = sinv.mul(msg).umod(this.n);
10353
10009
  var u2 = sinv.mul(r).umod(this.n);
10354
10010
  var p;
10355
10011
  if (!this.curve._maxwellTrick) {
10356
10012
  p = this.g.mulAdd(u1, key.getPublic(), u2);
10357
- if (p.isInfinity())
10358
- return false;
10013
+ if (p.isInfinity()) return false;
10359
10014
  return p.getX().umod(this.n).cmp(r) === 0;
10360
10015
  }
10361
10016
  p = this.g.jmulAdd(u1, key.getPublic(), u2);
10362
- if (p.isInfinity())
10363
- return false;
10017
+ if (p.isInfinity()) return false;
10364
10018
  return p.eqXToP(r);
10365
10019
  }, "verify");
10366
10020
  EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
@@ -10374,10 +10028,8 @@ var require_ec = __commonJS({
10374
10028
  var isSecondKey = j >> 1;
10375
10029
  if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
10376
10030
  throw new Error("Unable to find sencond key candinate");
10377
- if (isSecondKey)
10378
- r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
10379
- else
10380
- r = this.curve.pointFromX(r, isYOdd);
10031
+ if (isSecondKey) r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
10032
+ else r = this.curve.pointFromX(r, isYOdd);
10381
10033
  var rInv = signature.r.invm(n);
10382
10034
  var s1 = n.sub(e).mul(rInv).umod(n);
10383
10035
  var s2 = s.mul(rInv).umod(n);
@@ -10385,8 +10037,7 @@ var require_ec = __commonJS({
10385
10037
  };
10386
10038
  EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
10387
10039
  signature = new Signature(signature, enc);
10388
- if (signature.recoveryParam !== null)
10389
- return signature.recoveryParam;
10040
+ if (signature.recoveryParam !== null) return signature.recoveryParam;
10390
10041
  for (var i = 0; i < 4; i++) {
10391
10042
  var Qprime;
10392
10043
  try {
@@ -10394,8 +10045,7 @@ var require_ec = __commonJS({
10394
10045
  } catch (e2) {
10395
10046
  continue;
10396
10047
  }
10397
- if (Qprime.eq(Q))
10398
- return i;
10048
+ if (Qprime.eq(Q)) return i;
10399
10049
  }
10400
10050
  throw new Error("Unable to find valid recovery factor");
10401
10051
  };
@@ -10411,20 +10061,16 @@ var require_key2 = __commonJS({
10411
10061
  function KeyPair(eddsa, params) {
10412
10062
  this.eddsa = eddsa;
10413
10063
  this._secret = parseBytes(params.secret);
10414
- if (eddsa.isPoint(params.pub))
10415
- this._pub = params.pub;
10416
- else
10417
- this._pubBytes = parseBytes(params.pub);
10064
+ if (eddsa.isPoint(params.pub)) this._pub = params.pub;
10065
+ else this._pubBytes = parseBytes(params.pub);
10418
10066
  }
10419
10067
  __name(KeyPair, "KeyPair");
10420
10068
  KeyPair.fromPublic = /* @__PURE__ */ __name(function fromPublic(eddsa, pub) {
10421
- if (pub instanceof KeyPair)
10422
- return pub;
10069
+ if (pub instanceof KeyPair) return pub;
10423
10070
  return new KeyPair(eddsa, { pub });
10424
10071
  }, "fromPublic");
10425
10072
  KeyPair.fromSecret = /* @__PURE__ */ __name(function fromSecret(eddsa, secret) {
10426
- if (secret instanceof KeyPair)
10427
- return secret;
10073
+ if (secret instanceof KeyPair) return secret;
10428
10074
  return new KeyPair(eddsa, { secret });
10429
10075
  }, "fromSecret");
10430
10076
  KeyPair.prototype.secret = /* @__PURE__ */ __name(function secret() {
@@ -10434,8 +10080,7 @@ var require_key2 = __commonJS({
10434
10080
  return this.eddsa.encodePoint(this.pub());
10435
10081
  }, "pubBytes"));
10436
10082
  cachedProperty(KeyPair, "pub", /* @__PURE__ */ __name(function pub() {
10437
- if (this._pubBytes)
10438
- return this.eddsa.decodePoint(this._pubBytes);
10083
+ if (this._pubBytes) return this.eddsa.decodePoint(this._pubBytes);
10439
10084
  return this.eddsa.g.mul(this.priv());
10440
10085
  }, "pub"));
10441
10086
  cachedProperty(KeyPair, "privBytes", /* @__PURE__ */ __name(function privBytes() {
@@ -10484,8 +10129,7 @@ var require_signature2 = __commonJS({
10484
10129
  var parseBytes = utils.parseBytes;
10485
10130
  function Signature(eddsa, sig) {
10486
10131
  this.eddsa = eddsa;
10487
- if (typeof sig !== "object")
10488
- sig = parseBytes(sig);
10132
+ if (typeof sig !== "object") sig = parseBytes(sig);
10489
10133
  if (Array.isArray(sig)) {
10490
10134
  sig = {
10491
10135
  R: sig.slice(0, eddsa.encodingLength),
@@ -10493,10 +10137,8 @@ var require_signature2 = __commonJS({
10493
10137
  };
10494
10138
  }
10495
10139
  assert(sig.R && sig.S, "Signature without R or S");
10496
- if (eddsa.isPoint(sig.R))
10497
- this._R = sig.R;
10498
- if (sig.S instanceof BN)
10499
- this._S = sig.S;
10140
+ if (eddsa.isPoint(sig.R)) this._R = sig.R;
10141
+ if (sig.S instanceof BN) this._S = sig.S;
10500
10142
  this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
10501
10143
  this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
10502
10144
  }
@@ -10534,8 +10176,7 @@ var require_eddsa = __commonJS({
10534
10176
  var Signature = require_signature2();
10535
10177
  function EDDSA(curve) {
10536
10178
  assert(curve === "ed25519", "only tested with ed25519 so far");
10537
- if (!(this instanceof EDDSA))
10538
- return new EDDSA(curve);
10179
+ if (!(this instanceof EDDSA)) return new EDDSA(curve);
10539
10180
  curve = curves[curve].curve;
10540
10181
  this.curve = curve;
10541
10182
  this.g = curve.g;
@@ -10567,8 +10208,7 @@ var require_eddsa = __commonJS({
10567
10208
  }, "verify");
10568
10209
  EDDSA.prototype.hashInt = /* @__PURE__ */ __name(function hashInt() {
10569
10210
  var hash2 = this.hash();
10570
- for (var i = 0; i < arguments.length; i++)
10571
- hash2.update(arguments[i]);
10211
+ for (var i = 0; i < arguments.length; i++) hash2.update(arguments[i]);
10572
10212
  return utils.intFromLE(hash2.digest()).umod(this.curve.n);
10573
10213
  }, "hashInt");
10574
10214
  EDDSA.prototype.keyFromPublic = /* @__PURE__ */ __name(function keyFromPublic(pub) {
@@ -10578,8 +10218,7 @@ var require_eddsa = __commonJS({
10578
10218
  return KeyPair.fromSecret(this, secret);
10579
10219
  }, "keyFromSecret");
10580
10220
  EDDSA.prototype.makeSignature = /* @__PURE__ */ __name(function makeSignature(sig) {
10581
- if (sig instanceof Signature)
10582
- return sig;
10221
+ if (sig instanceof Signature) return sig;
10583
10222
  return new Signature(this, sig);
10584
10223
  }, "makeSignature");
10585
10224
  EDDSA.prototype.encodePoint = /* @__PURE__ */ __name(function encodePoint(point) {