mirror of
https://github.com/logos-messaging/lab.waku.org.git
synced 2026-02-07 23:43:10 +00:00
275 lines
950 KiB
JavaScript
275 lines
950 KiB
JavaScript
|
|
"use strict";
|
|||
|
|
/*
|
|||
|
|
* ATTENTION: An "eval-source-map" devtool has been used.
|
|||
|
|
* This devtool is neither made for production nor for readable output files.
|
|||
|
|
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
|
|||
|
|
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|||
|
|
* or disable the default devtool with "devtool: false".
|
|||
|
|
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|||
|
|
*/
|
|||
|
|
exports.id = "vendor-chunks/@noble";
|
|||
|
|
exports.ids = ["vendor-chunks/@noble"];
|
|||
|
|
exports.modules = {
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/ciphers/esm/_arx.js":
|
|||
|
|
/*!*************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/ciphers/esm/_arx.js ***!
|
|||
|
|
\*************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createCipher: () => (/* binding */ createCipher),\n/* harmony export */ rotl: () => (/* binding */ rotl)\n/* harmony export */ });\n/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assert.js */ \"(ssr)/./node_modules/@noble/ciphers/esm/_assert.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/ciphers/esm/utils.js\");\n// Basic utils for ARX (add-rotate-xor) salsa and chacha ciphers.\n\n\n/*\nRFC8439 requires multi-step cipher stream, where\nauthKey starts with counter: 0, actual msg with counter: 1.\n\nFor this, we need a way to re-use nonce / counter:\n\n const counter = new Uint8Array(4);\n chacha(..., counter, ...); // counter is now 1\n chacha(..., counter, ...); // counter is now 2\n\nThis is complicated:\n\n- 32-bit counters are enough, no need for 64-bit: max ArrayBuffer size in JS is 4GB\n- Original papers don't allow mutating counters\n- Counter overflow is undefined [^1]\n- Idea A: allow providing (nonce | counter) instead of just nonce, re-use it\n- Caveat: Cannot be re-used through all cases:\n- * chacha has (counter | nonce)\n- * xchacha has (nonce16 | counter | nonce16)\n- Idea B: separate nonce / counter and provide separate API for counter re-use\n- Caveat: there are different counter sizes depending on an algorithm.\n- salsa & chacha also differ in structures of key & sigma:\n salsa20: s[0] | k(4) | s[1] | nonce(2) | ctr(2) | s[2] | k(4) | s[3]\n chacha: s(4) | k(8) | ctr(1) | nonce(3)\n chacha20orig: s(4) | k(8) | ctr(2) | nonce(2)\n- Idea C: helper method such as `setSalsaState(key, nonce, sigma, data)`\n- Caveat: we can't re-use counter array\n\nxchacha [^2] uses the subkey and remaining 8 byte nonce with ChaCha20 as normal\n(prefixed by 4 NUL bytes, since [RFC8439] specifies a 12-byte nonce).\n\n[^1]: https://mailarchive.ietf.org/arch/msg/cfrg/gsOnTJzcbgG6OqD8Sc0GO5aR_tU/\n[^2]: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha#appendix-A.2\n*/ const sigma16 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.utf8ToBytes)(\"expand 16-byte k\");\nconst sigma32 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.utf8ToBytes)(\"expand 32-byte k\");\nconst sigma16_32 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.u32)(sigma16);\nconst sigma32_32 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.u32)(sigma32);\nfunction rotl(a, b) {\n return a << b | a >>> 32 - b;\n}\n// Is byte array aligned to 4 byte offset (u32)?\nfunction isAligned32(b) {\n return b.byteOffset % 4 === 0;\n}\n// Salsa and Chacha block length is always 512-bit\nconst BLOCK_LEN = 64;\nconst BLOCK_LEN32 = 16;\n// new Uint32Array([2**32]) // => Uint32Array(1) [ 0 ]\n// new Uint32Array([2**32-1]) // => Uint32Array(1) [ 4294967295 ]\nconst MAX_COUNTER = 2 ** 32 - 1;\nconst U32_EMPTY = new Uint32Array();\nfunction runCipher(core, sigma, key, nonce, data, output, counter, rounds) {\n const len = data.length;\n const block = new Uint8Array(BLOCK_LEN);\n const b32 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.u32)(block);\n // Make sure that buffers aligned to 4 bytes\n const isAligned = isAligned32(data) && isAligned32(output);\n const d32 = isAligned ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.u32)(data) : U32_EMPTY;\n const o32 = isAligned ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.u32)(output) : U32_EMPTY;\n for(let pos = 0; pos < len; counter++){\n core(sigma, key, nonce, b32, counter, rounds);\n if (counter >= MAX_COUNTER) throw new Error(\"arx: counter overflow\");\n const take = Math.min(BLOCK_LEN, len - pos);\n // aligned to 4 bytes\n if (isAligned && take === BLOCK_LEN) {\n const pos32 = pos / 4;\n if (pos % 4 !== 0) throw new Error(\"arx: invalid block position\");\n for(let j = 0, posj; j < BLOCK_LEN32; j++){\n posj = pos32 + j;\n
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/ciphers/esm/_assert.js":
|
|||
|
|
/*!****************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/ciphers/esm/_assert.js ***!
|
|||
|
|
\****************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bool: () => (/* binding */ bool),\n/* harmony export */ bytes: () => (/* binding */ bytes),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ exists: () => (/* binding */ exists),\n/* harmony export */ hash: () => (/* binding */ hash),\n/* harmony export */ number: () => (/* binding */ number),\n/* harmony export */ output: () => (/* binding */ output)\n/* harmony export */ });\nfunction number(n) {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error(`wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== \"boolean\") throw new Error(`boolean expected, not ${b}`);\n}\n// TODO: merge with utils\nfunction isBytes(a) {\n return a != null && typeof a === \"object\" && (a instanceof Uint8Array || a.constructor.name === \"Uint8Array\");\n}\nfunction bytes(b, ...lengths) {\n if (!isBytes(b)) throw new Error(\"Uint8Array expected\");\n if (lengths.length > 0 && !lengths.includes(b.length)) throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n if (typeof hash !== \"function\" || typeof hash.create !== \"function\") throw new Error(\"hash must be wrapped by utils.wrapConstructor\");\n number(hash.outputLen);\n number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed) throw new Error(\"Hash instance has been destroyed\");\n if (checkFinished && instance.finished) throw new Error(\"Hash#digest() has already been called\");\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\n\nconst assert = {\n number,\n bool,\n bytes,\n hash,\n exists,\n output\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assert); //# sourceMappingURL=_assert.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvQG5vYmxlL2NpcGhlcnMvZXNtL19hc3NlcnQuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLFNBQVNBLE9BQU9DLENBQUM7SUFDYixJQUFJLENBQUNDLE9BQU9DLGFBQWEsQ0FBQ0YsTUFBTUEsSUFBSSxHQUNoQyxNQUFNLElBQUlHLE1BQU0sQ0FBQyx3QkFBd0IsRUFBRUgsRUFBRSxDQUFDO0FBQ3REO0FBQ0EsU0FBU0ksS0FBS0MsQ0FBQztJQUNYLElBQUksT0FBT0EsTUFBTSxXQUNiLE1BQU0sSUFBSUYsTUFBTSxDQUFDLHNCQUFzQixFQUFFRSxFQUFFLENBQUM7QUFDcEQ7QUFDQSx5QkFBeUI7QUFDekIsU0FBU0MsUUFBUUMsQ0FBQztJQUNkLE9BQVFBLEtBQUssUUFDVCxPQUFPQSxNQUFNLFlBQ1pBLENBQUFBLGFBQWFDLGNBQWNELEVBQUVFLFdBQVcsQ0FBQ0MsSUFBSSxLQUFLLFlBQVc7QUFDdEU7QUFDQSxTQUFTQyxNQUFNTixDQUFDLEVBQUUsR0FBR08sT0FBTztJQUN4QixJQUFJLENBQUNOLFFBQVFELElBQ1QsTUFBTSxJQUFJRixNQUFNO0lBQ3BCLElBQUlTLFFBQVFDLE1BQU0sR0FBRyxLQUFLLENBQUNELFFBQVFFLFFBQVEsQ0FBQ1QsRUFBRVEsTUFBTSxHQUNoRCxNQUFNLElBQUlWLE1BQU0sQ0FBQyw4QkFBOEIsRUFBRVMsUUFBUSxnQkFBZ0IsRUFBRVAsRUFBRVEsTUFBTSxDQUFDLENBQUM7QUFDN0Y7QUFDQSxTQUFTRSxLQUFLQSxJQUFJO0lBQ2QsSUFBSSxPQUFPQSxTQUFTLGNBQWMsT0FBT0EsS0FBS0MsTUFBTSxLQUFLLFlBQ3JELE1BQU0sSUFBSWIsTUFBTTtJQUNwQkosT0FBT2dCLEtBQUtFLFNBQVM7SUFDckJsQixPQUFPZ0IsS0FBS0csUUFBUTtBQUN4QjtBQUNBLFNBQVNDLE9BQU9DLFFBQVEsRUFBRUMsZ0JBQWdCLElBQUk7SUFDMUMsSUFBSUQsU0FBU0UsU0FBUyxFQUNsQixNQUFNLElBQUluQixNQUFNO0lBQ3BCLElBQUlrQixpQkFBaUJELFNBQVNHLFFBQVEsRUFDbEMsTUFBTSxJQUFJcEIsTUFBTTtBQUN4QjtBQUNBLFNBQVNxQixPQUFPQyxHQUFHLEVBQUVMLFFBQVE7SUFDekJULE1BQU1jO0lBQ04sTUFBTUMsTUFBTU4sU0FBU0gsU0FBUztJQUM5QixJQUFJUSxJQUFJWixNQUFNLEdBQUdhLEtBQUs7UUFDbEIsTUFBTSxJQUFJdkIsTUFBTSxDQUFDLHNEQUFzRCxFQUFFdUIsSUFBSSxDQUFDO0lBQ2xGO0FBQ0o7QUFDcUQ7QUFDckQsTUFBTUMsU0FBUztJQUFFNUI7SUFBUUs7SUFBTU87SUFBT0k7SUFBTUk7SUFBUUs7QUFBTztBQUMzRCxpRUFBZUcsTUFBTUEsRUFBQyxDQUN0QixtQ0FBbUMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9mbHVzaC1ub3Rlcy8uL25vZGVfbW9kdWxlcy9Abm9ibGUvY2lwaGVycy9lc20vX2Fzc2VydC5qcz80MWM0Il0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIG51bWJlcihuKSB7XG4gICAgaWYgKCFOdW1iZXIuaXNTYWZlSW50ZWdlcihuKSB8fCBuIDwgM
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/ciphers/esm/_poly1305.js":
|
|||
|
|
/*!******************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/ciphers/esm/_poly1305.js ***!
|
|||
|
|
\******************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ poly1305: () => (/* binding */ poly1305),\n/* harmony export */ wrapConstructorWithKey: () => (/* binding */ wrapConstructorWithKey)\n/* harmony export */ });\n/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assert.js */ \"(ssr)/./node_modules/@noble/ciphers/esm/_assert.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/ciphers/esm/utils.js\");\n\n\n// Poly1305 is a fast and parallel secret-key message-authentication code.\n// https://cr.yp.to/mac.html, https://cr.yp.to/mac/poly1305-20050329.pdf\n// https://datatracker.ietf.org/doc/html/rfc8439\n// Based on Public Domain poly1305-donna https://github.com/floodyberry/poly1305-donna\nconst u8to16 = (a, i)=>a[i++] & 0xff | (a[i++] & 0xff) << 8;\nclass Poly1305 {\n constructor(key){\n this.blockLen = 16;\n this.outputLen = 16;\n this.buffer = new Uint8Array(16);\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.pos = 0;\n this.finished = false;\n key = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.toBytes)(key);\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.ensureBytes)(key, 32);\n const t0 = u8to16(key, 0);\n const t1 = u8to16(key, 2);\n const t2 = u8to16(key, 4);\n const t3 = u8to16(key, 6);\n const t4 = u8to16(key, 8);\n const t5 = u8to16(key, 10);\n const t6 = u8to16(key, 12);\n const t7 = u8to16(key, 14);\n // https://github.com/floodyberry/poly1305-donna/blob/e6ad6e091d30d7f4ec2d4f978be1fcfcbce72781/poly1305-donna-16.h#L47\n this.r[0] = t0 & 0x1fff;\n this.r[1] = (t0 >>> 13 | t1 << 3) & 0x1fff;\n this.r[2] = (t1 >>> 10 | t2 << 6) & 0x1f03;\n this.r[3] = (t2 >>> 7 | t3 << 9) & 0x1fff;\n this.r[4] = (t3 >>> 4 | t4 << 12) & 0x00ff;\n this.r[5] = t4 >>> 1 & 0x1ffe;\n this.r[6] = (t4 >>> 14 | t5 << 2) & 0x1fff;\n this.r[7] = (t5 >>> 11 | t6 << 5) & 0x1f81;\n this.r[8] = (t6 >>> 8 | t7 << 8) & 0x1fff;\n this.r[9] = t7 >>> 5 & 0x007f;\n for(let i = 0; i < 8; i++)this.pad[i] = u8to16(key, 16 + 2 * i);\n }\n process(data, offset, isLast = false) {\n const hibit = isLast ? 0 : 1 << 11;\n const { h, r } = this;\n const r0 = r[0];\n const r1 = r[1];\n const r2 = r[2];\n const r3 = r[3];\n const r4 = r[4];\n const r5 = r[5];\n const r6 = r[6];\n const r7 = r[7];\n const r8 = r[8];\n const r9 = r[9];\n const t0 = u8to16(data, offset + 0);\n const t1 = u8to16(data, offset + 2);\n const t2 = u8to16(data, offset + 4);\n const t3 = u8to16(data, offset + 6);\n const t4 = u8to16(data, offset + 8);\n const t5 = u8to16(data, offset + 10);\n const t6 = u8to16(data, offset + 12);\n const t7 = u8to16(data, offset + 14);\n let h0 = h[0] + (t0 & 0x1fff);\n let h1 = h[1] + ((t0 >>> 13 | t1 << 3) & 0x1fff);\n let h2 = h[2] + ((t1 >>> 10 | t2 << 6) & 0x1fff);\n let h3 = h[3] + ((t2 >>> 7 | t3 << 9) & 0x1fff);\n let h4 = h[4] + ((t3 >>> 4 | t4 << 12) & 0x1fff);\n let h5 = h[5] + (t4 >>> 1 & 0x1fff);\n let h6 = h[6] + ((t4 >>> 14 | t5 << 2) & 0x1fff);\n let h7 = h[7] + ((t5 >>> 11 | t6 << 5) & 0x1fff);\n let h8 = h[8] + ((t6 >>> 8 | t7 << 8) & 0x1fff);\n let h9 = h[9] + (t7 >>> 5 | hibit);\n let c = 0;\n let d0 = c + h0 * r0 + h1 * (5 * r9) + h2 * (5 * r8) + h3 * (5 * r7) + h4 * (5 * r6);\n c = d0 >>> 13;\n d0 &= 0x1fff;\n d0 += h5 * (5 * r5) + h6 * (5 * r4) + h7 * (5 * r3) + h8 * (5 * r2) + h9 * (5 * r1);\n c += d0 >>> 13;\n d0 &= 0x1fff;\n let d1 = c + h0 * r1 + h1 * r0 + h2 * (5 * r9) + h3 * (5 * r8
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/ciphers/esm/chacha.js":
|
|||
|
|
/*!***************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/ciphers/esm/chacha.js ***!
|
|||
|
|
\***************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ _poly1305_aead: () => (/* binding */ _poly1305_aead),\n/* harmony export */ chacha12: () => (/* binding */ chacha12),\n/* harmony export */ chacha20: () => (/* binding */ chacha20),\n/* harmony export */ chacha20orig: () => (/* binding */ chacha20orig),\n/* harmony export */ chacha20poly1305: () => (/* binding */ chacha20poly1305),\n/* harmony export */ chacha8: () => (/* binding */ chacha8),\n/* harmony export */ hchacha: () => (/* binding */ hchacha),\n/* harmony export */ xchacha20: () => (/* binding */ xchacha20),\n/* harmony export */ xchacha20poly1305: () => (/* binding */ xchacha20poly1305)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/ciphers/esm/utils.js\");\n/* harmony import */ var _poly1305_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_poly1305.js */ \"(ssr)/./node_modules/@noble/ciphers/esm/_poly1305.js\");\n/* harmony import */ var _arx_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arx.js */ \"(ssr)/./node_modules/@noble/ciphers/esm/_arx.js\");\n\n\n\n// ChaCha20 stream cipher was released in 2008. ChaCha aims to increase\n// the diffusion per round, but had slightly less cryptanalysis.\n// https://cr.yp.to/chacha.html, http://cr.yp.to/chacha/chacha-20080128.pdf\n/**\n * ChaCha core function.\n */ // prettier-ignore\nfunction chachaCore(s, k, n, out, cnt, rounds = 20) {\n let y00 = s[0], y01 = s[1], y02 = s[2], y03 = s[3], y04 = k[0], y05 = k[1], y06 = k[2], y07 = k[3], y08 = k[4], y09 = k[5], y10 = k[6], y11 = k[7], y12 = cnt, y13 = n[0], y14 = n[1], y15 = n[2]; // Counter Counter\tNonce Nonce\n // Save state to temporary variables\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n for(let r = 0; r < rounds; r += 2){\n x00 = x00 + x04 | 0;\n x12 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x12 ^ x00, 16);\n x08 = x08 + x12 | 0;\n x04 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x04 ^ x08, 12);\n x00 = x00 + x04 | 0;\n x12 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x12 ^ x00, 8);\n x08 = x08 + x12 | 0;\n x04 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x04 ^ x08, 7);\n x01 = x01 + x05 | 0;\n x13 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x13 ^ x01, 16);\n x09 = x09 + x13 | 0;\n x05 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x05 ^ x09, 12);\n x01 = x01 + x05 | 0;\n x13 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x13 ^ x01, 8);\n x09 = x09 + x13 | 0;\n x05 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x05 ^ x09, 7);\n x02 = x02 + x06 | 0;\n x14 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x14 ^ x02, 16);\n x10 = x10 + x14 | 0;\n x06 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x06 ^ x10, 12);\n x02 = x02 + x06 | 0;\n x14 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x14 ^ x02, 8);\n x10 = x10 + x14 | 0;\n x06 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x06 ^ x10, 7);\n x03 = x03 + x07 | 0;\n x15 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x15 ^ x03, 16);\n x11 = x11 + x15 | 0;\n x07 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x07 ^ x11, 12);\n x03 = x03 + x07 | 0;\n x15 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x15 ^ x03, 8);\n x11 = x11 + x15 | 0;\n x07 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x07 ^ x11, 7);\n x00 = x00 + x05 | 0;\n x15 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x15 ^ x00, 16);\n x10 = x10 + x15 | 0;\n x05 = (0,_arx_js__WEBPACK_IMPORTED_MODULE_2__.rotl)(x05 ^ x10, 12);\n x00 = x00 + x05 | 0;\n x15 = (0,_arx_js__WEBPACK_IM
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/ciphers/esm/utils.js":
|
|||
|
|
/*!**************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/ciphers/esm/utils.js ***!
|
|||
|
|
\**************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Hash: () => (/* binding */ Hash),\n/* harmony export */ asyncLoop: () => (/* binding */ asyncLoop),\n/* harmony export */ bytesToHex: () => (/* binding */ bytesToHex),\n/* harmony export */ bytesToNumberBE: () => (/* binding */ bytesToNumberBE),\n/* harmony export */ bytesToUtf8: () => (/* binding */ bytesToUtf8),\n/* harmony export */ checkOpts: () => (/* binding */ checkOpts),\n/* harmony export */ concatBytes: () => (/* binding */ concatBytes),\n/* harmony export */ createView: () => (/* binding */ createView),\n/* harmony export */ ensureBytes: () => (/* binding */ ensureBytes),\n/* harmony export */ equalBytes: () => (/* binding */ equalBytes),\n/* harmony export */ hexToBytes: () => (/* binding */ hexToBytes),\n/* harmony export */ hexToNumber: () => (/* binding */ hexToNumber),\n/* harmony export */ isLE: () => (/* binding */ isLE),\n/* harmony export */ nextTick: () => (/* binding */ nextTick),\n/* harmony export */ numberToBytesBE: () => (/* binding */ numberToBytesBE),\n/* harmony export */ setBigUint64: () => (/* binding */ setBigUint64),\n/* harmony export */ toBytes: () => (/* binding */ toBytes),\n/* harmony export */ u16: () => (/* binding */ u16),\n/* harmony export */ u32: () => (/* binding */ u32),\n/* harmony export */ u64Lengths: () => (/* binding */ u64Lengths),\n/* harmony export */ u8: () => (/* binding */ u8),\n/* harmony export */ utf8ToBytes: () => (/* binding */ utf8ToBytes),\n/* harmony export */ wrapCipher: () => (/* binding */ wrapCipher)\n/* harmony export */ });\n/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ // Cast array to different type\nconst u8 = (arr)=>new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nconst u16 = (arr)=>new Uint16Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 2));\nconst u32 = (arr)=>new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\nfunction isBytes(a) {\n return a instanceof Uint8Array || a != null && typeof a === \"object\" && a.constructor.name === \"Uint8Array\";\n}\n// Cast array to view\nconst createView = (arr)=>new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// big-endian hardware is rare. Just in case someone still decides to run ciphers:\n// early-throw an error because we don't support BE yet.\nconst isLE = new Uint8Array(new Uint32Array([\n 0x11223344\n]).buffer)[0] === 0x44;\nif (!isLE) throw new Error(\"Non little-endian hardware is not supported\");\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({\n length: 256\n}, (_, i)=>i.toString(16).padStart(2, \"0\"));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */ function bytesToHex(bytes) {\n if (!isBytes(bytes)) throw new Error(\"Uint8Array expected\");\n // pre-caching improves the speed 6x\n let hex = \"\";\n for(let i = 0; i < bytes.length; i++){\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = {\n _0: 48,\n _9: 57,\n _A: 65,\n _F: 70,\n _a: 97,\n _f: 102\n};\nfunction asciiToBase16(char) {\n if (char >= asciis._0 && char <= asciis._9) return char - asciis._0;\n if (char >= asciis._A && char <= asciis._F) return char - (asciis._A - 10);\n if (char >= asciis._a && char <= asciis._f) return char - (asciis._a - 10);\n return;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */ function hexToBytes(hex) {\n if (typeof hex !== \"string\") throw new Error(\"hex string expected, got \" + typeof hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error(\"padded hex string expected, got unpadded hex of length \" + hl);\n const array = new Uint8Array(al);\n for(let ai = 0, hi = 0; ai < al; ai++, hi += 2){\n const n1 =
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/_shortw_utils.js":
|
|||
|
|
/*!*********************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/_shortw_utils.js ***!
|
|||
|
|
\*********************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createCurve: () => (/* binding */ createCurve),\n/* harmony export */ getHash: () => (/* binding */ getHash)\n/* harmony export */ });\n/* harmony import */ var _noble_hashes_hmac__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @noble/hashes/hmac */ \"(ssr)/./node_modules/@noble/hashes/esm/hmac.js\");\n/* harmony import */ var _noble_hashes_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @noble/hashes/utils */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n/* harmony import */ var _abstract_weierstrass_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./abstract/weierstrass.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/weierstrass.js\");\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ \n\n\n// connects noble-curves to noble-hashes\nfunction getHash(hash) {\n return {\n hash,\n hmac: (key, ...msgs)=>(0,_noble_hashes_hmac__WEBPACK_IMPORTED_MODULE_0__.hmac)(hash, key, (0,_noble_hashes_utils__WEBPACK_IMPORTED_MODULE_1__.concatBytes)(...msgs)),\n randomBytes: _noble_hashes_utils__WEBPACK_IMPORTED_MODULE_1__.randomBytes\n };\n}\nfunction createCurve(curveDef, defHash) {\n const create = (hash)=>(0,_abstract_weierstrass_js__WEBPACK_IMPORTED_MODULE_2__.weierstrass)({\n ...curveDef,\n ...getHash(hash)\n });\n return Object.freeze({\n ...create(defHash),\n create\n });\n} //# sourceMappingURL=_shortw_utils.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvQG5vYmxlL2N1cnZlcy9lc20vX3Nob3J0d191dGlscy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUFBLG9FQUFvRSxHQUMxQjtBQUNxQjtBQUNQO0FBQ3hELHdDQUF3QztBQUNqQyxTQUFTSSxRQUFRQyxJQUFJO0lBQ3hCLE9BQU87UUFDSEE7UUFDQUwsTUFBTSxDQUFDTSxLQUFLLEdBQUdDLE9BQVNQLHdEQUFJQSxDQUFDSyxNQUFNQyxLQUFLTCxnRUFBV0EsSUFBSU07UUFDdkRMLFdBQVdBLDhEQUFBQTtJQUNmO0FBQ0o7QUFDTyxTQUFTTSxZQUFZQyxRQUFRLEVBQUVDLE9BQU87SUFDekMsTUFBTUMsU0FBUyxDQUFDTixPQUFTRixxRUFBV0EsQ0FBQztZQUFFLEdBQUdNLFFBQVE7WUFBRSxHQUFHTCxRQUFRQyxLQUFLO1FBQUM7SUFDckUsT0FBT08sT0FBT0MsTUFBTSxDQUFDO1FBQUUsR0FBR0YsT0FBT0QsUUFBUTtRQUFFQztJQUFPO0FBQ3RELEVBQ0EseUNBQXlDIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZmx1c2gtbm90ZXMvLi9ub2RlX21vZHVsZXMvQG5vYmxlL2N1cnZlcy9lc20vX3Nob3J0d191dGlscy5qcz9mMjQ0Il0sInNvdXJjZXNDb250ZW50IjpbIi8qISBub2JsZS1jdXJ2ZXMgLSBNSVQgTGljZW5zZSAoYykgMjAyMiBQYXVsIE1pbGxlciAocGF1bG1pbGxyLmNvbSkgKi9cbmltcG9ydCB7IGhtYWMgfSBmcm9tICdAbm9ibGUvaGFzaGVzL2htYWMnO1xuaW1wb3J0IHsgY29uY2F0Qnl0ZXMsIHJhbmRvbUJ5dGVzIH0gZnJvbSAnQG5vYmxlL2hhc2hlcy91dGlscyc7XG5pbXBvcnQgeyB3ZWllcnN0cmFzcyB9IGZyb20gJy4vYWJzdHJhY3Qvd2VpZXJzdHJhc3MuanMnO1xuLy8gY29ubmVjdHMgbm9ibGUtY3VydmVzIHRvIG5vYmxlLWhhc2hlc1xuZXhwb3J0IGZ1bmN0aW9uIGdldEhhc2goaGFzaCkge1xuICAgIHJldHVybiB7XG4gICAgICAgIGhhc2gsXG4gICAgICAgIGhtYWM6IChrZXksIC4uLm1zZ3MpID0+IGhtYWMoaGFzaCwga2V5LCBjb25jYXRCeXRlcyguLi5tc2dzKSksXG4gICAgICAgIHJhbmRvbUJ5dGVzLFxuICAgIH07XG59XG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlQ3VydmUoY3VydmVEZWYsIGRlZkhhc2gpIHtcbiAgICBjb25zdCBjcmVhdGUgPSAoaGFzaCkgPT4gd2VpZXJzdHJhc3MoeyAuLi5jdXJ2ZURlZiwgLi4uZ2V0SGFzaChoYXNoKSB9KTtcbiAgICByZXR1cm4gT2JqZWN0LmZyZWV6ZSh7IC4uLmNyZWF0ZShkZWZIYXNoKSwgY3JlYXRlIH0pO1xufVxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9X3Nob3J0d191dGlscy5qcy5tYXAiXSwibmFtZXMiOlsiaG1hYyIsImNvbmNhdEJ5dGVzIiwicmFuZG9tQnl0ZXMiLCJ3ZWllcnN0cmFzcyIsImdldEhhc2giLCJoYXNoIiwia2V5IiwibXNncyIsImNyZWF0ZUN1cnZlIiwiY3VydmVEZWYiLCJkZWZIYXNoIiwiY3JlYXRlIiwiT2JqZWN0IiwiZnJlZXplIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/@noble/curves/esm/_shortw_utils.js\n");
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/abstract/curve.js":
|
|||
|
|
/*!**********************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/abstract/curve.js ***!
|
|||
|
|
\**********************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ validateBasic: () => (/* binding */ validateBasic),\n/* harmony export */ wNAF: () => (/* binding */ wNAF)\n/* harmony export */ });\n/* harmony import */ var _modular_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modular.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/modular.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js\");\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Abelian group utilities\n\n\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\n// Elliptic curve multiplication of Point by scalar. Fragile.\n// Scalars should always be less than curve order: this should be checked inside of a curve itself.\n// Creates precomputation tables for fast multiplication:\n// - private scalar is split by fixed size windows of W bits\n// - every window point is collected from window's table & added to accumulator\n// - since windows are different, same point inside tables won't be accessed more than once per calc\n// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n// - +1 window is neccessary for wNAF\n// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow\n// windows to be in different memory locations\nfunction wNAF(c, bits) {\n const constTimeNegate = (condition, item)=>{\n const neg = item.negate();\n return condition ? neg : item;\n };\n const opts = (W)=>{\n const windows = Math.ceil(bits / W) + 1; // +1, because\n const windowSize = 2 ** (W - 1); // -1 because we skip zero\n return {\n windows,\n windowSize\n };\n };\n return {\n constTimeNegate,\n // non-const time multiplication ladder\n unsafeLadder (elm, n) {\n let p = c.ZERO;\n let d = elm;\n while(n > _0n){\n if (n & _1n) p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @returns precomputed point tables flattened to a single array\n */ precomputeWindow (elm, W) {\n const { windows, windowSize } = opts(W);\n const points = [];\n let p = elm;\n let base = p;\n for(let window = 0; window < windows; window++){\n base = p;\n points.push(base);\n // =1, because we skip zero\n for(let i = 1; i < windowSize; i++){\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */ wNAF (W, precomputes, n) {\n // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise\n // But need to carefully remove other check
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/abstract/edwards.js":
|
|||
|
|
/*!************************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/abstract/edwards.js ***!
|
|||
|
|
\************************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ twistedEdwards: () => (/* binding */ twistedEdwards)\n/* harmony export */ });\n/* harmony import */ var _modular_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modular.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/modular.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js\");\n/* harmony import */ var _curve_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./curve.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/curve.js\");\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y²\n\n\n\n\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8);\n// verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex:\nconst VERIFY_DEFAULT = {\n zip215: true\n};\nfunction validateOpts(curve) {\n const opts = (0,_curve_js__WEBPACK_IMPORTED_MODULE_0__.validateBasic)(curve);\n _utils_js__WEBPACK_IMPORTED_MODULE_1__.validateObject(curve, {\n hash: \"function\",\n a: \"bigint\",\n d: \"bigint\",\n randomBytes: \"function\"\n }, {\n adjustScalarBytes: \"function\",\n domain: \"function\",\n uvRatio: \"function\",\n mapToCurve: \"function\"\n });\n // Set defaults\n return Object.freeze({\n ...opts\n });\n}\n// It is not generic twisted curve for now, but ed25519/ed448 generic implementation\nfunction twistedEdwards(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { Fp, n: CURVE_ORDER, prehash: prehash, hash: cHash, randomBytes, nByteLength, h: cofactor } = CURVE;\n const MASK = _2n << BigInt(nByteLength * 8) - _1n;\n const modP = Fp.create; // Function overrides\n // sqrt(u/v)\n const uvRatio = CURVE.uvRatio || ((u, v)=>{\n try {\n return {\n isValid: true,\n value: Fp.sqrt(u * Fp.inv(v))\n };\n } catch (e) {\n return {\n isValid: false,\n value: _0n\n };\n }\n });\n const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes)=>bytes); // NOOP\n const domain = CURVE.domain || ((data, ctx, phflag)=>{\n if (ctx.length || phflag) throw new Error(\"Contexts/pre-hash are not supported\");\n return data;\n }); // NOOP\n const inBig = (n)=>typeof n === \"bigint\" && _0n < n; // n in [1..]\n const inRange = (n, max)=>inBig(n) && inBig(max) && n < max; // n in [1..max-1]\n const in0MaskRange = (n)=>n === _0n || inRange(n, MASK); // n in [0..MASK-1]\n function assertInRange(n, max) {\n // n in [1..max-1]\n if (inRange(n, max)) return n;\n throw new Error(`Expected valid scalar < ${max}, got ${typeof n} ${n}`);\n }\n function assertGE0(n) {\n // n in [0..CURVE_ORDER-1]\n return n === _0n ? n : assertInRange(n, CURVE_ORDER); // GE = prime subgroup, not full group\n }\n const pointPrecomputes = new Map();\n function isPoint(other) {\n if (!(other instanceof Point)) throw new Error(\"ExtendedPoint expected\");\n }\n // Extended Point works in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z, t=xy).\n // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates\n class Point {\n constructor(ex, ey, ez, et){\n this.ex = ex;\n this.ey = ey;\n this.ez = ez;\n this.et = et;\n if (!in0MaskRange(ex)) throw new Error(\"x required\");\n if (!in0MaskRange(ey)) throw new Error(\"y required\");\n if (!in0MaskRange(ez)) throw new Error(\"z required\");\n if (!in0MaskRange(et)) throw new Error(\"t required\");\n
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/abstract/hash-to-curve.js":
|
|||
|
|
/*!******************************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/abstract/hash-to-curve.js ***!
|
|||
|
|
\******************************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createHasher: () => (/* binding */ createHasher),\n/* harmony export */ expand_message_xmd: () => (/* binding */ expand_message_xmd),\n/* harmony export */ expand_message_xof: () => (/* binding */ expand_message_xof),\n/* harmony export */ hash_to_field: () => (/* binding */ hash_to_field),\n/* harmony export */ isogenyMap: () => (/* binding */ isogenyMap)\n/* harmony export */ });\n/* harmony import */ var _modular_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modular.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/modular.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js\");\n\n\n// Octet Stream to Integer. \"spec\" implementation of os2ip is 2.5x slower vs bytesToNumberBE.\nconst os2ip = _utils_js__WEBPACK_IMPORTED_MODULE_0__.bytesToNumberBE;\n// Integer to Octet Stream (numberToBytesBE)\nfunction i2osp(value, length) {\n if (value < 0 || value >= 1 << 8 * length) {\n throw new Error(`bad I2OSP call: value=${value} length=${length}`);\n }\n const res = Array.from({\n length\n }).fill(0);\n for(let i = length - 1; i >= 0; i--){\n res[i] = value & 0xff;\n value >>>= 8;\n }\n return new Uint8Array(res);\n}\nfunction strxor(a, b) {\n const arr = new Uint8Array(a.length);\n for(let i = 0; i < a.length; i++){\n arr[i] = a[i] ^ b[i];\n }\n return arr;\n}\nfunction anum(item) {\n if (!Number.isSafeInteger(item)) throw new Error(\"number expected\");\n}\n// Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits\n// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1\nfunction expand_message_xmd(msg, DST, lenInBytes, H) {\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.abytes)(msg);\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.abytes)(DST);\n anum(lenInBytes);\n // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3\n if (DST.length > 255) DST = H((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.concatBytes)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.utf8ToBytes)(\"H2C-OVERSIZE-DST-\"), DST));\n const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H;\n const ell = Math.ceil(lenInBytes / b_in_bytes);\n if (ell > 255) throw new Error(\"Invalid xmd length\");\n const DST_prime = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.concatBytes)(DST, i2osp(DST.length, 1));\n const Z_pad = i2osp(0, r_in_bytes);\n const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str\n const b = new Array(ell);\n const b_0 = H((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.concatBytes)(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime));\n b[0] = H((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.concatBytes)(b_0, i2osp(1, 1), DST_prime));\n for(let i = 1; i <= ell; i++){\n const args = [\n strxor(b_0, b[i - 1]),\n i2osp(i + 1, 1),\n DST_prime\n ];\n b[i] = H((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.concatBytes)(...args));\n }\n const pseudo_random_bytes = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.concatBytes)(...b);\n return pseudo_random_bytes.slice(0, lenInBytes);\n}\n// Produces a uniformly random byte string using an extendable-output function (XOF) H.\n// 1. The collision resistance of H MUST be at least k bits.\n// 2. H MUST be an XOF that has been proved indifferentiable from\n// a random oracle under a reasonable cryptographic assumption.\n// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2\nfunction expand_message_xof(msg, DST, lenInBytes, k, H) {\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.abytes)(msg);\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.abytes)(DST);\n anum(lenInBytes);\n // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3\n // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8));\n if (DST.length
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/abstract/modular.js":
|
|||
|
|
/*!************************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/abstract/modular.js ***!
|
|||
|
|
\************************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Field: () => (/* binding */ Field),\n/* harmony export */ FpDiv: () => (/* binding */ FpDiv),\n/* harmony export */ FpInvertBatch: () => (/* binding */ FpInvertBatch),\n/* harmony export */ FpIsSquare: () => (/* binding */ FpIsSquare),\n/* harmony export */ FpPow: () => (/* binding */ FpPow),\n/* harmony export */ FpSqrt: () => (/* binding */ FpSqrt),\n/* harmony export */ FpSqrtEven: () => (/* binding */ FpSqrtEven),\n/* harmony export */ FpSqrtOdd: () => (/* binding */ FpSqrtOdd),\n/* harmony export */ getFieldBytesLength: () => (/* binding */ getFieldBytesLength),\n/* harmony export */ getMinHashLength: () => (/* binding */ getMinHashLength),\n/* harmony export */ hashToPrivateScalar: () => (/* binding */ hashToPrivateScalar),\n/* harmony export */ invert: () => (/* binding */ invert),\n/* harmony export */ isNegativeLE: () => (/* binding */ isNegativeLE),\n/* harmony export */ mapHashToField: () => (/* binding */ mapHashToField),\n/* harmony export */ mod: () => (/* binding */ mod),\n/* harmony export */ nLength: () => (/* binding */ nLength),\n/* harmony export */ pow: () => (/* binding */ pow),\n/* harmony export */ pow2: () => (/* binding */ pow2),\n/* harmony export */ tonelliShanks: () => (/* binding */ tonelliShanks),\n/* harmony export */ validateField: () => (/* binding */ validateField)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js\");\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Utilities for modular arithmetics and finite fields\n\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);\n// prettier-ignore\nconst _9n = BigInt(9), _16n = BigInt(16);\n// Calculates a modulo b\nfunction mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */ // TODO: use field version && remove\nfunction pow(num, power, modulo) {\n if (modulo <= _0n || power < _0n) throw new Error(\"Expected power/modulo > 0\");\n if (modulo === _1n) return _0n;\n let res = _1n;\n while(power > _0n){\n if (power & _1n) res = res * num % modulo;\n num = num * num % modulo;\n power >>= _1n;\n }\n return res;\n}\n// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)\nfunction pow2(x, power, modulo) {\n let res = x;\n while(power-- > _0n){\n res *= res;\n res %= modulo;\n }\n return res;\n}\n// Inverses number over modulo\nfunction invert(number, modulo) {\n if (number === _0n || modulo <= _0n) {\n throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);\n }\n // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while(a !== _0n){\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n) throw new Error(\"invert: does not exist\");\n return mod(x, modulo);\n}\n/**\n * Tonelli-Shanks square root search algorithm.\n * 1. https://eprint.iacr.org/2012/685.pdf (page 12)\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * Will start an infinite loop if field orde
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/abstract/montgomery.js":
|
|||
|
|
/*!***************************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/abstract/montgomery.js ***!
|
|||
|
|
\***************************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ montgomery: () => (/* binding */ montgomery)\n/* harmony export */ });\n/* harmony import */ var _modular_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modular.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/modular.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js\");\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ \n\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nfunction validateOpts(curve) {\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.validateObject)(curve, {\n a: \"bigint\"\n }, {\n montgomeryBits: \"isSafeInteger\",\n nByteLength: \"isSafeInteger\",\n adjustScalarBytes: \"function\",\n domain: \"function\",\n powPminus2: \"function\",\n Gu: \"bigint\"\n });\n // Set defaults\n return Object.freeze({\n ...curve\n });\n}\n// NOTE: not really montgomery curve, just bunch of very specific methods for X25519/X448 (RFC 7748, https://www.rfc-editor.org/rfc/rfc7748)\n// Uses only one coordinate instead of two\nfunction montgomery(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { P } = CURVE;\n const modP = (n)=>(0,_modular_js__WEBPACK_IMPORTED_MODULE_1__.mod)(n, P);\n const montgomeryBits = CURVE.montgomeryBits;\n const montgomeryBytes = Math.ceil(montgomeryBits / 8);\n const fieldLen = CURVE.nByteLength;\n const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes)=>bytes);\n const powPminus2 = CURVE.powPminus2 || ((x)=>(0,_modular_js__WEBPACK_IMPORTED_MODULE_1__.pow)(x, P - BigInt(2), P));\n // cswap from RFC7748. But it is not from RFC7748!\n /*\n cswap(swap, x_2, x_3):\n dummy = mask(swap) AND (x_2 XOR x_3)\n x_2 = x_2 XOR dummy\n x_3 = x_3 XOR dummy\n Return (x_2, x_3)\n Where mask(swap) is the all-1 or all-0 word of the same length as x_2\n and x_3, computed, e.g., as mask(swap) = 0 - swap.\n */ function cswap(swap, x_2, x_3) {\n const dummy = modP(swap * (x_2 - x_3));\n x_2 = modP(x_2 - dummy);\n x_3 = modP(x_3 + dummy);\n return [\n x_2,\n x_3\n ];\n }\n // Accepts 0 as well\n function assertFieldElement(n) {\n if (typeof n === \"bigint\" && _0n <= n && n < P) return n;\n throw new Error(\"Expected valid scalar 0 < scalar < CURVE.P\");\n }\n // x25519 from 4\n // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519\n const a24 = (CURVE.a - BigInt(2)) / BigInt(4);\n /**\n *\n * @param pointU u coordinate (x) on Montgomery Curve 25519\n * @param scalar by which the point would be multiplied\n * @returns new Point on Montgomery curve\n */ function montgomeryLadder(pointU, scalar) {\n const u = assertFieldElement(pointU);\n // Section 5: Implementations MUST accept non-canonical values and process them as\n // if they had been reduced modulo the field prime.\n const k = assertFieldElement(scalar);\n const x_1 = u;\n let x_2 = _1n;\n let z_2 = _0n;\n let x_3 = u;\n let z_3 = _1n;\n let swap = _0n;\n let sw;\n for(let t = BigInt(montgomeryBits - 1); t >= _0n; t--){\n const k_t = k >> t & _1n;\n swap ^= k_t;\n sw = cswap(swap, x_2, x_3);\n x_2 = sw[0];\n x_3 = sw[1];\n sw = cswap(swap, z_2, z_3);\n z_2 = sw[0];\n z_3 = sw[1];\n swap = k_t;\n const A = x_2 + z_2;\n const AA = modP(A * A);\n const B = x_2 - z_2;\n const BB = modP(B * B);\n const E = AA - BB;\n const C = x_3 + z_3;\n const D = x_3 - z_3;\n const DA = modP(D * A);\n const CB = mod
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js":
|
|||
|
|
/*!**********************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/abstract/utils.js ***!
|
|||
|
|
\**********************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ abytes: () => (/* binding */ abytes),\n/* harmony export */ bitGet: () => (/* binding */ bitGet),\n/* harmony export */ bitLen: () => (/* binding */ bitLen),\n/* harmony export */ bitMask: () => (/* binding */ bitMask),\n/* harmony export */ bitSet: () => (/* binding */ bitSet),\n/* harmony export */ bytesToHex: () => (/* binding */ bytesToHex),\n/* harmony export */ bytesToNumberBE: () => (/* binding */ bytesToNumberBE),\n/* harmony export */ bytesToNumberLE: () => (/* binding */ bytesToNumberLE),\n/* harmony export */ concatBytes: () => (/* binding */ concatBytes),\n/* harmony export */ createHmacDrbg: () => (/* binding */ createHmacDrbg),\n/* harmony export */ ensureBytes: () => (/* binding */ ensureBytes),\n/* harmony export */ equalBytes: () => (/* binding */ equalBytes),\n/* harmony export */ hexToBytes: () => (/* binding */ hexToBytes),\n/* harmony export */ hexToNumber: () => (/* binding */ hexToNumber),\n/* harmony export */ isBytes: () => (/* binding */ isBytes),\n/* harmony export */ numberToBytesBE: () => (/* binding */ numberToBytesBE),\n/* harmony export */ numberToBytesLE: () => (/* binding */ numberToBytesLE),\n/* harmony export */ numberToHexUnpadded: () => (/* binding */ numberToHexUnpadded),\n/* harmony export */ numberToVarBytesBE: () => (/* binding */ numberToVarBytesBE),\n/* harmony export */ utf8ToBytes: () => (/* binding */ utf8ToBytes),\n/* harmony export */ validateObject: () => (/* binding */ validateObject)\n/* harmony export */ });\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nfunction isBytes(a) {\n return a instanceof Uint8Array || a != null && typeof a === \"object\" && a.constructor.name === \"Uint8Array\";\n}\nfunction abytes(item) {\n if (!isBytes(item)) throw new Error(\"Uint8Array expected\");\n}\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({\n length: 256\n}, (_, i)=>i.toString(16).padStart(2, \"0\"));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */ function bytesToHex(bytes) {\n abytes(bytes);\n // pre-caching improves the speed 6x\n let hex = \"\";\n for(let i = 0; i < bytes.length; i++){\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nfunction numberToHexUnpadded(num) {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n}\nfunction hexToNumber(hex) {\n if (typeof hex !== \"string\") throw new Error(\"hex string expected, got \" + typeof hex);\n // Big Endian\n return BigInt(hex === \"\" ? \"0\" : `0x${hex}`);\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = {\n _0: 48,\n _9: 57,\n _A: 65,\n _F: 70,\n _a: 97,\n _f: 102\n};\nfunction asciiToBase16(char) {\n if (char >= asciis._0 && char <= asciis._9) return char - asciis._0;\n if (char >= asciis._A && char <= asciis._F) return char - (asciis._A - 10);\n if (char >= asciis._a && char <= asciis._f) return char - (asciis._a - 10);\n return;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */ function hexToBytes(hex) {\n if (typeof hex !== \"string\") throw new Error(\"hex string expected, got \" + typeof hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error(\"padded hex string expected, got unpadded hex of length \" + hl);\n const array = new Uint8Array(al);\n for(let ai = 0, hi = 0; ai < al; ai++, hi += 2){\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = a
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/abstract/weierstrass.js":
|
|||
|
|
/*!****************************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/abstract/weierstrass.js ***!
|
|||
|
|
\****************************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DER: () => (/* binding */ DER),\n/* harmony export */ SWUFpSqrtRatio: () => (/* binding */ SWUFpSqrtRatio),\n/* harmony export */ mapToCurveSimpleSWU: () => (/* binding */ mapToCurveSimpleSWU),\n/* harmony export */ weierstrass: () => (/* binding */ weierstrass),\n/* harmony export */ weierstrassPoints: () => (/* binding */ weierstrassPoints)\n/* harmony export */ });\n/* harmony import */ var _modular_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modular.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/modular.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js\");\n/* harmony import */ var _curve_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./curve.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/curve.js\");\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // Short Weierstrass curve. The formula is: y² = x³ + ax + b\n\n\n\n\nfunction validatePointOpts(curve) {\n const opts = (0,_curve_js__WEBPACK_IMPORTED_MODULE_0__.validateBasic)(curve);\n _utils_js__WEBPACK_IMPORTED_MODULE_1__.validateObject(opts, {\n a: \"field\",\n b: \"field\"\n }, {\n allowedPrivateKeyLengths: \"array\",\n wrapPrivateKey: \"boolean\",\n isTorsionFree: \"function\",\n clearCofactor: \"function\",\n allowInfinityPoint: \"boolean\",\n fromBytes: \"function\",\n toBytes: \"function\"\n });\n const { endo, Fp, a } = opts;\n if (endo) {\n if (!Fp.eql(a, Fp.ZERO)) {\n throw new Error(\"Endomorphism can only be defined for Koblitz curves that have a=0\");\n }\n if (typeof endo !== \"object\" || typeof endo.beta !== \"bigint\" || typeof endo.splitScalar !== \"function\") {\n throw new Error(\"Expected endomorphism with beta: bigint and splitScalar: function\");\n }\n }\n return Object.freeze({\n ...opts\n });\n}\n// ASN.1 DER encoding utilities\nconst { bytesToNumberBE: b2n, hexToBytes: h2b } = _utils_js__WEBPACK_IMPORTED_MODULE_1__;\nconst DER = {\n // asn.1 DER encoding utils\n Err: class DERErr extends Error {\n constructor(m = \"\"){\n super(m);\n }\n },\n _parseInt (data) {\n const { Err: E } = DER;\n if (data.length < 2 || data[0] !== 0x02) throw new E(\"Invalid signature integer tag\");\n const len = data[1];\n const res = data.subarray(2, len + 2);\n if (!len || res.length !== len) throw new E(\"Invalid signature integer: wrong length\");\n // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n // since we always use positive integers here. It must always be empty:\n // - add zero byte if exists\n // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n if (res[0] & 128) throw new E(\"Invalid signature integer: negative\");\n if (res[0] === 0x00 && !(res[1] & 128)) throw new E(\"Invalid signature integer: unnecessary leading zero\");\n return {\n d: b2n(res),\n l: data.subarray(len + 2)\n }; // d is data, l is left\n },\n toSig (hex) {\n // parse DER signature\n const { Err: E } = DER;\n const data = typeof hex === \"string\" ? h2b(hex) : hex;\n _utils_js__WEBPACK_IMPORTED_MODULE_1__.abytes(data);\n let l = data.length;\n if (l < 2 || data[0] != 0x30) throw new E(\"Invalid signature tag\");\n if (data[1] !== l - 2) throw new E(\"Invalid signature: incorrect length\");\n const { d: r, l: sBytes } = DER._parseInt(data.subarray(2));\n const { d: s, l: rBytesLeft } = DER._parseInt(sBytes);\n if (rBytesLeft.length) throw new E(\"Invalid signature: left bytes after parsing\");\n retu
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/ed25519.js":
|
|||
|
|
/*!***************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/ed25519.js ***!
|
|||
|
|
\***************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ED25519_TORSION_SUBGROUP: () => (/* binding */ ED25519_TORSION_SUBGROUP),\n/* harmony export */ RistrettoPoint: () => (/* binding */ RistrettoPoint),\n/* harmony export */ ed25519: () => (/* binding */ ed25519),\n/* harmony export */ ed25519ctx: () => (/* binding */ ed25519ctx),\n/* harmony export */ ed25519ph: () => (/* binding */ ed25519ph),\n/* harmony export */ edwardsToMontgomery: () => (/* binding */ edwardsToMontgomery),\n/* harmony export */ edwardsToMontgomeryPriv: () => (/* binding */ edwardsToMontgomeryPriv),\n/* harmony export */ edwardsToMontgomeryPub: () => (/* binding */ edwardsToMontgomeryPub),\n/* harmony export */ encodeToCurve: () => (/* binding */ encodeToCurve),\n/* harmony export */ hashToCurve: () => (/* binding */ hashToCurve),\n/* harmony export */ hashToRistretto255: () => (/* binding */ hashToRistretto255),\n/* harmony export */ hash_to_ristretto255: () => (/* binding */ hash_to_ristretto255),\n/* harmony export */ x25519: () => (/* binding */ x25519)\n/* harmony export */ });\n/* harmony import */ var _noble_hashes_sha512__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @noble/hashes/sha512 */ \"(ssr)/./node_modules/@noble/hashes/esm/sha512.js\");\n/* harmony import */ var _noble_hashes_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @noble/hashes/utils */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n/* harmony import */ var _abstract_edwards_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./abstract/edwards.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/edwards.js\");\n/* harmony import */ var _abstract_montgomery_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./abstract/montgomery.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/montgomery.js\");\n/* harmony import */ var _abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./abstract/modular.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/modular.js\");\n/* harmony import */ var _abstract_utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./abstract/utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js\");\n/* harmony import */ var _abstract_hash_to_curve_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./abstract/hash-to-curve.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/hash-to-curve.js\");\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ \n\n\n\n\n\n\n/**\n * ed25519 Twisted Edwards curve with following addons:\n * - X25519 ECDH\n * - Ristretto cofactor elimination\n * - Elligator hash-to-group / point indistinguishability\n */ const ED25519_P = BigInt(\"57896044618658097711785492504343953926634992332820282019728792003956564819949\");\n// √(-1) aka √(a) aka 2^((p-1)/4)\nconst ED25519_SQRT_M1 = BigInt(\"19681161376707505956807079304988542015446066515923890162744021073123829784752\");\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _5n = BigInt(5);\n// prettier-ignore\nconst _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80);\nfunction ed25519_pow_2_252_3(x) {\n const P = ED25519_P;\n const x2 = x * x % P;\n const b2 = x2 * x % P; // x^3, 11\n const b4 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b2, _2n, P) * b2 % P; // x^15, 1111\n const b5 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b4, _1n, P) * x % P; // x^31\n const b10 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b5, _5n, P) * b5 % P;\n const b20 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b10, _10n, P) * b10 % P;\n const b40 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b20, _20n, P) * b20 % P;\n const b80 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b40, _40n, P) * b40 % P;\n const b160 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b80, _80n, P) * b80 % P
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/curves/esm/secp256k1.js":
|
|||
|
|
/*!*****************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/curves/esm/secp256k1.js ***!
|
|||
|
|
\*****************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ encodeToCurve: () => (/* binding */ encodeToCurve),\n/* harmony export */ hashToCurve: () => (/* binding */ hashToCurve),\n/* harmony export */ schnorr: () => (/* binding */ schnorr),\n/* harmony export */ secp256k1: () => (/* binding */ secp256k1)\n/* harmony export */ });\n/* harmony import */ var _noble_hashes_sha256__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @noble/hashes/sha256 */ \"(ssr)/./node_modules/@noble/hashes/esm/sha256.js\");\n/* harmony import */ var _noble_hashes_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @noble/hashes/utils */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n/* harmony import */ var _abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./abstract/modular.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/modular.js\");\n/* harmony import */ var _abstract_weierstrass_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./abstract/weierstrass.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/weierstrass.js\");\n/* harmony import */ var _abstract_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./abstract/utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/utils.js\");\n/* harmony import */ var _abstract_hash_to_curve_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./abstract/hash-to-curve.js */ \"(ssr)/./node_modules/@noble/curves/esm/abstract/hash-to-curve.js\");\n/* harmony import */ var _shortw_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortw_utils.js */ \"(ssr)/./node_modules/@noble/curves/esm/_shortw_utils.js\");\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ \n\n\n\n\n\n\nconst secp256k1P = BigInt(\"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f\");\nconst secp256k1N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst divNearest = (a, b)=>(a + b / _2n) / b;\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */ function sqrtMod(y) {\n const P = secp256k1P;\n // prettier-ignore\n const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n // prettier-ignore\n const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n const b2 = y * y * y % P; // x^3, 11\n const b3 = b2 * b2 * y % P; // x^7\n const b6 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b3, _3n, P) * b3 % P;\n const b9 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b6, _3n, P) * b3 % P;\n const b11 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b9, _2n, P) * b2 % P;\n const b22 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b11, _11n, P) * b11 % P;\n const b44 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b22, _22n, P) * b22 % P;\n const b88 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b44, _44n, P) * b44 % P;\n const b176 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b88, _88n, P) * b88 % P;\n const b220 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b176, _44n, P) * b44 % P;\n const b223 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b220, _3n, P) * b3 % P;\n const t1 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(b223, _23n, P) * b22 % P;\n const t2 = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(t1, _6n, P) * b2 % P;\n const root = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.pow2)(t2, _2n, P);\n if (!Fp.eql(Fp.sqr(root), y)) throw new Error(\"Cannot find square root\");\n return root;\n}\nconst Fp = (0,_abstract_modular_js__WEBPACK_IMPORTED_MODULE_0__.Field)(secp256k1P, undefined, undefined, {\n sqrt: sqrtMod\n});\nconst secp256k1 = (0,_short
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/_assert.js":
|
|||
|
|
/*!***************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/_assert.js ***!
|
|||
|
|
\***************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bool: () => (/* binding */ bool),\n/* harmony export */ bytes: () => (/* binding */ bytes),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ exists: () => (/* binding */ exists),\n/* harmony export */ hash: () => (/* binding */ hash),\n/* harmony export */ isBytes: () => (/* binding */ isBytes),\n/* harmony export */ number: () => (/* binding */ number),\n/* harmony export */ output: () => (/* binding */ output)\n/* harmony export */ });\nfunction number(n) {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error(`positive integer expected, not ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== \"boolean\") throw new Error(`boolean expected, not ${b}`);\n}\n// copied from utils\nfunction isBytes(a) {\n return a instanceof Uint8Array || a != null && typeof a === \"object\" && a.constructor.name === \"Uint8Array\";\n}\nfunction bytes(b, ...lengths) {\n if (!isBytes(b)) throw new Error(\"Uint8Array expected\");\n if (lengths.length > 0 && !lengths.includes(b.length)) throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(h) {\n if (typeof h !== \"function\" || typeof h.create !== \"function\") throw new Error(\"Hash should be wrapped by utils.wrapConstructor\");\n number(h.outputLen);\n number(h.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed) throw new Error(\"Hash instance has been destroyed\");\n if (checkFinished && instance.finished) throw new Error(\"Hash#digest() has already been called\");\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\n\nconst assert = {\n number,\n bool,\n bytes,\n hash,\n exists,\n output\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assert); //# sourceMappingURL=_assert.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvQG5vYmxlL2hhc2hlcy9lc20vX2Fzc2VydC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUFBLFNBQVNBLE9BQU9DLENBQUM7SUFDYixJQUFJLENBQUNDLE9BQU9DLGFBQWEsQ0FBQ0YsTUFBTUEsSUFBSSxHQUNoQyxNQUFNLElBQUlHLE1BQU0sQ0FBQywrQkFBK0IsRUFBRUgsRUFBRSxDQUFDO0FBQzdEO0FBQ0EsU0FBU0ksS0FBS0MsQ0FBQztJQUNYLElBQUksT0FBT0EsTUFBTSxXQUNiLE1BQU0sSUFBSUYsTUFBTSxDQUFDLHNCQUFzQixFQUFFRSxFQUFFLENBQUM7QUFDcEQ7QUFDQSxvQkFBb0I7QUFDYixTQUFTQyxRQUFRQyxDQUFDO0lBQ3JCLE9BQVFBLGFBQWFDLGNBQ2hCRCxLQUFLLFFBQVEsT0FBT0EsTUFBTSxZQUFZQSxFQUFFRSxXQUFXLENBQUNDLElBQUksS0FBSztBQUN0RTtBQUNBLFNBQVNDLE1BQU1OLENBQUMsRUFBRSxHQUFHTyxPQUFPO0lBQ3hCLElBQUksQ0FBQ04sUUFBUUQsSUFDVCxNQUFNLElBQUlGLE1BQU07SUFDcEIsSUFBSVMsUUFBUUMsTUFBTSxHQUFHLEtBQUssQ0FBQ0QsUUFBUUUsUUFBUSxDQUFDVCxFQUFFUSxNQUFNLEdBQ2hELE1BQU0sSUFBSVYsTUFBTSxDQUFDLDhCQUE4QixFQUFFUyxRQUFRLGdCQUFnQixFQUFFUCxFQUFFUSxNQUFNLENBQUMsQ0FBQztBQUM3RjtBQUNBLFNBQVNFLEtBQUtDLENBQUM7SUFDWCxJQUFJLE9BQU9BLE1BQU0sY0FBYyxPQUFPQSxFQUFFQyxNQUFNLEtBQUssWUFDL0MsTUFBTSxJQUFJZCxNQUFNO0lBQ3BCSixPQUFPaUIsRUFBRUUsU0FBUztJQUNsQm5CLE9BQU9pQixFQUFFRyxRQUFRO0FBQ3JCO0FBQ0EsU0FBU0MsT0FBT0MsUUFBUSxFQUFFQyxnQkFBZ0IsSUFBSTtJQUMxQyxJQUFJRCxTQUFTRSxTQUFTLEVBQ2xCLE1BQU0sSUFBSXBCLE1BQU07SUFDcEIsSUFBSW1CLGlCQUFpQkQsU0FBU0csUUFBUSxFQUNsQyxNQUFNLElBQUlyQixNQUFNO0FBQ3hCO0FBQ0EsU0FBU3NCLE9BQU9DLEdBQUcsRUFBRUwsUUFBUTtJQUN6QlYsTUFBTWU7SUFDTixNQUFNQyxNQUFNTixTQUFTSCxTQUFTO0lBQzlCLElBQUlRLElBQUliLE1BQU0sR0FBR2MsS0FBSztRQUNsQixNQUFNLElBQUl4QixNQUFNLENBQUMsc0RBQXNELEVBQUV3QixJQUFJLENBQUM7SUFDbEY7QUFDSjtBQUNxRDtBQUNyRCxNQUFNQyxTQUFTO0lBQUU3QjtJQUFRSztJQUFNTztJQUFPSTtJQUFNSztJQUFRSztBQUFPO0FBQzNELGlFQUFlRyxNQUFNQSxFQUFDLENBQ3RCLG1DQUFtQyIsInNvdXJjZXMiOlsid2VicGFjazovL2ZsdXNoLW5vdGVzLy4vbm9kZV9tb2R1bGVzL0Bub2JsZS9oYXNoZXMvZXNtL19hc3NlcnQuanM/MjcwZSJdLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBudW1iZXIobikge1xuICAgIGlmICghTnVtYm
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/_md.js":
|
|||
|
|
/*!***********************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/_md.js ***!
|
|||
|
|
\***********************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Chi: () => (/* binding */ Chi),\n/* harmony export */ HashMD: () => (/* binding */ HashMD),\n/* harmony export */ Maj: () => (/* binding */ Maj)\n/* harmony export */ });\n/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_assert.js */ \"(ssr)/./node_modules/@noble/hashes/esm/_assert.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n\n\n// Polyfill for Safari 14\nfunction setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === \"function\") return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number(value >> _32n & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n// Choice: a ? b : c\nconst Chi = (a, b, c)=>a & b ^ ~a & c;\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c)=>a & b ^ a & c ^ b & c;\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */ class HashMD extends _utils_js__WEBPACK_IMPORTED_MODULE_0__.Hash {\n constructor(blockLen, outputLen, padOffset, isLE){\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.buffer = new Uint8Array(blockLen);\n this.view = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.createView)(this.buffer);\n }\n update(data) {\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__.exists)(this);\n const { view, buffer, blockLen } = this;\n data = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toBytes)(data);\n const len = data.length;\n for(let pos = 0; pos < len;){\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.createView)(data);\n for(; blockLen <= len - pos; pos += blockLen)this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__.exists)(this);\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__.output)(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 128;\n this.buffer.subarray(pos).fill(0);\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for(let i = pos; i < blockLen; i++)buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to w
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/_u64.js":
|
|||
|
|
/*!************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/_u64.js ***!
|
|||
|
|
\************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ add: () => (/* binding */ add),\n/* harmony export */ add3H: () => (/* binding */ add3H),\n/* harmony export */ add3L: () => (/* binding */ add3L),\n/* harmony export */ add4H: () => (/* binding */ add4H),\n/* harmony export */ add4L: () => (/* binding */ add4L),\n/* harmony export */ add5H: () => (/* binding */ add5H),\n/* harmony export */ add5L: () => (/* binding */ add5L),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ fromBig: () => (/* binding */ fromBig),\n/* harmony export */ rotlBH: () => (/* binding */ rotlBH),\n/* harmony export */ rotlBL: () => (/* binding */ rotlBL),\n/* harmony export */ rotlSH: () => (/* binding */ rotlSH),\n/* harmony export */ rotlSL: () => (/* binding */ rotlSL),\n/* harmony export */ rotr32H: () => (/* binding */ rotr32H),\n/* harmony export */ rotr32L: () => (/* binding */ rotr32L),\n/* harmony export */ rotrBH: () => (/* binding */ rotrBH),\n/* harmony export */ rotrBL: () => (/* binding */ rotrBL),\n/* harmony export */ rotrSH: () => (/* binding */ rotrSH),\n/* harmony export */ rotrSL: () => (/* binding */ rotrSL),\n/* harmony export */ shrSH: () => (/* binding */ shrSH),\n/* harmony export */ shrSL: () => (/* binding */ shrSL),\n/* harmony export */ split: () => (/* binding */ split),\n/* harmony export */ toBig: () => (/* binding */ toBig)\n/* harmony export */ });\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le) return {\n h: Number(n & U32_MASK64),\n l: Number(n >> _32n & U32_MASK64)\n };\n return {\n h: Number(n >> _32n & U32_MASK64) | 0,\n l: Number(n & U32_MASK64) | 0\n };\n}\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for(let i = 0; i < lst.length; i++){\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [\n h,\n l\n ];\n }\n return [\n Ah,\n Al\n ];\n}\nconst toBig = (h, l)=>BigInt(h >>> 0) << _32n | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s)=>h >>> s;\nconst shrSL = (h, l, s)=>h << 32 - s | l >>> s;\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s)=>h >>> s | l << 32 - s;\nconst rotrSL = (h, l, s)=>h << 32 - s | l >>> s;\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s)=>h << 64 - s | l >>> s - 32;\nconst rotrBL = (h, l, s)=>h >>> s - 32 | l << 64 - s;\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l)=>l;\nconst rotr32L = (h, _l)=>h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s)=>h << s | l >>> 32 - s;\nconst rotlSL = (h, l, s)=>l << s | h >>> 32 - s;\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s)=>l << s - 32 | h >>> 64 - s;\nconst rotlBL = (h, l, s)=>h << s - 32 | l >>> 64 - s;\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return {\n h: Ah + Bh + (l / 2 ** 32 | 0) | 0,\n l: l | 0\n };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl)=>(Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch)=>Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;\nconst add4L = (Al, Bl, Cl, Dl)=>(Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh)=>Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El)=>(Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh)=>Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) |
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/cryptoNode.js":
|
|||
|
|
/*!******************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/cryptoNode.js ***!
|
|||
|
|
\******************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("var node_crypto__WEBPACK_IMPORTED_MODULE_0___namespace_cache;\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ crypto: () => (/* binding */ crypto)\n/* harmony export */ });\n/* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:crypto */ \"node:crypto\");\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// See utils.ts for details.\n// The file will throw on node.js 14 and earlier.\n// @ts-ignore\n\nconst crypto = /*#__PURE__*/ (node_crypto__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (node_crypto__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(node_crypto__WEBPACK_IMPORTED_MODULE_0__, 2))) && typeof /*#__PURE__*/ (node_crypto__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (node_crypto__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(node_crypto__WEBPACK_IMPORTED_MODULE_0__, 2))) === \"object\" && \"webcrypto\" in /*#__PURE__*/ (node_crypto__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (node_crypto__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(node_crypto__WEBPACK_IMPORTED_MODULE_0__, 2))) ? node_crypto__WEBPACK_IMPORTED_MODULE_0__.webcrypto : undefined; //# sourceMappingURL=cryptoNode.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvQG5vYmxlL2hhc2hlcy9lc20vY3J5cHRvTm9kZS5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxvRkFBb0Y7QUFDcEYsNEJBQTRCO0FBQzVCLGlEQUFpRDtBQUNqRCxhQUFhO0FBQ3FCO0FBQzNCLE1BQU1DLFNBQVNELDJNQUFFQSxJQUFJLE9BQU9BLDJNQUFFQSxLQUFLLFlBQVksME5BQWlCQSxHQUFHQSxrREFBWSxHQUFHRyxVQUFVLENBQ25HLHNDQUFzQyIsInNvdXJjZXMiOlsid2VicGFjazovL2ZsdXNoLW5vdGVzLy4vbm9kZV9tb2R1bGVzL0Bub2JsZS9oYXNoZXMvZXNtL2NyeXB0b05vZGUuanM/ZGE1ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBXZSB1c2UgV2ViQ3J5cHRvIGFrYSBnbG9iYWxUaGlzLmNyeXB0bywgd2hpY2ggZXhpc3RzIGluIGJyb3dzZXJzIGFuZCBub2RlLmpzIDE2Ky5cbi8vIFNlZSB1dGlscy50cyBmb3IgZGV0YWlscy5cbi8vIFRoZSBmaWxlIHdpbGwgdGhyb3cgb24gbm9kZS5qcyAxNCBhbmQgZWFybGllci5cbi8vIEB0cy1pZ25vcmVcbmltcG9ydCAqIGFzIG5jIGZyb20gJ25vZGU6Y3J5cHRvJztcbmV4cG9ydCBjb25zdCBjcnlwdG8gPSBuYyAmJiB0eXBlb2YgbmMgPT09ICdvYmplY3QnICYmICd3ZWJjcnlwdG8nIGluIG5jID8gbmMud2ViY3J5cHRvIDogdW5kZWZpbmVkO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y3J5cHRvTm9kZS5qcy5tYXAiXSwibmFtZXMiOlsibmMiLCJjcnlwdG8iLCJ3ZWJjcnlwdG8iLCJ1bmRlZmluZWQiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/@noble/hashes/esm/cryptoNode.js\n");
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/hkdf.js":
|
|||
|
|
/*!************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/hkdf.js ***!
|
|||
|
|
\************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ expand: () => (/* binding */ expand),\n/* harmony export */ extract: () => (/* binding */ extract),\n/* harmony export */ hkdf: () => (/* binding */ hkdf)\n/* harmony export */ });\n/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assert.js */ \"(ssr)/./node_modules/@noble/hashes/esm/_assert.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n/* harmony import */ var _hmac_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hmac.js */ \"(ssr)/./node_modules/@noble/hashes/esm/hmac.js\");\n\n\n\n// HKDF (RFC 5869)\n// https://soatok.blog/2021/11/17/understanding-hkdf/\n/**\n * HKDF-Extract(IKM, salt) -> PRK\n * Arguments position differs from spec (IKM is first one, since it is not optional)\n * @param hash\n * @param ikm\n * @param salt\n * @returns\n */ function extract(hash, ikm, salt) {\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__.hash)(hash);\n // NOTE: some libraries treat zero-length array as 'not provided';\n // we don't, since we have undefined as 'not provided'\n // https://github.com/RustCrypto/KDFs/issues/15\n if (salt === undefined) salt = new Uint8Array(hash.outputLen); // if not provided, it is set to a string of HashLen zeros\n return (0,_hmac_js__WEBPACK_IMPORTED_MODULE_1__.hmac)(hash, (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.toBytes)(salt), (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.toBytes)(ikm));\n}\n// HKDF-Expand(PRK, info, L) -> OKM\nconst HKDF_COUNTER = /* @__PURE__ */ new Uint8Array([\n 0\n]);\nconst EMPTY_BUFFER = /* @__PURE__ */ new Uint8Array();\n/**\n * HKDF-expand from the spec.\n * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step)\n * @param info - optional context and application specific information (can be a zero-length string)\n * @param length - length of output keying material in octets\n */ function expand(hash, prk, info, length = 32) {\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__.hash)(hash);\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__.number)(length);\n if (length > 255 * hash.outputLen) throw new Error(\"Length should be <= 255*HashLen\");\n const blocks = Math.ceil(length / hash.outputLen);\n if (info === undefined) info = EMPTY_BUFFER;\n // first L(ength) octets of T\n const okm = new Uint8Array(blocks * hash.outputLen);\n // Re-use HMAC instance between blocks\n const HMAC = _hmac_js__WEBPACK_IMPORTED_MODULE_1__.hmac.create(hash, prk);\n const HMACTmp = HMAC._cloneInto();\n const T = new Uint8Array(HMAC.outputLen);\n for(let counter = 0; counter < blocks; counter++){\n HKDF_COUNTER[0] = counter + 1;\n // T(0) = empty string (zero length)\n // T(N) = HMAC-Hash(PRK, T(N-1) | info | N)\n HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T).update(info).update(HKDF_COUNTER).digestInto(T);\n okm.set(T, hash.outputLen * counter);\n HMAC._cloneInto(HMACTmp);\n }\n HMAC.destroy();\n HMACTmp.destroy();\n T.fill(0);\n HKDF_COUNTER.fill(0);\n return okm.slice(0, length);\n}\n/**\n * HKDF (RFC 5869): extract + expand in one step.\n * @param hash - hash function that would be used (e.g. sha256)\n * @param ikm - input keying material, the initial key\n * @param salt - optional salt value (a non-secret random value)\n * @param info - optional context and application specific information\n * @param length - length of output keying material in octets\n */ const hkdf = (hash, ikm, salt, info, length)=>expand(hash, extract(hash, ikm, salt), info, length); //# sourceMappingURL=hkdf.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvQG5vYmxlL2hhc2hlcy9lc20vaGtkZi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBMEU7QUFDckM7QUFDSjtBQUNqQyxrQ
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/hmac.js":
|
|||
|
|
/*!************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/hmac.js ***!
|
|||
|
|
\************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ HMAC: () => (/* binding */ HMAC),\n/* harmony export */ hmac: () => (/* binding */ hmac)\n/* harmony export */ });\n/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_assert.js */ \"(ssr)/./node_modules/@noble/hashes/esm/_assert.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n\n\n// HMAC (RFC 2104)\nclass HMAC extends _utils_js__WEBPACK_IMPORTED_MODULE_0__.Hash {\n constructor(hash, _key){\n super();\n this.finished = false;\n this.destroyed = false;\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__.hash)(hash);\n const key = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toBytes)(_key);\n this.iHash = hash.create();\n if (typeof this.iHash.update !== \"function\") throw new Error(\"Expected instance of class which extends utils.Hash\");\n this.blockLen = this.iHash.blockLen;\n this.outputLen = this.iHash.outputLen;\n const blockLen = this.blockLen;\n const pad = new Uint8Array(blockLen);\n // blockLen can be bigger than outputLen\n pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n for(let i = 0; i < pad.length; i++)pad[i] ^= 0x36;\n this.iHash.update(pad);\n // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n this.oHash = hash.create();\n // Undo internal XOR && apply outer XOR\n for(let i = 0; i < pad.length; i++)pad[i] ^= 0x36 ^ 0x5c;\n this.oHash.update(pad);\n pad.fill(0);\n }\n update(buf) {\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__.exists)(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__.exists)(this);\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_1__.bytes)(out, this.outputLen);\n this.finished = true;\n this.iHash.digestInto(out);\n this.oHash.update(out);\n this.oHash.digestInto(out);\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.oHash.outputLen);\n this.digestInto(out);\n return out;\n }\n _cloneInto(to) {\n // Create new instance without calling constructor since key already in state and we don't know it.\n to || (to = Object.create(Object.getPrototypeOf(this), {}));\n const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n */ const hmac = (hash, key, message)=>new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key)=>new HMAC(hash, key); //# sourceMappingURL=hmac.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvQG5vYmxlL2hhc2hlcy9lc20vaG1hYy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQWdHO0FBQ3JEO0FBQzNDLGtCQUFrQjtBQUNYLE1BQU1RLGFBQWFGLDJDQUFJQTtJQUMxQkcsWUFBWVQsSUFBSSxFQUFFVSxJQUFJLENBQUU7UUFDcEIsS0FBSztRQUNMLElBQUksQ0FBQ0MsUUFBUSxHQUFHO1FBQ2hCLElBQUksQ0FBQ0MsU0FBUyxHQUFHO1FBQ2pCWCxnREFBVUEsQ0FBQ0Q7UUFDWCxNQUFNYSxNQUFNTixrREFBT0EsQ0FBQ0c7UUFDcEIsSUFBSSxDQUFDSSxLQUFLLEdBQUdkLEtBQUtlLE1BQU07UUFDeEIsSUFBSSxPQUFPLElBQUksQ0FBQ0QsS0FBSyxDQUFDRSxNQUFNLEtBQUssWUFDN0IsTUFBTSxJQUFJQ
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/pbkdf2.js":
|
|||
|
|
/*!**************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/pbkdf2.js ***!
|
|||
|
|
\**************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ pbkdf2: () => (/* binding */ pbkdf2),\n/* harmony export */ pbkdf2Async: () => (/* binding */ pbkdf2Async)\n/* harmony export */ });\n/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assert.js */ \"(ssr)/./node_modules/@noble/hashes/esm/_assert.js\");\n/* harmony import */ var _hmac_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hmac.js */ \"(ssr)/./node_modules/@noble/hashes/esm/hmac.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n\n\n\n// Common prologue and epilogue for sync/async functions\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__.hash)(hash);\n const opts = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.checkOpts)({\n dkLen: 32,\n asyncTick: 10\n }, _opts);\n const { c, dkLen, asyncTick } = opts;\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__.number)(c);\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__.number)(dkLen);\n (0,_assert_js__WEBPACK_IMPORTED_MODULE_0__.number)(asyncTick);\n if (c < 1) throw new Error(\"PBKDF2: iterations (c) should be >= 1\");\n const password = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.toBytes)(_password);\n const salt = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.toBytes)(_salt);\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n const PRF = _hmac_js__WEBPACK_IMPORTED_MODULE_2__.hmac.create(hash, password);\n const PRFSalt = PRF._cloneInto().update(salt);\n return {\n c,\n dkLen,\n asyncTick,\n DK,\n PRF,\n PRFSalt\n };\n}\nfunction pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {\n PRF.destroy();\n PRFSalt.destroy();\n if (prfW) prfW.destroy();\n u.fill(0);\n return DK;\n}\n/**\n * PBKDF2-HMAC: RFC 2898 key derivation function\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated\n * @param salt - cryptographic salt\n * @param opts - {c, dkLen} where c is work factor and dkLen is output message size\n */ function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.createView)(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for(let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen){\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n for(let ui = 1; ui < c; ui++){\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for(let i = 0; i < Ti.length; i++)Ti[i] ^= u[i];\n }\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\nasync function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.createView)(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for(let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen){\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Passwor
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/sha256.js":
|
|||
|
|
/*!**************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/sha256.js ***!
|
|||
|
|
\**************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ sha224: () => (/* binding */ sha224),\n/* harmony export */ sha256: () => (/* binding */ sha256)\n/* harmony export */ });\n/* harmony import */ var _md_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_md.js */ \"(ssr)/./node_modules/@noble/hashes/esm/_md.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n\n\n// SHA2-256 need to try 2^128 hashes to execute birthday attack.\n// BTC network is doing 2^67 hashes/sec as per early 2023.\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ new Uint32Array([\n 0x428a2f98,\n 0x71374491,\n 0xb5c0fbcf,\n 0xe9b5dba5,\n 0x3956c25b,\n 0x59f111f1,\n 0x923f82a4,\n 0xab1c5ed5,\n 0xd807aa98,\n 0x12835b01,\n 0x243185be,\n 0x550c7dc3,\n 0x72be5d74,\n 0x80deb1fe,\n 0x9bdc06a7,\n 0xc19bf174,\n 0xe49b69c1,\n 0xefbe4786,\n 0x0fc19dc6,\n 0x240ca1cc,\n 0x2de92c6f,\n 0x4a7484aa,\n 0x5cb0a9dc,\n 0x76f988da,\n 0x983e5152,\n 0xa831c66d,\n 0xb00327c8,\n 0xbf597fc7,\n 0xc6e00bf3,\n 0xd5a79147,\n 0x06ca6351,\n 0x14292967,\n 0x27b70a85,\n 0x2e1b2138,\n 0x4d2c6dfc,\n 0x53380d13,\n 0x650a7354,\n 0x766a0abb,\n 0x81c2c92e,\n 0x92722c85,\n 0xa2bfe8a1,\n 0xa81a664b,\n 0xc24b8b70,\n 0xc76c51a3,\n 0xd192e819,\n 0xd6990624,\n 0xf40e3585,\n 0x106aa070,\n 0x19a4c116,\n 0x1e376c08,\n 0x2748774c,\n 0x34b0bcb5,\n 0x391c0cb3,\n 0x4ed8aa4a,\n 0x5b9cca4f,\n 0x682e6ff3,\n 0x748f82ee,\n 0x78a5636f,\n 0x84c87814,\n 0x8cc70208,\n 0x90befffa,\n 0xa4506ceb,\n 0xbef9a3f7,\n 0xc67178f2\n]);\n// Initial state:\n// first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19\n// prettier-ignore\nconst SHA256_IV = /* @__PURE__ */ new Uint32Array([\n 0x6a09e667,\n 0xbb67ae85,\n 0x3c6ef372,\n 0xa54ff53a,\n 0x510e527f,\n 0x9b05688c,\n 0x1f83d9ab,\n 0x5be0cd19\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nclass SHA256 extends _md_js__WEBPACK_IMPORTED_MODULE_0__.HashMD {\n constructor(){\n super(64, 32, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = SHA256_IV[0] | 0;\n this.B = SHA256_IV[1] | 0;\n this.C = SHA256_IV[2] | 0;\n this.D = SHA256_IV[3] | 0;\n this.E = SHA256_IV[4] | 0;\n this.F = SHA256_IV[5] | 0;\n this.G = SHA256_IV[6] | 0;\n this.H = SHA256_IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [\n A,\n B,\n C,\n D,\n E,\n F,\n G,\n H\n ];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for(let i = 0; i < 16; i++, offset += 4)SHA256_W[i] = view.getUint32(offset, false);\n for(let i = 16; i < 64; i++){\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.rotr)(W15, 7) ^ (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.rotr)(W15, 18) ^ W15 >>> 3;\n const s1 = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/sha512.js":
|
|||
|
|
/*!**************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/sha512.js ***!
|
|||
|
|
\**************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SHA512: () => (/* binding */ SHA512),\n/* harmony export */ sha384: () => (/* binding */ sha384),\n/* harmony export */ sha512: () => (/* binding */ sha512),\n/* harmony export */ sha512_224: () => (/* binding */ sha512_224),\n/* harmony export */ sha512_256: () => (/* binding */ sha512_256)\n/* harmony export */ });\n/* harmony import */ var _md_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_md.js */ \"(ssr)/./node_modules/@noble/hashes/esm/_md.js\");\n/* harmony import */ var _u64_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_u64.js */ \"(ssr)/./node_modules/@noble/hashes/esm/_u64.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"(ssr)/./node_modules/@noble/hashes/esm/utils.js\");\n\n\n\n// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):\n// prettier-ignore\nconst [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (()=>_u64_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].split([\n \"0x428a2f98d728ae22\",\n \"0x7137449123ef65cd\",\n \"0xb5c0fbcfec4d3b2f\",\n \"0xe9b5dba58189dbbc\",\n \"0x3956c25bf348b538\",\n \"0x59f111f1b605d019\",\n \"0x923f82a4af194f9b\",\n \"0xab1c5ed5da6d8118\",\n \"0xd807aa98a3030242\",\n \"0x12835b0145706fbe\",\n \"0x243185be4ee4b28c\",\n \"0x550c7dc3d5ffb4e2\",\n \"0x72be5d74f27b896f\",\n \"0x80deb1fe3b1696b1\",\n \"0x9bdc06a725c71235\",\n \"0xc19bf174cf692694\",\n \"0xe49b69c19ef14ad2\",\n \"0xefbe4786384f25e3\",\n \"0x0fc19dc68b8cd5b5\",\n \"0x240ca1cc77ac9c65\",\n \"0x2de92c6f592b0275\",\n \"0x4a7484aa6ea6e483\",\n \"0x5cb0a9dcbd41fbd4\",\n \"0x76f988da831153b5\",\n \"0x983e5152ee66dfab\",\n \"0xa831c66d2db43210\",\n \"0xb00327c898fb213f\",\n \"0xbf597fc7beef0ee4\",\n \"0xc6e00bf33da88fc2\",\n \"0xd5a79147930aa725\",\n \"0x06ca6351e003826f\",\n \"0x142929670a0e6e70\",\n \"0x27b70a8546d22ffc\",\n \"0x2e1b21385c26c926\",\n \"0x4d2c6dfc5ac42aed\",\n \"0x53380d139d95b3df\",\n \"0x650a73548baf63de\",\n \"0x766a0abb3c77b2a8\",\n \"0x81c2c92e47edaee6\",\n \"0x92722c851482353b\",\n \"0xa2bfe8a14cf10364\",\n \"0xa81a664bbc423001\",\n \"0xc24b8b70d0f89791\",\n \"0xc76c51a30654be30\",\n \"0xd192e819d6ef5218\",\n \"0xd69906245565a910\",\n \"0xf40e35855771202a\",\n \"0x106aa07032bbd1b8\",\n \"0x19a4c116b8d2d0c8\",\n \"0x1e376c085141ab53\",\n \"0x2748774cdf8eeb99\",\n \"0x34b0bcb5e19b48a8\",\n \"0x391c0cb3c5c95a63\",\n \"0x4ed8aa4ae3418acb\",\n \"0x5b9cca4f7763e373\",\n \"0x682e6ff3d6b2b8a3\",\n \"0x748f82ee5defb2fc\",\n \"0x78a5636f43172f60\",\n \"0x84c87814a1f0ab72\",\n \"0x8cc702081a6439ec\",\n \"0x90befffa23631e28\",\n \"0xa4506cebde82bde9\",\n \"0xbef9a3f7b2c67915\",\n \"0xc67178f2e372532b\",\n \"0xca273eceea26619c\",\n \"0xd186b8c721c0c207\",\n \"0xeada7dd6cde0eb1e\",\n \"0xf57d4f7fee6ed178\",\n \"0x06f067aa72176fba\",\n \"0x0a637dc5a2c898a6\",\n \"0x113f9804bef90dae\",\n \"0x1b710b35131c471b\",\n \"0x28db77f523047d84\",\n \"0x32caab7b40c72493\",\n \"0x3c9ebe0a15c9bebc\",\n \"0x431d67c49c100d4c\",\n \"0x4cc5d4becb3e42b6\",\n \"0x597f299cfc657e2a\",\n \"0x5fcb6fab3ad6faec\",\n \"0x6c44198c4a475817\"\n ].map((n)=>BigInt(n))))();\n// Temporary buffer, not used to store anything between runs\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nclass SHA512 extends _md_js__WEBPACK_IMPORTED_MODULE_1__.HashMD {\n
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/hashes/esm/utils.js":
|
|||
|
|
/*!*************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/hashes/esm/utils.js ***!
|
|||
|
|
\*************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Hash: () => (/* binding */ Hash),\n/* harmony export */ asyncLoop: () => (/* binding */ asyncLoop),\n/* harmony export */ byteSwap: () => (/* binding */ byteSwap),\n/* harmony export */ byteSwap32: () => (/* binding */ byteSwap32),\n/* harmony export */ byteSwapIfBE: () => (/* binding */ byteSwapIfBE),\n/* harmony export */ bytesToHex: () => (/* binding */ bytesToHex),\n/* harmony export */ checkOpts: () => (/* binding */ checkOpts),\n/* harmony export */ concatBytes: () => (/* binding */ concatBytes),\n/* harmony export */ createView: () => (/* binding */ createView),\n/* harmony export */ hexToBytes: () => (/* binding */ hexToBytes),\n/* harmony export */ isBytes: () => (/* binding */ isBytes),\n/* harmony export */ isLE: () => (/* binding */ isLE),\n/* harmony export */ nextTick: () => (/* binding */ nextTick),\n/* harmony export */ randomBytes: () => (/* binding */ randomBytes),\n/* harmony export */ rotl: () => (/* binding */ rotl),\n/* harmony export */ rotr: () => (/* binding */ rotr),\n/* harmony export */ toBytes: () => (/* binding */ toBytes),\n/* harmony export */ u32: () => (/* binding */ u32),\n/* harmony export */ u8: () => (/* binding */ u8),\n/* harmony export */ utf8ToBytes: () => (/* binding */ utf8ToBytes),\n/* harmony export */ wrapConstructor: () => (/* binding */ wrapConstructor),\n/* harmony export */ wrapConstructorWithOpts: () => (/* binding */ wrapConstructorWithOpts),\n/* harmony export */ wrapXOFConstructorWithOpts: () => (/* binding */ wrapXOFConstructorWithOpts)\n/* harmony export */ });\n/* harmony import */ var _noble_hashes_crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @noble/hashes/crypto */ \"(ssr)/./node_modules/@noble/hashes/esm/cryptoNode.js\");\n/* harmony import */ var _assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assert.js */ \"(ssr)/./node_modules/@noble/hashes/esm/_assert.js\");\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\n\n\n// export { isBytes } from './_assert.js';\n// We can't reuse isBytes from _assert, because somehow this causes huge perf issues\nfunction isBytes(a) {\n return a instanceof Uint8Array || a != null && typeof a === \"object\" && a.constructor.name === \"Uint8Array\";\n}\n// Cast array to different type\nconst u8 = (arr)=>new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nconst u32 = (arr)=>new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nconst createView = (arr)=>new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nconst rotr = (word, shift)=>word << 32 - shift | word >>> shift;\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift)=>word << shift | word >>> 32 - shift >>> 0;\nconst isLE = new Uint8Array(new Uint32Array([\n 0x11223344\n]).buffer)[0] === 0x44;\n// The byte swap operation for uint32\nconst byteSwap = (word)=>word << 24 & 0xff000000 | word << 8 & 0xff0000 | word >>> 8 & 0xff00 | word >>> 24 & 0xff;\n// Conditionally byte swap if on a big-endian platform\nconst byteSwapIfBE = isLE ? (n)=>n : (n)=>byteSwap(n);\n// In place byte swap for Uint32Array\nfunction byteSwap32(arr) {\n for(let i = 0; i < arr.length; i++){\n arr[i] = byteSwap(arr[i]);\n }\n}\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({\n length: 256\n}, (_, i)=>i.toString(1
|
|||
|
|
|
|||
|
|
/***/ }),
|
|||
|
|
|
|||
|
|
/***/ "(ssr)/./node_modules/@noble/secp256k1/lib/esm/index.js":
|
|||
|
|
/*!********************************************************!*\
|
|||
|
|
!*** ./node_modules/@noble/secp256k1/lib/esm/index.js ***!
|
|||
|
|
\********************************************************/
|
|||
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|||
|
|
|
|||
|
|
eval("var crypto__WEBPACK_IMPORTED_MODULE_0___namespace_cache;\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CURVE: () => (/* binding */ CURVE),\n/* harmony export */ Point: () => (/* binding */ Point),\n/* harmony export */ Signature: () => (/* binding */ Signature),\n/* harmony export */ getPublicKey: () => (/* binding */ getPublicKey),\n/* harmony export */ getSharedSecret: () => (/* binding */ getSharedSecret),\n/* harmony export */ recoverPublicKey: () => (/* binding */ recoverPublicKey),\n/* harmony export */ schnorr: () => (/* binding */ schnorr),\n/* harmony export */ sign: () => (/* binding */ sign),\n/* harmony export */ signSync: () => (/* binding */ signSync),\n/* harmony export */ utils: () => (/* binding */ utils),\n/* harmony export */ verify: () => (/* binding */ verify)\n/* harmony export */ });\n/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto */ \"crypto\");\n/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ \nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _3n = BigInt(3);\nconst _8n = BigInt(8);\nconst CURVE = Object.freeze({\n a: _0n,\n b: BigInt(7),\n P: BigInt(\"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f\"),\n n: BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\"),\n h: _1n,\n Gx: BigInt(\"55066263022277343669578718895168534326250603453777594175500187360389116729240\"),\n Gy: BigInt(\"32670510020758816978083085130507043184471273380659243275938904335757337482424\"),\n beta: BigInt(\"0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\")\n});\nconst divNearest = (a, b)=>(a + b / _2n) / b;\nconst endo = {\n beta: BigInt(\"0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\"),\n splitScalar (k) {\n const { n } = CURVE;\n const a1 = BigInt(\"0x3086d221a7d46bcde86c90e49284eb15\");\n const b1 = -_1n * BigInt(\"0xe4437ed6010e88286f547fa90abfe4c3\");\n const a2 = BigInt(\"0x114ca50f7a8e2f3f657c1108d9d44cfd8\");\n const b2 = a1;\n const POW_2_128 = BigInt(\"0x100000000000000000000000000000000\");\n const c1 = divNearest(b2 * k, n);\n const c2 = divNearest(-b1 * k, n);\n let k1 = mod(k - c1 * a1 - c2 * a2, n);\n let k2 = mod(-c1 * b1 - c2 * b2, n);\n const k1neg = k1 > POW_2_128;\n const k2neg = k2 > POW_2_128;\n if (k1neg) k1 = n - k1;\n if (k2neg) k2 = n - k2;\n if (k1 > POW_2_128 || k2 > POW_2_128) {\n throw new Error(\"splitScalarEndo: Endomorphism failed, k=\" + k);\n }\n return {\n k1neg,\n k1,\n k2neg,\n k2\n };\n }\n};\nconst fieldLen = 32;\nconst groupLen = 32;\nconst hashLen = 32;\nconst compressedLen = fieldLen + 1;\nconst uncompressedLen = 2 * fieldLen + 1;\n\nfunction weierstrass(x) {\n const { a, b } = CURVE;\n const x2 = mod(x * x);\n const x3 = mod(x2 * x);\n return mod(x3 + a * x + b);\n}\nconst USE_ENDOMORPHISM = CURVE.a === _0n;\nclass ShaError extends Error {\n constructor(message){\n super(message);\n }\n}\nfunction assertJacPoint(other) {\n if (!(other instanceof JacobianPoint)) throw new TypeError(\"JacobianPoint expected\");\n}\nclass JacobianPoint {\n constructor(x, y, z){\n this.x = x;\n this.y = y;\n this.z = z;\n }\n static fromAffine(p) {\n if (!(p instanceof Point)) {\n throw new TypeError(\"JacobianPoint#fromAffine: expected Point\");\n }\n if (p.equals(Point.ZERO)) return JacobianPoint.ZERO;\n return new JacobianPoint(p.x, p.y, _1n);\n }\n static toAffineBatch(points) {\n const toInv = invertBatch(points.map((p)=>p.z));\n return points.map((p, i)=>p.toAffine(toInv[i]));\n }\n static normalizeZ(points) {\n return JacobianPoint.toAffineBatch(points).map(J
|
|||
|
|
|
|||
|
|
/***/ })
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
;
|