@dxos/vendor-hypercore 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
11
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
12
|
key = keys[i];
|
|
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
value: mod,
|
|
23
23
|
enumerable: true
|
|
24
24
|
}) : target, mod));
|
|
25
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
25
|
+
var __require$1 = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
26
26
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
27
27
|
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
28
28
|
});
|
|
@@ -63,8 +63,8 @@ var require_randombytes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
63
63
|
throw new Error("No secure random number generator available");
|
|
64
64
|
}
|
|
65
65
|
if (crypto && crypto.getRandomValues) return browserBytes;
|
|
66
|
-
if (__require != null) {
|
|
67
|
-
crypto = __require("@dxos/node-std/crypto");
|
|
66
|
+
if (__require$1 != null) {
|
|
67
|
+
crypto = __require$1("@dxos/node-std/crypto");
|
|
68
68
|
if (crypto && crypto.randomBytes) return nodeBytes;
|
|
69
69
|
}
|
|
70
70
|
return noImpl;
|
|
@@ -92,7 +92,7 @@ var require_memory = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
92
92
|
function loadSink() {
|
|
93
93
|
if (sink) return sink;
|
|
94
94
|
var MessageChannel = globalThis.MessageChannel;
|
|
95
|
-
if (MessageChannel == null) ({MessageChannel} = __require("node:worker_threads"));
|
|
95
|
+
if (MessageChannel == null) ({MessageChannel} = __require$1("node:worker_threads"));
|
|
96
96
|
sink = new MessageChannel();
|
|
97
97
|
return sink;
|
|
98
98
|
}
|
|
@@ -2075,14 +2075,14 @@ var require_ed25519 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2075
2075
|
}
|
|
2076
2076
|
}
|
|
2077
2077
|
function unpack25519(o, n) {
|
|
2078
|
-
var i;
|
|
2079
|
-
for (
|
|
2078
|
+
var i = 0;
|
|
2079
|
+
for (; i < 16; i++) o[i] = n[2 * i] + (n[2 * i + 1] << 8);
|
|
2080
2080
|
o[15] &= 32767;
|
|
2081
2081
|
}
|
|
2082
2082
|
function inv25519(o, i) {
|
|
2083
2083
|
var c = gf();
|
|
2084
|
-
var a;
|
|
2085
|
-
for (
|
|
2084
|
+
var a = 0;
|
|
2085
|
+
for (; a < 16; a++) c[a] = i[a];
|
|
2086
2086
|
for (a = 253; a >= 0; a--) {
|
|
2087
2087
|
S(c, c);
|
|
2088
2088
|
if (a !== 2 && a !== 4) M(c, c, i);
|
|
@@ -4774,8 +4774,8 @@ var require_crypto_secretstream = /* @__PURE__ */ __commonJSMin(((exports, modul
|
|
|
4774
4774
|
const k = state.subarray(KEY_OFFSET, NONCE_OFFSET);
|
|
4775
4775
|
const nonce = state.subarray(NONCE_OFFSET, PAD_OFFSET);
|
|
4776
4776
|
const new_key_and_inonce = new Uint8Array(crypto_stream_chacha20_ietf_KEYBYTES + crypto_secretstream_xchacha20poly1305_INONCEBYTES);
|
|
4777
|
-
let i;
|
|
4778
|
-
for (
|
|
4777
|
+
let i = 0;
|
|
4778
|
+
for (; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) new_key_and_inonce[i] = k[i];
|
|
4779
4779
|
for (i = 0; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i] = nonce[crypto_secretstream_xchacha20poly1305_COUNTERBYTES + i];
|
|
4780
4780
|
crypto_stream_chacha20_ietf_xor(new_key_and_inonce, new_key_and_inonce, nonce, k);
|
|
4781
4781
|
for (i = 0; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) k[i] = new_key_and_inonce[i];
|
|
@@ -5132,8 +5132,8 @@ var require_crypto_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5132
5132
|
}
|
|
5133
5133
|
function pow2523(o, i) {
|
|
5134
5134
|
var c = gf();
|
|
5135
|
-
var a;
|
|
5136
|
-
for (
|
|
5135
|
+
var a = 0;
|
|
5136
|
+
for (; a < 16; a++) c[a] = i[a];
|
|
5137
5137
|
for (a = 250; a >= 0; a--) {
|
|
5138
5138
|
S(c, c);
|
|
5139
5139
|
if (a !== 1) M(c, c, i);
|
|
@@ -5162,8 +5162,8 @@ var require_crypto_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5162
5162
|
M(p[3], e, h);
|
|
5163
5163
|
}
|
|
5164
5164
|
function cswap(p, q, b) {
|
|
5165
|
-
var i;
|
|
5166
|
-
for (
|
|
5165
|
+
var i = 0;
|
|
5166
|
+
for (; i < 4; i++) sel25519(p[i], q[i], b);
|
|
5167
5167
|
}
|
|
5168
5168
|
function pack(r, p) {
|
|
5169
5169
|
var tx = gf(), ty = gf(), zi = gf();
|
|
@@ -5266,8 +5266,8 @@ var require_crypto_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5266
5266
|
16
|
|
5267
5267
|
]);
|
|
5268
5268
|
function modL(r, x) {
|
|
5269
|
-
var carry, i, j, k;
|
|
5270
|
-
for (
|
|
5269
|
+
var carry, i = 63, j, k;
|
|
5270
|
+
for (; i >= 32; --i) {
|
|
5271
5271
|
carry = 0;
|
|
5272
5272
|
for (j = i - 32, k = i - 12; j < k; ++j) {
|
|
5273
5273
|
x[j] += carry - 16 * x[i] * L[j - (i - 32)];
|