@dxos/vendor-hypercore 0.8.4-main.1da679c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ MIT License
2
+ Copyright (c) 2022 DXOS
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,223 @@
1
+ import "@dxos/node-std/globals";
2
+ import import$sodium_universal from 'sodium-universal';
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error('Dynamic require of "' + x + '" is not supported');
14
+ });
15
+ var __commonJS = (cb, mod) => function __require2() {
16
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ };
18
+ var __export = (target, all) => {
19
+ for (var name in all)
20
+ __defProp(target, name, { get: all[name], enumerable: true });
21
+ };
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") {
24
+ for (let key of __getOwnPropNames(from))
25
+ if (!__hasOwnProp.call(to, key) && key !== except)
26
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
+ }
28
+ return to;
29
+ };
30
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
31
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
32
+ // If the importer is in node compatibility mode or this is not an ESM
33
+ // file that has been converted to a CommonJS file using a Babel-
34
+ // compatible transform (i.e. "__esModule" has not been set), then set
35
+ // "default" to the CommonJS "module.exports" for node compatibility.
36
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
+ mod
38
+ ));
39
+
40
+ // ../../node_modules/.pnpm/uint64be@3.0.0/node_modules/uint64be/index.js
41
+ var require_uint64be = __commonJS({
42
+ "../../node_modules/.pnpm/uint64be@3.0.0/node_modules/uint64be/index.js"(exports) {
43
+ var UINT_32_MAX = Math.pow(2, 32);
44
+ exports.encodingLength = function() {
45
+ return 8;
46
+ };
47
+ exports.encode = function(num, buf, offset) {
48
+ if (!buf) buf = Buffer.allocUnsafe(8);
49
+ if (!offset) offset = 0;
50
+ const top = Math.floor(num / UINT_32_MAX);
51
+ const rem = num - top * UINT_32_MAX;
52
+ buf.writeUInt32BE(top, offset);
53
+ buf.writeUInt32BE(rem, offset + 4);
54
+ return buf;
55
+ };
56
+ exports.decode = function(buf, offset) {
57
+ if (!offset) offset = 0;
58
+ const top = buf.readUInt32BE(offset);
59
+ const rem = buf.readUInt32BE(offset + 4);
60
+ return top * UINT_32_MAX + rem;
61
+ };
62
+ exports.encode.bytes = 8;
63
+ exports.decode.bytes = 8;
64
+ }
65
+ });
66
+
67
+ // ../../node_modules/.pnpm/hypercore-crypto@2.3.2/node_modules/hypercore-crypto/index.js
68
+ var require_hypercore_crypto = __commonJS({
69
+ "../../node_modules/.pnpm/hypercore-crypto@2.3.2/node_modules/hypercore-crypto/index.js"(exports) {
70
+ var sodium = import$sodium_universal;
71
+ var uint64be = require_uint64be();
72
+ var LEAF_TYPE = Buffer.from([0]);
73
+ var PARENT_TYPE = Buffer.from([1]);
74
+ var ROOT_TYPE = Buffer.from([2]);
75
+ var CAP_TYPE = Buffer.from([3]);
76
+ var HYPERCORE = Buffer.from("hypercore");
77
+ var HYPERCORE_CAP = Buffer.from("hypercore capability");
78
+ exports.writerCapability = function(key, secretKey, split) {
79
+ if (!split) return null;
80
+ const out = Buffer.allocUnsafe(32);
81
+ sodium.crypto_generichash_batch(out, [
82
+ CAP_TYPE,
83
+ HYPERCORE_CAP,
84
+ split.tx.slice(0, 32),
85
+ key
86
+ ], split.rx.slice(0, 32));
87
+ return exports.sign(out, secretKey);
88
+ };
89
+ exports.verifyRemoteWriterCapability = function(key, cap, split) {
90
+ if (!split) return null;
91
+ const out = Buffer.allocUnsafe(32);
92
+ sodium.crypto_generichash_batch(out, [
93
+ CAP_TYPE,
94
+ HYPERCORE_CAP,
95
+ split.rx.slice(0, 32),
96
+ key
97
+ ], split.tx.slice(0, 32));
98
+ return exports.verify(out, cap, key);
99
+ };
100
+ exports.capability = function(key, split) {
101
+ if (!split) return null;
102
+ const out = Buffer.allocUnsafe(32);
103
+ sodium.crypto_generichash_batch(out, [
104
+ HYPERCORE_CAP,
105
+ split.tx.slice(0, 32),
106
+ key
107
+ ], split.rx.slice(0, 32));
108
+ return out;
109
+ };
110
+ exports.remoteCapability = function(key, split) {
111
+ if (!split) return null;
112
+ const out = Buffer.allocUnsafe(32);
113
+ sodium.crypto_generichash_batch(out, [
114
+ HYPERCORE_CAP,
115
+ split.rx.slice(0, 32),
116
+ key
117
+ ], split.tx.slice(0, 32));
118
+ return out;
119
+ };
120
+ exports.keyPair = function(seed) {
121
+ const publicKey = Buffer.allocUnsafe(sodium.crypto_sign_PUBLICKEYBYTES);
122
+ const secretKey = Buffer.allocUnsafe(sodium.crypto_sign_SECRETKEYBYTES);
123
+ if (seed) sodium.crypto_sign_seed_keypair(publicKey, secretKey, seed);
124
+ else sodium.crypto_sign_keypair(publicKey, secretKey);
125
+ return {
126
+ publicKey,
127
+ secretKey
128
+ };
129
+ };
130
+ exports.validateKeyPair = function(keyPair) {
131
+ const pk = Buffer.allocUnsafe(sodium.crypto_sign_PUBLICKEYBYTES);
132
+ sodium.crypto_sign_ed25519_sk_to_pk(pk, keyPair.secretKey);
133
+ return pk.equals(keyPair.publicKey);
134
+ };
135
+ exports.sign = function(message, secretKey) {
136
+ const signature = Buffer.allocUnsafe(sodium.crypto_sign_BYTES);
137
+ sodium.crypto_sign_detached(signature, message, secretKey);
138
+ return signature;
139
+ };
140
+ exports.verify = function(message, signature, publicKey) {
141
+ return sodium.crypto_sign_verify_detached(signature, message, publicKey);
142
+ };
143
+ exports.data = function(data) {
144
+ const out = Buffer.allocUnsafe(32);
145
+ sodium.crypto_generichash_batch(out, [
146
+ LEAF_TYPE,
147
+ encodeUInt64(data.length),
148
+ data
149
+ ]);
150
+ return out;
151
+ };
152
+ exports.leaf = function(leaf) {
153
+ return exports.data(leaf.data);
154
+ };
155
+ exports.parent = function(a, b) {
156
+ if (a.index > b.index) {
157
+ const tmp = a;
158
+ a = b;
159
+ b = tmp;
160
+ }
161
+ const out = Buffer.allocUnsafe(32);
162
+ sodium.crypto_generichash_batch(out, [
163
+ PARENT_TYPE,
164
+ encodeUInt64(a.size + b.size),
165
+ a.hash,
166
+ b.hash
167
+ ]);
168
+ return out;
169
+ };
170
+ exports.tree = function(roots, out) {
171
+ const buffers = new Array(3 * roots.length + 1);
172
+ var j = 0;
173
+ buffers[j++] = ROOT_TYPE;
174
+ for (var i = 0; i < roots.length; i++) {
175
+ const r = roots[i];
176
+ buffers[j++] = r.hash;
177
+ buffers[j++] = encodeUInt64(r.index);
178
+ buffers[j++] = encodeUInt64(r.size);
179
+ }
180
+ if (!out) out = Buffer.allocUnsafe(32);
181
+ sodium.crypto_generichash_batch(out, buffers);
182
+ return out;
183
+ };
184
+ exports.signable = function(roots, length) {
185
+ const out = Buffer.allocUnsafe(40);
186
+ if (Buffer.isBuffer(roots)) roots.copy(out);
187
+ else exports.tree(roots, out.slice(0, 32));
188
+ uint64be.encode(length, out.slice(32));
189
+ return out;
190
+ };
191
+ exports.randomBytes = function(n) {
192
+ const buf = Buffer.allocUnsafe(n);
193
+ sodium.randombytes_buf(buf);
194
+ return buf;
195
+ };
196
+ exports.discoveryKey = function(publicKey) {
197
+ const digest = Buffer.allocUnsafe(32);
198
+ sodium.crypto_generichash(digest, HYPERCORE, publicKey);
199
+ return digest;
200
+ };
201
+ if (sodium.sodium_free) {
202
+ exports.free = function(secureBuf) {
203
+ if (secureBuf.secure) sodium.sodium_free(secureBuf);
204
+ };
205
+ } else {
206
+ exports.free = function() {
207
+ };
208
+ }
209
+ function encodeUInt64(n) {
210
+ return uint64be.encode(n, Buffer.allocUnsafe(8));
211
+ }
212
+ }
213
+ });
214
+
215
+ export {
216
+ __require,
217
+ __commonJS,
218
+ __export,
219
+ __reExport,
220
+ __toESM,
221
+ require_hypercore_crypto
222
+ };
223
+ //# sourceMappingURL=chunk-XAJ5RWMK.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../node_modules/.pnpm/uint64be@3.0.0/node_modules/uint64be/index.js", "../../../../../node_modules/.pnpm/hypercore-crypto@2.3.2/node_modules/hypercore-crypto/index.js"],
4
+ "sourcesContent": ["const UINT_32_MAX = Math.pow(2, 32)\n\nexports.encodingLength = function () {\n return 8\n}\n\nexports.encode = function (num, buf, offset) {\n if (!buf) buf = Buffer.allocUnsafe(8)\n if (!offset) offset = 0\n\n const top = Math.floor(num / UINT_32_MAX)\n const rem = num - top * UINT_32_MAX\n\n buf.writeUInt32BE(top, offset)\n buf.writeUInt32BE(rem, offset + 4)\n return buf\n}\n\nexports.decode = function (buf, offset) {\n if (!offset) offset = 0\n\n const top = buf.readUInt32BE(offset)\n const rem = buf.readUInt32BE(offset + 4)\n\n return top * UINT_32_MAX + rem\n}\n\nexports.encode.bytes = 8\nexports.decode.bytes = 8\n", "const sodium = require('sodium-universal')\nconst uint64be = require('uint64be')\n\n// https://en.wikipedia.org/wiki/Merkle_tree#Second_preimage_attack\nconst LEAF_TYPE = Buffer.from([0])\nconst PARENT_TYPE = Buffer.from([1])\nconst ROOT_TYPE = Buffer.from([2])\nconst CAP_TYPE = Buffer.from([3])\n\nconst HYPERCORE = Buffer.from('hypercore')\nconst HYPERCORE_CAP = Buffer.from('hypercore capability')\n\nexports.writerCapability = function (key, secretKey, split) {\n if (!split) return null\n\n const out = Buffer.allocUnsafe(32)\n sodium.crypto_generichash_batch(out, [\n CAP_TYPE,\n HYPERCORE_CAP,\n split.tx.slice(0, 32),\n key\n ], split.rx.slice(0, 32))\n\n return exports.sign(out, secretKey)\n}\n\nexports.verifyRemoteWriterCapability = function (key, cap, split) {\n if (!split) return null\n\n const out = Buffer.allocUnsafe(32)\n sodium.crypto_generichash_batch(out, [\n CAP_TYPE,\n HYPERCORE_CAP,\n split.rx.slice(0, 32),\n key\n ], split.tx.slice(0, 32))\n\n return exports.verify(out, cap, key)\n}\n\n// TODO: add in the CAP_TYPE in a future version\nexports.capability = function (key, split) {\n if (!split) return null\n\n const out = Buffer.allocUnsafe(32)\n sodium.crypto_generichash_batch(out, [\n HYPERCORE_CAP,\n split.tx.slice(0, 32),\n key\n ], split.rx.slice(0, 32))\n\n return out\n}\n\n// TODO: add in the CAP_TYPE in a future version\nexports.remoteCapability = function (key, split) {\n if (!split) return null\n\n const out = Buffer.allocUnsafe(32)\n sodium.crypto_generichash_batch(out, [\n HYPERCORE_CAP,\n split.rx.slice(0, 32),\n key\n ], split.tx.slice(0, 32))\n\n return out\n}\n\nexports.keyPair = function (seed) {\n const publicKey = Buffer.allocUnsafe(sodium.crypto_sign_PUBLICKEYBYTES)\n const secretKey = Buffer.allocUnsafe(sodium.crypto_sign_SECRETKEYBYTES)\n\n if (seed) sodium.crypto_sign_seed_keypair(publicKey, secretKey, seed)\n else sodium.crypto_sign_keypair(publicKey, secretKey)\n\n return {\n publicKey,\n secretKey\n }\n}\n\nexports.validateKeyPair = function (keyPair) {\n const pk = Buffer.allocUnsafe(sodium.crypto_sign_PUBLICKEYBYTES)\n sodium.crypto_sign_ed25519_sk_to_pk(pk, keyPair.secretKey)\n return pk.equals(keyPair.publicKey)\n}\n\nexports.sign = function (message, secretKey) {\n const signature = Buffer.allocUnsafe(sodium.crypto_sign_BYTES)\n sodium.crypto_sign_detached(signature, message, secretKey)\n return signature\n}\n\nexports.verify = function (message, signature, publicKey) {\n return sodium.crypto_sign_verify_detached(signature, message, publicKey)\n}\n\nexports.data = function (data) {\n const out = Buffer.allocUnsafe(32)\n\n sodium.crypto_generichash_batch(out, [\n LEAF_TYPE,\n encodeUInt64(data.length),\n data\n ])\n\n return out\n}\n\nexports.leaf = function (leaf) {\n return exports.data(leaf.data)\n}\n\nexports.parent = function (a, b) {\n if (a.index > b.index) {\n const tmp = a\n a = b\n b = tmp\n }\n\n const out = Buffer.allocUnsafe(32)\n\n sodium.crypto_generichash_batch(out, [\n PARENT_TYPE,\n encodeUInt64(a.size + b.size),\n a.hash,\n b.hash\n ])\n\n return out\n}\n\nexports.tree = function (roots, out) {\n const buffers = new Array(3 * roots.length + 1)\n var j = 0\n\n buffers[j++] = ROOT_TYPE\n\n for (var i = 0; i < roots.length; i++) {\n const r = roots[i]\n buffers[j++] = r.hash\n buffers[j++] = encodeUInt64(r.index)\n buffers[j++] = encodeUInt64(r.size)\n }\n\n if (!out) out = Buffer.allocUnsafe(32)\n sodium.crypto_generichash_batch(out, buffers)\n return out\n}\n\nexports.signable = function (roots, length) {\n const out = Buffer.allocUnsafe(40)\n\n if (Buffer.isBuffer(roots)) roots.copy(out)\n else exports.tree(roots, out.slice(0, 32))\n\n uint64be.encode(length, out.slice(32))\n\n return out\n}\n\nexports.randomBytes = function (n) {\n const buf = Buffer.allocUnsafe(n)\n sodium.randombytes_buf(buf)\n return buf\n}\n\nexports.discoveryKey = function (publicKey) {\n const digest = Buffer.allocUnsafe(32)\n sodium.crypto_generichash(digest, HYPERCORE, publicKey)\n return digest\n}\n\nif (sodium.sodium_free) {\n exports.free = function (secureBuf) {\n if (secureBuf.secure) sodium.sodium_free(secureBuf)\n }\n} else {\n exports.free = function () {}\n}\n\nfunction encodeUInt64 (n) {\n return uint64be.encode(n, Buffer.allocUnsafe(8))\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,QAAM,cAAc,KAAK,IAAI,GAAG,EAAE;AAElC,YAAQ,iBAAiB,WAAY;AACnC,aAAO;AAAA,IACT;AAEA,YAAQ,SAAS,SAAU,KAAK,KAAK,QAAQ;AAC3C,UAAI,CAAC,IAAK,OAAM,OAAO,YAAY,CAAC;AACpC,UAAI,CAAC,OAAQ,UAAS;AAEtB,YAAM,MAAM,KAAK,MAAM,MAAM,WAAW;AACxC,YAAM,MAAM,MAAM,MAAM;AAExB,UAAI,cAAc,KAAK,MAAM;AAC7B,UAAI,cAAc,KAAK,SAAS,CAAC;AACjC,aAAO;AAAA,IACT;AAEA,YAAQ,SAAS,SAAU,KAAK,QAAQ;AACtC,UAAI,CAAC,OAAQ,UAAS;AAEtB,YAAM,MAAM,IAAI,aAAa,MAAM;AACnC,YAAM,MAAM,IAAI,aAAa,SAAS,CAAC;AAEvC,aAAO,MAAM,cAAc;AAAA,IAC7B;AAEA,YAAQ,OAAO,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AQ,eAAe,SAAU,WAAW;AAC1C,YAAM,SAAS,OAAO,YAAY,EAAE;AACpC,aAAO,mBAAmB,QAAQ,WAAW,SAAS;AACtD,aAAO;AAAA,IACT;AAEA,QAAI,OAAO,aAAa;AACtB,cAAQ,OAAO,SAAU,WAAW;AAClC,YAAI,UAAU,OAAQ,QAAO,YAAY,SAAS;AAAA,MACpD;AAAA,IACF,OAAO;AACL,cAAQ,OAAO,WAAY;AAAA,MAAC;AAAA,IAC9B;AAEA,aAAS,aAAc,GAAG;AACxB,aAAO,SAAS,OAAO,GAAG,OAAO,YAAY,CAAC,CAAC;AAAA,IACjD;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,25 @@
1
+ import "@dxos/node-std/globals";
2
+ import {
3
+ __toESM,
4
+ require_hypercore_crypto
5
+ } from "./chunk-XAJ5RWMK.mjs";
6
+
7
+ // src/hypercore-crypto.js
8
+ var import_hypercore_crypto = __toESM(require_hypercore_crypto(), 1);
9
+ var export_default = import_hypercore_crypto.default;
10
+ var export_discoveryKey = import_hypercore_crypto.discoveryKey;
11
+ var export_keyPair = import_hypercore_crypto.keyPair;
12
+ var export_randomBytes = import_hypercore_crypto.randomBytes;
13
+ var export_sign = import_hypercore_crypto.sign;
14
+ var export_validateKeyPair = import_hypercore_crypto.validateKeyPair;
15
+ var export_verify = import_hypercore_crypto.verify;
16
+ export {
17
+ export_default as default,
18
+ export_discoveryKey as discoveryKey,
19
+ export_keyPair as keyPair,
20
+ export_randomBytes as randomBytes,
21
+ export_sign as sign,
22
+ export_validateKeyPair as validateKeyPair,
23
+ export_verify as verify
24
+ };
25
+ //# sourceMappingURL=hypercore-crypto.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hypercore-crypto.js"],
4
+ "sourcesContent": ["export { keyPair, validateKeyPair, sign, verify, randomBytes, discoveryKey, default } from 'hypercore-crypto';\n"],
5
+ "mappings": ";;;;;;;AAAA,8BAA2F;",
6
+ "names": []
7
+ }