@coinbase/cdp-hooks 0.0.93 → 0.0.94

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.
Files changed (270) hide show
  1. package/dist/esm/index.js +16 -16
  2. package/dist/esm/index100.js +42 -35
  3. package/dist/esm/index101.js +88 -9
  4. package/dist/esm/index102.js +40 -31
  5. package/dist/esm/index103.js +7 -35
  6. package/dist/esm/index104.js +4 -7
  7. package/dist/esm/index105.js +16 -29
  8. package/dist/esm/index106.js +8 -46
  9. package/dist/esm/index107.js +13 -88
  10. package/dist/esm/index108.js +7 -40
  11. package/dist/esm/index109.js +9 -8
  12. package/dist/esm/index110.js +15 -5
  13. package/dist/esm/index111.js +46 -16
  14. package/dist/esm/index112.js +13 -8
  15. package/dist/esm/index113.js +16 -13
  16. package/dist/esm/index114.js +13 -7
  17. package/dist/esm/index115.js +6 -9
  18. package/dist/esm/index116.js +34 -15
  19. package/dist/esm/index117.js +9 -46
  20. package/dist/esm/index118.js +8 -13
  21. package/dist/esm/index119.js +25 -16
  22. package/dist/esm/index120.js +10 -13
  23. package/dist/esm/index121.js +13 -5
  24. package/dist/esm/index122.js +11 -35
  25. package/dist/esm/index123.js +116 -9
  26. package/dist/esm/index124.js +32 -7
  27. package/dist/esm/index125.js +79 -25
  28. package/dist/esm/index126.js +177 -10
  29. package/dist/esm/index127.js +44 -14
  30. package/dist/esm/index128.js +6 -11
  31. package/dist/esm/index129.js +13 -116
  32. package/dist/esm/index130.js +12 -32
  33. package/dist/esm/index131.js +97 -77
  34. package/dist/esm/index132.js +67 -172
  35. package/dist/esm/index133.js +86 -43
  36. package/dist/esm/index134.js +148 -6
  37. package/dist/esm/index135.js +136 -13
  38. package/dist/esm/index136.js +68 -13
  39. package/dist/esm/index137.js +23 -99
  40. package/dist/esm/index138.js +104 -71
  41. package/dist/esm/index139.js +6 -87
  42. package/dist/esm/index140.js +128 -145
  43. package/dist/esm/index141.js +270 -131
  44. package/dist/esm/index142.js +3 -69
  45. package/dist/esm/index143.js +4 -24
  46. package/dist/esm/index144.js +9 -106
  47. package/dist/esm/index145.js +2 -7
  48. package/dist/esm/index146.js +2 -132
  49. package/dist/esm/index147.js +3 -276
  50. package/dist/esm/index148.js +327 -3
  51. package/dist/esm/index149.js +14 -4
  52. package/dist/esm/index150.js +5 -9
  53. package/dist/esm/index151.js +56 -2
  54. package/dist/esm/index152.js +2 -2
  55. package/dist/esm/index153.js +8 -3
  56. package/dist/esm/index154.js +166 -278
  57. package/dist/esm/index155.js +32 -14
  58. package/dist/esm/index156.js +21 -4
  59. package/dist/esm/index157.js +5 -55
  60. package/dist/esm/index158.js +74 -2
  61. package/dist/esm/index159.js +5 -7
  62. package/dist/esm/index160.js +5 -214
  63. package/dist/esm/index161.js +36 -32
  64. package/dist/esm/index162.js +74 -20
  65. package/dist/esm/index163.js +3 -6
  66. package/dist/esm/index164.js +18 -68
  67. package/dist/esm/index165.js +451 -5
  68. package/dist/esm/index166.js +30 -5
  69. package/dist/esm/index167.js +20 -29
  70. package/dist/esm/index168.js +21 -63
  71. package/dist/esm/index169.js +35 -3
  72. package/dist/esm/index170.js +186 -16
  73. package/dist/esm/index171.js +6 -449
  74. package/dist/esm/index172.js +2 -31
  75. package/dist/esm/index173.js +10 -24
  76. package/dist/esm/index174.js +13 -28
  77. package/dist/esm/index175.js +25 -32
  78. package/dist/esm/index176.js +8 -193
  79. package/dist/esm/index177.js +54 -7
  80. package/dist/esm/index178.js +46 -2
  81. package/dist/esm/index179.js +8 -12
  82. package/dist/esm/index180.js +7 -18
  83. package/dist/esm/index181.js +15 -26
  84. package/dist/esm/index182.js +18 -8
  85. package/dist/esm/index183.js +24 -55
  86. package/dist/esm/index184.js +16 -45
  87. package/dist/esm/index185.js +54 -8
  88. package/dist/esm/index186.js +11 -7
  89. package/dist/esm/index187.js +160 -16
  90. package/dist/esm/index188.js +20 -17
  91. package/dist/esm/index189.js +127 -24
  92. package/dist/esm/index190.js +37 -15
  93. package/dist/esm/index191.js +6 -54
  94. package/dist/esm/index192.js +27 -11
  95. package/dist/esm/index193.js +168 -137
  96. package/dist/esm/index194.js +4 -22
  97. package/dist/esm/index195.js +61 -124
  98. package/dist/esm/index196.js +3 -39
  99. package/dist/esm/index197.js +20 -6
  100. package/dist/esm/index198.js +16 -27
  101. package/dist/esm/index199.js +22 -190
  102. package/dist/esm/index200.js +12 -4
  103. package/dist/esm/index201.js +32 -62
  104. package/dist/esm/index202.js +3 -3
  105. package/dist/esm/index203.js +18 -20
  106. package/dist/esm/index204.js +27 -16
  107. package/dist/esm/index205.js +34 -22
  108. package/dist/esm/index206.js +7 -11
  109. package/dist/esm/index207.js +23 -32
  110. package/dist/esm/index208.js +29 -3
  111. package/dist/esm/index209.js +64 -18
  112. package/dist/esm/index210.js +9 -27
  113. package/dist/esm/index211.js +32 -34
  114. package/dist/esm/index212.js +27 -7
  115. package/dist/esm/index213.js +24 -25
  116. package/dist/esm/index214.js +3 -28
  117. package/dist/esm/index215.js +14 -64
  118. package/dist/esm/index216.js +103 -9
  119. package/dist/esm/index217.js +62 -31
  120. package/dist/esm/index218.js +5 -27
  121. package/dist/esm/index219.js +6 -24
  122. package/dist/esm/index220.js +27 -3
  123. package/dist/esm/index221.js +38 -14
  124. package/dist/esm/index222.js +13 -103
  125. package/dist/esm/index223.js +38 -60
  126. package/dist/esm/index224.js +5 -5
  127. package/dist/esm/index225.js +11 -6
  128. package/dist/esm/index226.js +19 -27
  129. package/dist/esm/index227.js +76 -36
  130. package/dist/esm/index228.js +2 -14
  131. package/dist/esm/index229.js +34 -39
  132. package/dist/esm/index230.js +110 -5
  133. package/dist/esm/index231.js +48 -11
  134. package/dist/esm/index232.js +32 -19
  135. package/dist/esm/index233.js +8 -78
  136. package/dist/esm/index234.js +7 -2
  137. package/dist/esm/index235.js +6 -37
  138. package/dist/esm/index236.js +11 -110
  139. package/dist/esm/index237.js +9 -47
  140. package/dist/esm/index238.js +13 -32
  141. package/dist/esm/index239.js +32 -8
  142. package/dist/esm/index240.js +5 -7
  143. package/dist/esm/index241.js +8 -6
  144. package/dist/esm/index242.js +19 -11
  145. package/dist/esm/index243.js +30 -9
  146. package/dist/esm/index244.js +20 -13
  147. package/dist/esm/index245.js +3 -32
  148. package/dist/esm/index246.js +18 -5
  149. package/dist/esm/index247.js +10 -8
  150. package/dist/esm/index248.js +21 -19
  151. package/dist/esm/index249.js +22 -31
  152. package/dist/esm/index250.js +5 -20
  153. package/dist/esm/index251.js +5 -3
  154. package/dist/esm/index252.js +8 -17
  155. package/dist/esm/index253.js +104 -10
  156. package/dist/esm/index254.js +3 -22
  157. package/dist/esm/index255.js +18 -22
  158. package/dist/esm/index256.js +171 -5
  159. package/dist/esm/index257.js +17 -5
  160. package/dist/esm/index258.js +10 -9
  161. package/dist/esm/index259.js +38 -104
  162. package/dist/esm/index260.js +2 -3
  163. package/dist/esm/index261.js +69 -18
  164. package/dist/esm/index262.js +33 -170
  165. package/dist/esm/index263.js +13 -16
  166. package/dist/esm/index264.js +41 -10
  167. package/dist/esm/index265.js +2 -41
  168. package/dist/esm/index266.js +5 -2
  169. package/dist/esm/index267.js +10 -4
  170. package/dist/esm/index268.js +18 -9
  171. package/dist/esm/index269.js +7 -19
  172. package/dist/esm/index270.js +11 -7
  173. package/dist/esm/index271.js +66 -11
  174. package/dist/esm/index272.js +64 -65
  175. package/dist/esm/index273.js +180 -60
  176. package/dist/esm/index274.js +20 -183
  177. package/dist/esm/index275.js +41 -21
  178. package/dist/esm/index276.js +54 -20
  179. package/dist/esm/index277.js +18 -54
  180. package/dist/esm/index278.js +10 -34
  181. package/dist/esm/index279.js +7 -10
  182. package/dist/esm/index280.js +7 -13
  183. package/dist/esm/index281.js +6 -7
  184. package/dist/esm/index282.js +36 -6
  185. package/dist/esm/index283.js +14 -35
  186. package/dist/esm/index284.js +8 -15
  187. package/dist/esm/index285.js +11 -7
  188. package/dist/esm/index286.js +9 -12
  189. package/dist/esm/index287.js +16 -9
  190. package/dist/esm/index288.js +21 -15
  191. package/dist/esm/index289.js +30 -22
  192. package/dist/esm/index290.js +2 -31
  193. package/dist/esm/index291.js +14 -2
  194. package/dist/esm/index292.js +12 -13
  195. package/dist/esm/index293.js +45 -10
  196. package/dist/esm/index294.js +9 -47
  197. package/dist/esm/index295.js +12 -8
  198. package/dist/esm/index296.js +14 -13
  199. package/dist/esm/index297.js +8 -14
  200. package/dist/esm/index298.js +13 -6
  201. package/dist/esm/index299.js +24 -15
  202. package/dist/esm/index3.js +1 -1
  203. package/dist/esm/index300.js +11 -24
  204. package/dist/esm/index301.js +23 -10
  205. package/dist/esm/index302.js +51 -24
  206. package/dist/esm/index303.js +17 -51
  207. package/dist/esm/index304.js +14 -17
  208. package/dist/esm/index305.js +11 -14
  209. package/dist/esm/index306.js +103 -11
  210. package/dist/esm/index307.js +5 -103
  211. package/dist/esm/index308.js +223 -5
  212. package/dist/esm/index309.js +6 -223
  213. package/dist/esm/index310.js +7 -7
  214. package/dist/esm/index311.js +27 -7
  215. package/dist/esm/index312.js +18 -25
  216. package/dist/esm/index313.js +144 -18
  217. package/dist/esm/index314.js +12 -145
  218. package/dist/esm/index315.js +35 -12
  219. package/dist/esm/index316.js +41 -35
  220. package/dist/esm/index317.js +2 -42
  221. package/dist/esm/index318.js +68 -3
  222. package/dist/esm/index319.js +3 -68
  223. package/dist/esm/index320.js +2 -2
  224. package/dist/esm/index321.js +155 -3
  225. package/dist/esm/index322.js +9 -155
  226. package/dist/esm/index323.js +16 -9
  227. package/dist/esm/index324.js +113 -16
  228. package/dist/esm/index325.js +116 -95
  229. package/dist/esm/index326.js +70 -126
  230. package/dist/esm/index327.js +2 -79
  231. package/dist/esm/index328.js +698 -2
  232. package/dist/esm/index329.js +126 -685
  233. package/dist/esm/index330.js +41 -137
  234. package/dist/esm/index331.js +198 -40
  235. package/dist/esm/index332.js +3 -200
  236. package/dist/esm/index335.js +1 -1
  237. package/dist/esm/index336.js +2 -2
  238. package/dist/esm/index340.js +2 -2
  239. package/dist/esm/index341.js +1 -1
  240. package/dist/esm/index37.js +24 -25
  241. package/dist/esm/index49.js +17 -18
  242. package/dist/esm/index50.js +5 -5
  243. package/dist/esm/index73.js +2 -2
  244. package/dist/esm/index74.js +2 -2
  245. package/dist/esm/index75.js +5 -5
  246. package/dist/esm/index76.js +2 -2
  247. package/dist/esm/index77.js +2 -2
  248. package/dist/esm/index79.js +31 -37
  249. package/dist/esm/index80.js +4 -2
  250. package/dist/esm/index81.js +9 -69
  251. package/dist/esm/index82.js +68 -34
  252. package/dist/esm/index83.js +8 -13
  253. package/dist/esm/index84.js +29 -2
  254. package/dist/esm/index85.js +69 -31
  255. package/dist/esm/index86.js +19 -3
  256. package/dist/esm/index87.js +110 -9
  257. package/dist/esm/index88.js +58 -66
  258. package/dist/esm/index89.js +22 -7
  259. package/dist/esm/index90.js +39 -27
  260. package/dist/esm/index91.js +36 -69
  261. package/dist/esm/index92.js +58 -19
  262. package/dist/esm/index93.js +163 -110
  263. package/dist/esm/index94.js +36 -57
  264. package/dist/esm/index95.js +8 -23
  265. package/dist/esm/index96.js +31 -40
  266. package/dist/esm/index97.js +33 -34
  267. package/dist/esm/index98.js +9 -58
  268. package/dist/esm/index99.js +25 -159
  269. package/dist/types/index.d.ts +12 -11
  270. package/package.json +3 -3
@@ -1,700 +1,141 @@
1
- import { hmac as dt } from "./index331.js";
2
- import { _validateObject as at, bitMask as ft, abool as Q, ensureBytes as z, memoized as nt, createHmacDrbg as ht, bytesToNumberBE as ct, numberToHexUnpadded as M, aInRange as mt } from "./index330.js";
3
- import { _createCurveFields as wt, wNAF as yt, normalizeZ as pt, pippenger as gt, mulEndoUnsafe as Et, negateCt as ot } from "./index332.js";
4
- import { Field as bt, mapHashToField as vt, getMinHashLength as Bt } from "./index309.js";
5
- import { concatBytes as I, abytes as it, bytesToHex as rt, hexToBytes as xt, randomBytes as St, isBytes as Rt } from "./index314.js";
6
- function st(e) {
7
- e.lowS !== void 0 && Q("lowS", e.lowS), e.prehash !== void 0 && Q("prehash", e.prehash);
1
+ import { hexToBytes as p, isBytes as B, abytes as v, bytesToHex as d, concatBytes as U } from "./index313.js";
2
+ import { anumber as W, randomBytes as C, utf8ToBytes as G } from "./index313.js";
3
+ const y = /* @__PURE__ */ BigInt(0), g = /* @__PURE__ */ BigInt(1);
4
+ function k(t, r) {
5
+ if (typeof r != "boolean")
6
+ throw new Error(t + " boolean expected, got " + r);
8
7
  }
9
- class Ot extends Error {
10
- constructor(i = "") {
11
- super(i);
12
- }
8
+ function j(t) {
9
+ const r = t.toString(16);
10
+ return r.length & 1 ? "0" + r : r;
13
11
  }
14
- const F = {
15
- // asn.1 DER encoding utils
16
- Err: Ot,
17
- // Basic building block is TLV (Tag-Length-Value)
18
- _tlv: {
19
- encode: (e, i) => {
20
- const { Err: t } = F;
21
- if (e < 0 || e > 256)
22
- throw new t("tlv.encode: wrong tag");
23
- if (i.length & 1)
24
- throw new t("tlv.encode: unpadded data");
25
- const w = i.length / 2, p = M(w);
26
- if (p.length / 2 & 128)
27
- throw new t("tlv.encode: long form length too big");
28
- const b = w > 127 ? M(p.length / 2 | 128) : "";
29
- return M(e) + b + p + i;
30
- },
31
- // v - value, l - left bytes (unparsed)
32
- decode(e, i) {
33
- const { Err: t } = F;
34
- let w = 0;
35
- if (e < 0 || e > 256)
36
- throw new t("tlv.encode: wrong tag");
37
- if (i.length < 2 || i[w++] !== e)
38
- throw new t("tlv.decode: wrong tlv");
39
- const p = i[w++], b = !!(p & 128);
40
- let u = 0;
41
- if (!b)
42
- u = p;
43
- else {
44
- const S = p & 127;
45
- if (!S)
46
- throw new t("tlv.decode(long): indefinite length not supported");
47
- if (S > 4)
48
- throw new t("tlv.decode(long): byte length is too big");
49
- const N = i.subarray(w, w + S);
50
- if (N.length !== S)
51
- throw new t("tlv.decode: length bytes not complete");
52
- if (N[0] === 0)
53
- throw new t("tlv.decode(long): zero leftmost byte");
54
- for (const q of N)
55
- u = u << 8 | q;
56
- if (w += S, u < 128)
57
- throw new t("tlv.decode(long): not minimal encoding");
58
- }
59
- const x = i.subarray(w, w + u);
60
- if (x.length !== u)
61
- throw new t("tlv.decode: wrong value length");
62
- return { v: x, l: i.subarray(w + u) };
63
- }
64
- },
65
- // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
66
- // since we always use positive integers here. It must always be empty:
67
- // - add zero byte if exists
68
- // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
69
- _int: {
70
- encode(e) {
71
- const { Err: i } = F;
72
- if (e < U)
73
- throw new i("integer: negative integers are not allowed");
74
- let t = M(e);
75
- if (Number.parseInt(t[0], 16) & 8 && (t = "00" + t), t.length & 1)
76
- throw new i("unexpected DER parsing assertion: unpadded hex");
77
- return t;
78
- },
79
- decode(e) {
80
- const { Err: i } = F;
81
- if (e[0] & 128)
82
- throw new i("invalid signature integer: negative");
83
- if (e[0] === 0 && !(e[1] & 128))
84
- throw new i("invalid signature integer: unnecessary leading zero");
85
- return ct(e);
86
- }
87
- },
88
- toSig(e) {
89
- const { Err: i, _int: t, _tlv: w } = F, p = z("signature", e), { v: b, l: u } = w.decode(48, p);
90
- if (u.length)
91
- throw new i("invalid signature: left bytes after parsing");
92
- const { v: x, l: S } = w.decode(2, b), { v: N, l: q } = w.decode(2, S);
93
- if (q.length)
94
- throw new i("invalid signature: left bytes after parsing");
95
- return { r: t.decode(x), s: t.decode(N) };
96
- },
97
- hexFromSig(e) {
98
- const { _tlv: i, _int: t } = F, w = i.encode(2, t.encode(e.r)), p = i.encode(2, t.encode(e.s)), b = w + p;
99
- return i.encode(48, b);
100
- }
101
- }, U = BigInt(0), k = BigInt(1), At = BigInt(2), W = BigInt(3), Zt = BigInt(4);
102
- function Tt(e, i, t) {
103
- function w(p) {
104
- const b = e.sqr(p), u = e.mul(b, p);
105
- return e.add(e.add(u, e.mul(p, i)), t);
106
- }
107
- return w;
12
+ function h(t) {
13
+ if (typeof t != "string")
14
+ throw new Error("hex string expected, got " + typeof t);
15
+ return t === "" ? y : BigInt("0x" + t);
108
16
  }
109
- function lt(e, i, t) {
110
- const { BYTES: w } = e;
111
- function p(b) {
112
- let u;
113
- if (typeof b == "bigint")
114
- u = b;
115
- else {
116
- let x = z("private key", b);
117
- if (i) {
118
- if (!i.includes(x.length * 2))
119
- throw new Error("invalid private key");
120
- const S = new Uint8Array(w);
121
- S.set(x, S.length - x.length), x = S;
122
- }
123
- try {
124
- u = e.fromBytes(x);
125
- } catch {
126
- throw new Error(`invalid private key: expected ui8a of size ${w}, got ${typeof b}`);
127
- }
128
- }
129
- if (t && (u = e.create(u)), !e.isValidNot0(u))
130
- throw new Error("invalid private key: out of range [1..N-1]");
131
- return u;
132
- }
133
- return p;
17
+ function H(t) {
18
+ return h(d(t));
134
19
  }
135
- function zt(e, i = {}) {
136
- const { Fp: t, Fn: w } = wt("weierstrass", e, i), { h: p, n: b } = e;
137
- at(i, {}, {
138
- allowInfinityPoint: "boolean",
139
- clearCofactor: "function",
140
- isTorsionFree: "function",
141
- fromBytes: "function",
142
- toBytes: "function",
143
- endo: "object",
144
- wrapPrivateKey: "boolean"
145
- });
146
- const { endo: u } = i;
147
- if (u && (!t.is0(e.a) || typeof u.beta != "bigint" || typeof u.splitScalar != "function"))
148
- throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');
149
- function x() {
150
- if (!t.isOdd)
151
- throw new Error("compression is not supported: Field does not have .isOdd()");
152
- }
153
- function S(v, r, s) {
154
- const { x: n, y: o } = r.toAffine(), a = t.toBytes(n);
155
- if (Q("isCompressed", s), s) {
156
- x();
157
- const d = !t.isOdd(o);
158
- return I(ut(d), a);
159
- } else
160
- return I(Uint8Array.of(4), a, t.toBytes(o));
161
- }
162
- function N(v) {
163
- it(v);
164
- const r = t.BYTES, s = r + 1, n = 2 * r + 1, o = v.length, a = v[0], d = v.subarray(1);
165
- if (o === s && (a === 2 || a === 3)) {
166
- const c = t.fromBytes(d);
167
- if (!t.isValid(c))
168
- throw new Error("bad point: is not on curve, wrong x");
169
- const l = T(c);
170
- let h;
171
- try {
172
- h = t.sqrt(l);
173
- } catch (g) {
174
- const m = g instanceof Error ? ": " + g.message : "";
175
- throw new Error("bad point: is not on curve, sqrt error" + m);
176
- }
177
- x();
178
- const f = t.isOdd(h);
179
- return (a & 1) === 1 !== f && (h = t.neg(h)), { x: c, y: h };
180
- } else if (o === n && a === 4) {
181
- const c = t.fromBytes(d.subarray(r * 0, r * 1)), l = t.fromBytes(d.subarray(r * 1, r * 2));
182
- if (!L(c, l))
183
- throw new Error("bad point: is not on curve");
184
- return { x: c, y: l };
185
- } else
186
- throw new Error(`bad point: got length ${o}, expected compressed=${s} or uncompressed=${n}`);
187
- }
188
- const q = i.toBytes || S, C = i.fromBytes || N, T = Tt(t, e.a, e.b);
189
- function L(v, r) {
190
- const s = t.sqr(r), n = T(v);
191
- return t.eql(s, n);
192
- }
193
- if (!L(e.Gx, e.Gy))
194
- throw new Error("bad curve params: generator point");
195
- const J = t.mul(t.pow(e.a, W), Zt), tt = t.mul(t.sqr(e.b), BigInt(27));
196
- if (t.is0(t.add(J, tt)))
197
- throw new Error("bad curve params: a or b");
198
- function K(v, r, s = !1) {
199
- if (!t.isValid(r) || s && t.is0(r))
200
- throw new Error(`bad point coordinate ${v}`);
201
- return r;
202
- }
203
- function G(v) {
204
- if (!(v instanceof y))
205
- throw new Error("ProjectivePoint expected");
206
- }
207
- const X = nt((v, r) => {
208
- const { px: s, py: n, pz: o } = v;
209
- if (t.eql(o, t.ONE))
210
- return { x: s, y: n };
211
- const a = v.is0();
212
- r == null && (r = a ? t.ONE : t.inv(o));
213
- const d = t.mul(s, r), c = t.mul(n, r), l = t.mul(o, r);
214
- if (a)
215
- return { x: t.ZERO, y: t.ZERO };
216
- if (!t.eql(l, t.ONE))
217
- throw new Error("invZ was invalid");
218
- return { x: d, y: c };
219
- }), V = nt((v) => {
220
- if (v.is0()) {
221
- if (i.allowInfinityPoint && !t.is0(v.py))
222
- return;
223
- throw new Error("bad point: ZERO");
224
- }
225
- const { x: r, y: s } = v.toAffine();
226
- if (!t.isValid(r) || !t.isValid(s))
227
- throw new Error("bad point: x or y not field elements");
228
- if (!L(r, s))
229
- throw new Error("bad point: equation left != right");
230
- if (!v.isTorsionFree())
231
- throw new Error("bad point: not in prime-order subgroup");
232
- return !0;
233
- });
234
- function $(v, r, s, n, o) {
235
- return s = new y(t.mul(s.px, v), s.py, s.pz), r = ot(n, r), s = ot(o, s), r.add(s);
236
- }
237
- class y {
238
- /** Does NOT validate if the point is valid. Use `.assertValidity()`. */
239
- constructor(r, s, n) {
240
- this.px = K("x", r), this.py = K("y", s, !0), this.pz = K("z", n), Object.freeze(this);
241
- }
242
- /** Does NOT validate if the point is valid. Use `.assertValidity()`. */
243
- static fromAffine(r) {
244
- const { x: s, y: n } = r || {};
245
- if (!r || !t.isValid(s) || !t.isValid(n))
246
- throw new Error("invalid affine point");
247
- if (r instanceof y)
248
- throw new Error("projective point not allowed");
249
- return t.is0(s) && t.is0(n) ? y.ZERO : new y(s, n, t.ONE);
250
- }
251
- get x() {
252
- return this.toAffine().x;
253
- }
254
- get y() {
255
- return this.toAffine().y;
256
- }
257
- static normalizeZ(r) {
258
- return pt(y, "pz", r);
259
- }
260
- static fromBytes(r) {
261
- return it(r), y.fromHex(r);
262
- }
263
- /** Converts hash string or Uint8Array to Point. */
264
- static fromHex(r) {
265
- const s = y.fromAffine(C(z("pointHex", r)));
266
- return s.assertValidity(), s;
267
- }
268
- /** Multiplies generator point by privateKey. */
269
- static fromPrivateKey(r) {
270
- const s = lt(w, i.allowedPrivateKeyLengths, i.wrapPrivateKey);
271
- return y.BASE.multiply(s(r));
272
- }
273
- /** Multiscalar Multiplication */
274
- static msm(r, s) {
275
- return gt(y, w, r, s);
276
- }
277
- /**
278
- *
279
- * @param windowSize
280
- * @param isLazy true will defer table computation until the first multiplication
281
- * @returns
282
- */
283
- precompute(r = 8, s = !0) {
284
- return _.setWindowSize(this, r), s || this.multiply(W), this;
285
- }
286
- /** "Private method", don't use it directly */
287
- _setWindowSize(r) {
288
- this.precompute(r);
289
- }
290
- // TODO: return `this`
291
- /** A point on curve is valid if it conforms to equation. */
292
- assertValidity() {
293
- V(this);
294
- }
295
- hasEvenY() {
296
- const { y: r } = this.toAffine();
297
- if (!t.isOdd)
298
- throw new Error("Field doesn't support isOdd");
299
- return !t.isOdd(r);
300
- }
301
- /** Compare one point to another. */
302
- equals(r) {
303
- G(r);
304
- const { px: s, py: n, pz: o } = this, { px: a, py: d, pz: c } = r, l = t.eql(t.mul(s, c), t.mul(a, o)), h = t.eql(t.mul(n, c), t.mul(d, o));
305
- return l && h;
306
- }
307
- /** Flips point to one corresponding to (x, -y) in Affine coordinates. */
308
- negate() {
309
- return new y(this.px, t.neg(this.py), this.pz);
310
- }
311
- // Renes-Costello-Batina exception-free doubling formula.
312
- // There is 30% faster Jacobian formula, but it is not complete.
313
- // https://eprint.iacr.org/2015/1060, algorithm 3
314
- // Cost: 8M + 3S + 3*a + 2*b3 + 15add.
315
- double() {
316
- const { a: r, b: s } = e, n = t.mul(s, W), { px: o, py: a, pz: d } = this;
317
- let c = t.ZERO, l = t.ZERO, h = t.ZERO, f = t.mul(o, o), B = t.mul(a, a), g = t.mul(d, d), m = t.mul(o, a);
318
- return m = t.add(m, m), h = t.mul(o, d), h = t.add(h, h), c = t.mul(r, h), l = t.mul(n, g), l = t.add(c, l), c = t.sub(B, l), l = t.add(B, l), l = t.mul(c, l), c = t.mul(m, c), h = t.mul(n, h), g = t.mul(r, g), m = t.sub(f, g), m = t.mul(r, m), m = t.add(m, h), h = t.add(f, f), f = t.add(h, f), f = t.add(f, g), f = t.mul(f, m), l = t.add(l, f), g = t.mul(a, d), g = t.add(g, g), f = t.mul(g, m), c = t.sub(c, f), h = t.mul(g, B), h = t.add(h, h), h = t.add(h, h), new y(c, l, h);
319
- }
320
- // Renes-Costello-Batina exception-free addition formula.
321
- // There is 30% faster Jacobian formula, but it is not complete.
322
- // https://eprint.iacr.org/2015/1060, algorithm 1
323
- // Cost: 12M + 0S + 3*a + 3*b3 + 23add.
324
- add(r) {
325
- G(r);
326
- const { px: s, py: n, pz: o } = this, { px: a, py: d, pz: c } = r;
327
- let l = t.ZERO, h = t.ZERO, f = t.ZERO;
328
- const B = e.a, g = t.mul(e.b, W);
329
- let m = t.mul(s, a), R = t.mul(n, d), O = t.mul(o, c), A = t.add(s, n), E = t.add(a, d);
330
- A = t.mul(A, E), E = t.add(m, R), A = t.sub(A, E), E = t.add(s, o);
331
- let Z = t.add(a, c);
332
- return E = t.mul(E, Z), Z = t.add(m, O), E = t.sub(E, Z), Z = t.add(n, o), l = t.add(d, c), Z = t.mul(Z, l), l = t.add(R, O), Z = t.sub(Z, l), f = t.mul(B, E), l = t.mul(g, O), f = t.add(l, f), l = t.sub(R, f), f = t.add(R, f), h = t.mul(l, f), R = t.add(m, m), R = t.add(R, m), O = t.mul(B, O), E = t.mul(g, E), R = t.add(R, O), O = t.sub(m, O), O = t.mul(B, O), E = t.add(E, O), m = t.mul(R, E), h = t.add(h, m), m = t.mul(Z, E), l = t.mul(A, l), l = t.sub(l, m), m = t.mul(A, R), f = t.mul(Z, f), f = t.add(f, m), new y(l, h, f);
333
- }
334
- subtract(r) {
335
- return this.add(r.negate());
336
- }
337
- is0() {
338
- return this.equals(y.ZERO);
339
- }
340
- /**
341
- * Constant time multiplication.
342
- * Uses wNAF method. Windowed method may be 10% faster,
343
- * but takes 2x longer to generate and consumes 2x memory.
344
- * Uses precomputes when available.
345
- * Uses endomorphism for Koblitz curves.
346
- * @param scalar by which the point would be multiplied
347
- * @returns New point
348
- */
349
- multiply(r) {
350
- const { endo: s } = i;
351
- if (!w.isValidNot0(r))
352
- throw new Error("invalid scalar: out of range");
353
- let n, o;
354
- const a = (d) => _.wNAFCached(this, d, y.normalizeZ);
355
- if (s) {
356
- const { k1neg: d, k1: c, k2neg: l, k2: h } = s.splitScalar(r), { p: f, f: B } = a(c), { p: g, f: m } = a(h);
357
- o = B.add(m), n = $(s.beta, f, g, d, l);
358
- } else {
359
- const { p: d, f: c } = a(r);
360
- n = d, o = c;
361
- }
362
- return y.normalizeZ([n, o])[0];
363
- }
364
- /**
365
- * Non-constant-time multiplication. Uses double-and-add algorithm.
366
- * It's faster, but should only be used when you don't care about
367
- * an exposed private key e.g. sig verification, which works over *public* keys.
368
- */
369
- multiplyUnsafe(r) {
370
- const { endo: s } = i, n = this;
371
- if (!w.isValid(r))
372
- throw new Error("invalid scalar: out of range");
373
- if (r === U || n.is0())
374
- return y.ZERO;
375
- if (r === k)
376
- return n;
377
- if (_.hasPrecomputes(this))
378
- return this.multiply(r);
379
- if (s) {
380
- const { k1neg: o, k1: a, k2neg: d, k2: c } = s.splitScalar(r), { p1: l, p2: h } = Et(y, n, a, c);
381
- return $(s.beta, l, h, o, d);
382
- } else
383
- return _.wNAFCachedUnsafe(n, r);
384
- }
385
- multiplyAndAddUnsafe(r, s, n) {
386
- const o = this.multiplyUnsafe(s).add(r.multiplyUnsafe(n));
387
- return o.is0() ? void 0 : o;
388
- }
389
- /**
390
- * Converts Projective point to affine (x, y) coordinates.
391
- * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch
392
- */
393
- toAffine(r) {
394
- return X(this, r);
395
- }
396
- /**
397
- * Checks whether Point is free of torsion elements (is in prime subgroup).
398
- * Always torsion-free for cofactor=1 curves.
399
- */
400
- isTorsionFree() {
401
- const { isTorsionFree: r } = i;
402
- return p === k ? !0 : r ? r(y, this) : _.wNAFCachedUnsafe(this, b).is0();
403
- }
404
- clearCofactor() {
405
- const { clearCofactor: r } = i;
406
- return p === k ? this : r ? r(y, this) : this.multiplyUnsafe(p);
407
- }
408
- toBytes(r = !0) {
409
- return Q("isCompressed", r), this.assertValidity(), q(y, this, r);
410
- }
411
- /** @deprecated use `toBytes` */
412
- toRawBytes(r = !0) {
413
- return this.toBytes(r);
414
- }
415
- toHex(r = !0) {
416
- return rt(this.toBytes(r));
417
- }
418
- toString() {
419
- return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
420
- }
421
- }
422
- y.BASE = new y(e.Gx, e.Gy, t.ONE), y.ZERO = new y(t.ZERO, t.ONE, t.ZERO), y.Fp = t, y.Fn = w;
423
- const P = w.BITS, _ = yt(y, i.endo ? Math.ceil(P / 2) : P);
424
- return y;
20
+ function O(t) {
21
+ return v(t), h(d(Uint8Array.from(t).reverse()));
425
22
  }
426
- function ut(e) {
427
- return Uint8Array.of(e ? 2 : 3);
23
+ function x(t, r) {
24
+ return p(t.toString(16).padStart(r * 2, "0"));
428
25
  }
429
- function Nt(e, i, t = {}) {
430
- at(i, { hash: "function" }, {
431
- hmac: "function",
432
- lowS: "boolean",
433
- randomBytes: "function",
434
- bits2int: "function",
435
- bits2int_modN: "function"
436
- });
437
- const w = i.randomBytes || St, p = i.hmac || ((n, ...o) => dt(i.hash, n, I(...o))), { Fp: b, Fn: u } = e, { ORDER: x, BITS: S } = u;
438
- function N(n) {
439
- const o = x >> k;
440
- return n > o;
441
- }
442
- function q(n) {
443
- return N(n) ? u.neg(n) : n;
444
- }
445
- function C(n, o) {
446
- if (!u.isValidNot0(o))
447
- throw new Error(`invalid signature ${n}: out of range 1..CURVE.n`);
448
- }
449
- class T {
450
- constructor(o, a, d) {
451
- C("r", o), C("s", a), this.r = o, this.s = a, d != null && (this.recovery = d), Object.freeze(this);
452
- }
453
- // pair (bytes of r, bytes of s)
454
- static fromCompact(o) {
455
- const a = u.BYTES, d = z("compactSignature", o, a * 2);
456
- return new T(u.fromBytes(d.subarray(0, a)), u.fromBytes(d.subarray(a, a * 2)));
457
- }
458
- // DER encoded ECDSA signature
459
- // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script
460
- static fromDER(o) {
461
- const { r: a, s: d } = F.toSig(z("DER", o));
462
- return new T(a, d);
463
- }
464
- /**
465
- * @todo remove
466
- * @deprecated
467
- */
468
- assertValidity() {
469
- }
470
- addRecoveryBit(o) {
471
- return new T(this.r, this.s, o);
472
- }
473
- // ProjPointType<bigint>
474
- recoverPublicKey(o) {
475
- const a = b.ORDER, { r: d, s: c, recovery: l } = this;
476
- if (l == null || ![0, 1, 2, 3].includes(l))
477
- throw new Error("recovery id invalid");
478
- if (x * At < a && l > 1)
479
- throw new Error("recovery id is ambiguous for h>1 curve");
480
- const f = l === 2 || l === 3 ? d + x : d;
481
- if (!b.isValid(f))
482
- throw new Error("recovery id 2 or 3 invalid");
483
- const B = b.toBytes(f), g = e.fromHex(I(ut((l & 1) === 0), B)), m = u.inv(f), R = V(z("msgHash", o)), O = u.create(-R * m), A = u.create(c * m), E = e.BASE.multiplyUnsafe(O).add(g.multiplyUnsafe(A));
484
- if (E.is0())
485
- throw new Error("point at infinify");
486
- return E.assertValidity(), E;
487
- }
488
- // Signatures should be low-s, to prevent malleability.
489
- hasHighS() {
490
- return N(this.s);
491
- }
492
- normalizeS() {
493
- return this.hasHighS() ? new T(this.r, u.neg(this.s), this.recovery) : this;
494
- }
495
- toBytes(o) {
496
- if (o === "compact")
497
- return I(u.toBytes(this.r), u.toBytes(this.s));
498
- if (o === "der")
499
- return xt(F.hexFromSig(this));
500
- throw new Error("invalid format");
501
- }
502
- // DER-encoded
503
- toDERRawBytes() {
504
- return this.toBytes("der");
505
- }
506
- toDERHex() {
507
- return rt(this.toBytes("der"));
508
- }
509
- // padded bytes of r, then padded bytes of s
510
- toCompactRawBytes() {
511
- return this.toBytes("compact");
512
- }
513
- toCompactHex() {
514
- return rt(this.toBytes("compact"));
515
- }
516
- }
517
- const L = lt(u, t.allowedPrivateKeyLengths, t.wrapPrivateKey), J = {
518
- isValidPrivateKey(n) {
519
- try {
520
- return L(n), !0;
521
- } catch {
522
- return !1;
523
- }
524
- },
525
- normPrivateKeyToScalar: L,
526
- /**
527
- * Produces cryptographically secure private key from random of size
528
- * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.
529
- */
530
- randomPrivateKey: () => {
531
- const n = x;
532
- return vt(w(Bt(n)), n);
533
- },
534
- precompute(n = 8, o = e.BASE) {
535
- return o.precompute(n, !1);
536
- }
537
- };
538
- function tt(n, o = !0) {
539
- return e.fromPrivateKey(n).toBytes(o);
540
- }
541
- function K(n) {
542
- if (typeof n == "bigint")
543
- return !1;
544
- if (n instanceof e)
545
- return !0;
546
- const a = z("key", n).length, d = b.BYTES, c = d + 1, l = 2 * d + 1;
547
- if (!(t.allowedPrivateKeyLengths || u.BYTES === c))
548
- return a === c || a === l;
549
- }
550
- function G(n, o, a = !0) {
551
- if (K(n) === !0)
552
- throw new Error("first arg must be private key");
553
- if (K(o) === !1)
554
- throw new Error("second arg must be public key");
555
- return e.fromHex(o).multiply(L(n)).toBytes(a);
556
- }
557
- const X = i.bits2int || function(n) {
558
- if (n.length > 8192)
559
- throw new Error("input is too large");
560
- const o = ct(n), a = n.length * 8 - S;
561
- return a > 0 ? o >> BigInt(a) : o;
562
- }, V = i.bits2int_modN || function(n) {
563
- return u.create(X(n));
564
- }, $ = ft(S);
565
- function y(n) {
566
- return mt("num < 2^" + S, n, U, $), u.toBytes(n);
567
- }
568
- function P(n, o, a = _) {
569
- if (["recovered", "canonical"].some((A) => A in a))
570
- throw new Error("sign() legacy options not supported");
571
- const { hash: d } = i;
572
- let { lowS: c, prehash: l, extraEntropy: h } = a;
573
- c == null && (c = !0), n = z("msgHash", n), st(a), l && (n = z("prehashed msgHash", d(n)));
574
- const f = V(n), B = L(o), g = [y(B), y(f)];
575
- if (h != null && h !== !1) {
576
- const A = h === !0 ? w(b.BYTES) : h;
577
- g.push(z("extraEntropy", A));
578
- }
579
- const m = I(...g), R = f;
580
- function O(A) {
581
- const E = X(A);
582
- if (!u.isValidNot0(E))
583
- return;
584
- const Z = u.inv(E), j = e.BASE.multiply(E).toAffine(), Y = u.create(j.x);
585
- if (Y === U)
586
- return;
587
- const H = u.create(Z * u.create(R + Y * B));
588
- if (H === U)
589
- return;
590
- let et = (j.x === Y ? 0 : 2) | Number(j.y & k), D = H;
591
- return c && N(H) && (D = q(H), et ^= 1), new T(Y, D, et);
592
- }
593
- return { seed: m, k2sig: O };
594
- }
595
- const _ = { lowS: i.lowS, prehash: !1 }, v = { lowS: i.lowS, prehash: !1 };
596
- function r(n, o, a = _) {
597
- const { seed: d, k2sig: c } = P(n, o, a);
598
- return ht(i.hash.outputLen, u.BYTES, p)(d, c);
599
- }
600
- e.BASE.precompute(8);
601
- function s(n, o, a, d = v) {
602
- const c = n;
603
- o = z("msgHash", o), a = z("publicKey", a), st(d);
604
- const { lowS: l, prehash: h, format: f } = d;
605
- if ("strict" in d)
606
- throw new Error("options.strict was renamed to lowS");
607
- if (f !== void 0 && !["compact", "der", "js"].includes(f))
608
- throw new Error('format must be "compact", "der" or "js"');
609
- const B = typeof c == "string" || Rt(c), g = !B && !f && typeof c == "object" && c !== null && typeof c.r == "bigint" && typeof c.s == "bigint";
610
- if (!B && !g)
611
- throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
612
- let m, R;
26
+ function S(t, r) {
27
+ return x(t, r).reverse();
28
+ }
29
+ function _(t, r, n) {
30
+ let o;
31
+ if (typeof r == "string")
613
32
  try {
614
- if (g)
615
- if (f === void 0 || f === "js")
616
- m = new T(c.r, c.s);
617
- else
618
- throw new Error("invalid format");
619
- if (B) {
620
- try {
621
- f !== "compact" && (m = T.fromDER(c));
622
- } catch (D) {
623
- if (!(D instanceof F.Err))
624
- throw D;
625
- }
626
- !m && f !== "der" && (m = T.fromCompact(c));
627
- }
628
- R = e.fromHex(a);
629
- } catch {
630
- return !1;
631
- }
632
- if (!m || l && m.hasHighS())
633
- return !1;
634
- h && (o = i.hash(o));
635
- const { r: O, s: A } = m, E = V(o), Z = u.inv(A), j = u.create(E * Z), Y = u.create(O * Z), H = e.BASE.multiplyUnsafe(j).add(R.multiplyUnsafe(Y));
636
- return H.is0() ? !1 : u.create(H.x) === O;
637
- }
638
- return Object.freeze({
639
- getPublicKey: tt,
640
- getSharedSecret: G,
641
- sign: r,
642
- verify: s,
643
- utils: J,
644
- Point: e,
645
- Signature: T
646
- });
33
+ o = p(r);
34
+ } catch (e) {
35
+ throw new Error(t + " must be hex string or Uint8Array, cause: " + e);
36
+ }
37
+ else if (B(r))
38
+ o = Uint8Array.from(r);
39
+ else
40
+ throw new Error(t + " must be hex string or Uint8Array");
41
+ const i = o.length;
42
+ if (typeof n == "number" && i !== n)
43
+ throw new Error(t + " of length " + n + " expected, got " + i);
44
+ return o;
647
45
  }
648
- function Ft(e) {
649
- const i = {
650
- a: e.a,
651
- b: e.b,
652
- p: e.Fp.ORDER,
653
- n: e.n,
654
- h: e.h,
655
- Gx: e.Gx,
656
- Gy: e.Gy
657
- }, t = e.Fp, w = bt(i.n, e.nBitLength), p = {
658
- Fp: t,
659
- Fn: w,
660
- allowedPrivateKeyLengths: e.allowedPrivateKeyLengths,
661
- allowInfinityPoint: e.allowInfinityPoint,
662
- endo: e.endo,
663
- wrapPrivateKey: e.wrapPrivateKey,
664
- isTorsionFree: e.isTorsionFree,
665
- clearCofactor: e.clearCofactor,
666
- fromBytes: e.fromBytes,
667
- toBytes: e.toBytes
668
- };
669
- return { CURVE: i, curveOpts: p };
46
+ const w = (t) => typeof t == "bigint" && y <= t;
47
+ function T(t, r, n) {
48
+ return w(t) && w(r) && w(n) && r <= t && t < n;
49
+ }
50
+ function $(t, r, n, o) {
51
+ if (!T(r, n, o))
52
+ throw new Error("expected valid " + t + ": " + n + " <= n < " + o + ", got " + r);
53
+ }
54
+ function M(t) {
55
+ let r;
56
+ for (r = 0; t > y; t >>= g, r += 1)
57
+ ;
58
+ return r;
670
59
  }
671
- function Lt(e) {
672
- const { CURVE: i, curveOpts: t } = Ft(e), w = {
673
- hash: e.hash,
674
- hmac: e.hmac,
675
- randomBytes: e.randomBytes,
676
- lowS: e.lowS,
677
- bits2int: e.bits2int,
678
- bits2int_modN: e.bits2int_modN
60
+ const N = (t) => (g << BigInt(t)) - g;
61
+ function R(t, r, n) {
62
+ if (typeof t != "number" || t < 2)
63
+ throw new Error("hashLen must be a number");
64
+ if (typeof r != "number" || r < 2)
65
+ throw new Error("qByteLen must be a number");
66
+ if (typeof n != "function")
67
+ throw new Error("hmacFn must be a function");
68
+ const o = (u) => new Uint8Array(u), i = (u) => Uint8Array.of(u);
69
+ let e = o(t), s = o(t), f = 0;
70
+ const c = () => {
71
+ e.fill(1), s.fill(0), f = 0;
72
+ }, l = (...u) => n(s, e, ...u), m = (u = o(0)) => {
73
+ s = l(i(0), u), e = l(), u.length !== 0 && (s = l(i(1), u), e = l());
74
+ }, E = () => {
75
+ if (f++ >= 1e3)
76
+ throw new Error("drbg: tried 1000 values");
77
+ let u = 0;
78
+ const a = [];
79
+ for (; u < r; ) {
80
+ e = l();
81
+ const b = e.slice();
82
+ a.push(b), u += e.length;
83
+ }
84
+ return U(...a);
85
+ };
86
+ return (u, a) => {
87
+ c(), m(u);
88
+ let b;
89
+ for (; !(b = a(E())); )
90
+ m();
91
+ return c(), b;
679
92
  };
680
- return { CURVE: i, curveOpts: t, ecdsaOpts: w };
681
93
  }
682
- function _t(e, i) {
683
- return Object.assign({}, i, {
684
- ProjectivePoint: i.Point,
685
- CURVE: e
686
- });
94
+ function z(t, r, n = {}) {
95
+ if (!t || typeof t != "object")
96
+ throw new Error("expected valid options object");
97
+ function o(i, e, s) {
98
+ const f = t[i];
99
+ if (s && f === void 0)
100
+ return;
101
+ const c = typeof f;
102
+ if (c !== e || f === null)
103
+ throw new Error(`param "${i}" is invalid: expected ${e}, got ${c}`);
104
+ }
105
+ Object.entries(r).forEach(([i, e]) => o(i, e, !1)), Object.entries(n).forEach(([i, e]) => o(i, e, !0));
687
106
  }
688
- function It(e) {
689
- const { CURVE: i, curveOpts: t, ecdsaOpts: w } = Lt(e), p = zt(i, t), b = Nt(p, w, t);
690
- return _t(e, b);
107
+ function D(t) {
108
+ const r = /* @__PURE__ */ new WeakMap();
109
+ return (n, ...o) => {
110
+ const i = r.get(n);
111
+ if (i !== void 0)
112
+ return i;
113
+ const e = t(n, ...o);
114
+ return r.set(n, e), e;
115
+ };
691
116
  }
692
117
  export {
693
- F as DER,
694
- Ot as DERErr,
695
- Tt as _legacyHelperEquat,
696
- lt as _legacyHelperNormPriv,
697
- Nt as ecdsa,
698
- It as weierstrass,
699
- zt as weierstrassN
118
+ z as _validateObject,
119
+ $ as aInRange,
120
+ k as abool,
121
+ v as abytes,
122
+ W as anumber,
123
+ M as bitLen,
124
+ N as bitMask,
125
+ d as bytesToHex,
126
+ H as bytesToNumberBE,
127
+ O as bytesToNumberLE,
128
+ U as concatBytes,
129
+ R as createHmacDrbg,
130
+ _ as ensureBytes,
131
+ p as hexToBytes,
132
+ h as hexToNumber,
133
+ T as inRange,
134
+ B as isBytes,
135
+ D as memoized,
136
+ x as numberToBytesBE,
137
+ S as numberToBytesLE,
138
+ j as numberToHexUnpadded,
139
+ C as randomBytes,
140
+ G as utf8ToBytes
700
141
  };