@enclave-e3/wasm 0.0.10-test → 0.0.12-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodejs/e3_wasm.js +24 -20
- package/dist/nodejs/e3_wasm_bg.wasm +0 -0
- package/dist/nodejs/package.json +1 -1
- package/dist/web/e3_wasm.js +37 -21
- package/dist/web/e3_wasm_bg.wasm +0 -0
- package/dist/web/package.json +1 -1
- package/package.json +2 -3
package/dist/nodejs/e3_wasm.js
CHANGED
|
@@ -19,10 +19,6 @@ function handleError(f, args) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
23
|
-
|
|
24
|
-
cachedTextDecoder.decode();
|
|
25
|
-
|
|
26
22
|
let cachedUint8ArrayMemory0 = null;
|
|
27
23
|
|
|
28
24
|
function getUint8ArrayMemory0() {
|
|
@@ -32,9 +28,17 @@ function getUint8ArrayMemory0() {
|
|
|
32
28
|
return cachedUint8ArrayMemory0;
|
|
33
29
|
}
|
|
34
30
|
|
|
31
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
32
|
+
|
|
33
|
+
cachedTextDecoder.decode();
|
|
34
|
+
|
|
35
|
+
function decodeText(ptr, len) {
|
|
36
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
function getStringFromWasm0(ptr, len) {
|
|
36
40
|
ptr = ptr >>> 0;
|
|
37
|
-
return
|
|
41
|
+
return decodeText(ptr, len);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
function isLikeNone(x) {
|
|
@@ -154,18 +158,18 @@ module.exports.bfv_verifiable_encrypt_number = function(data, public_key, degree
|
|
|
154
158
|
return v2;
|
|
155
159
|
};
|
|
156
160
|
|
|
157
|
-
module.exports.
|
|
161
|
+
module.exports.__wbg_buffer_a1a27a0dfa70165d = function(arg0) {
|
|
158
162
|
const ret = arg0.buffer;
|
|
159
163
|
return ret;
|
|
160
164
|
};
|
|
161
165
|
|
|
162
|
-
module.exports.
|
|
163
|
-
const ret = arg0.call(arg1);
|
|
166
|
+
module.exports.__wbg_call_f2db6205e5c51dc8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
167
|
+
const ret = arg0.call(arg1, arg2);
|
|
164
168
|
return ret;
|
|
165
169
|
}, arguments) };
|
|
166
170
|
|
|
167
|
-
module.exports.
|
|
168
|
-
const ret = arg0.call(arg1
|
|
171
|
+
module.exports.__wbg_call_fbe8be8bf6436ce5 = function() { return handleError(function (arg0, arg1) {
|
|
172
|
+
const ret = arg0.call(arg1);
|
|
169
173
|
return ret;
|
|
170
174
|
}, arguments) };
|
|
171
175
|
|
|
@@ -183,22 +187,22 @@ module.exports.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
|
183
187
|
return ret;
|
|
184
188
|
};
|
|
185
189
|
|
|
186
|
-
module.exports.
|
|
190
|
+
module.exports.__wbg_new_e52b3efaaa774f96 = function(arg0) {
|
|
187
191
|
const ret = new Uint8Array(arg0);
|
|
188
192
|
return ret;
|
|
189
193
|
};
|
|
190
194
|
|
|
191
|
-
module.exports.
|
|
195
|
+
module.exports.__wbg_newnoargs_ff528e72d35de39a = function(arg0, arg1) {
|
|
192
196
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
193
197
|
return ret;
|
|
194
198
|
};
|
|
195
199
|
|
|
196
|
-
module.exports.
|
|
200
|
+
module.exports.__wbg_newwithbyteoffsetandlength_3b01ecda099177e8 = function(arg0, arg1, arg2) {
|
|
197
201
|
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
198
202
|
return ret;
|
|
199
203
|
};
|
|
200
204
|
|
|
201
|
-
module.exports.
|
|
205
|
+
module.exports.__wbg_newwithlength_08f872dc1e3ada2e = function(arg0) {
|
|
202
206
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
203
207
|
return ret;
|
|
204
208
|
};
|
|
@@ -222,31 +226,31 @@ module.exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(
|
|
|
222
226
|
return ret;
|
|
223
227
|
}, arguments) };
|
|
224
228
|
|
|
225
|
-
module.exports.
|
|
229
|
+
module.exports.__wbg_set_fe4e79d1ed3b0e9b = function(arg0, arg1, arg2) {
|
|
226
230
|
arg0.set(arg1, arg2 >>> 0);
|
|
227
231
|
};
|
|
228
232
|
|
|
229
|
-
module.exports.
|
|
233
|
+
module.exports.__wbg_static_accessor_GLOBAL_487c52c58d65314d = function() {
|
|
230
234
|
const ret = typeof global === 'undefined' ? null : global;
|
|
231
235
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
232
236
|
};
|
|
233
237
|
|
|
234
|
-
module.exports.
|
|
238
|
+
module.exports.__wbg_static_accessor_GLOBAL_THIS_ee9704f328b6b291 = function() {
|
|
235
239
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
236
240
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
237
241
|
};
|
|
238
242
|
|
|
239
|
-
module.exports.
|
|
243
|
+
module.exports.__wbg_static_accessor_SELF_78c9e3071b912620 = function() {
|
|
240
244
|
const ret = typeof self === 'undefined' ? null : self;
|
|
241
245
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
242
246
|
};
|
|
243
247
|
|
|
244
|
-
module.exports.
|
|
248
|
+
module.exports.__wbg_static_accessor_WINDOW_a093d21393777366 = function() {
|
|
245
249
|
const ret = typeof window === 'undefined' ? null : window;
|
|
246
250
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
247
251
|
};
|
|
248
252
|
|
|
249
|
-
module.exports.
|
|
253
|
+
module.exports.__wbg_subarray_dd4ade7d53bd8e26 = function(arg0, arg1, arg2) {
|
|
250
254
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
251
255
|
return ret;
|
|
252
256
|
};
|
|
Binary file
|
package/dist/nodejs/package.json
CHANGED
package/dist/web/e3_wasm.js
CHANGED
|
@@ -15,10 +15,6 @@ function handleError(f, args) {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
19
|
-
|
|
20
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
21
|
-
|
|
22
18
|
let cachedUint8ArrayMemory0 = null;
|
|
23
19
|
|
|
24
20
|
function getUint8ArrayMemory0() {
|
|
@@ -28,9 +24,25 @@ function getUint8ArrayMemory0() {
|
|
|
28
24
|
return cachedUint8ArrayMemory0;
|
|
29
25
|
}
|
|
30
26
|
|
|
27
|
+
let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
28
|
+
|
|
29
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
30
|
+
|
|
31
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
32
|
+
let numBytesDecoded = 0;
|
|
33
|
+
function decodeText(ptr, len) {
|
|
34
|
+
numBytesDecoded += len;
|
|
35
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
36
|
+
cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
37
|
+
cachedTextDecoder.decode();
|
|
38
|
+
numBytesDecoded = len;
|
|
39
|
+
}
|
|
40
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
function getStringFromWasm0(ptr, len) {
|
|
32
44
|
ptr = ptr >>> 0;
|
|
33
|
-
return
|
|
45
|
+
return decodeText(ptr, len);
|
|
34
46
|
}
|
|
35
47
|
|
|
36
48
|
function isLikeNone(x) {
|
|
@@ -150,6 +162,8 @@ export function bfv_verifiable_encrypt_number(data, public_key, degree, plaintex
|
|
|
150
162
|
return v2;
|
|
151
163
|
}
|
|
152
164
|
|
|
165
|
+
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
166
|
+
|
|
153
167
|
async function __wbg_load(module, imports) {
|
|
154
168
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
155
169
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
@@ -157,7 +171,9 @@ async function __wbg_load(module, imports) {
|
|
|
157
171
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
158
172
|
|
|
159
173
|
} catch (e) {
|
|
160
|
-
|
|
174
|
+
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
175
|
+
|
|
176
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
161
177
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
162
178
|
|
|
163
179
|
} else {
|
|
@@ -184,16 +200,16 @@ async function __wbg_load(module, imports) {
|
|
|
184
200
|
function __wbg_get_imports() {
|
|
185
201
|
const imports = {};
|
|
186
202
|
imports.wbg = {};
|
|
187
|
-
imports.wbg.
|
|
203
|
+
imports.wbg.__wbg_buffer_a1a27a0dfa70165d = function(arg0) {
|
|
188
204
|
const ret = arg0.buffer;
|
|
189
205
|
return ret;
|
|
190
206
|
};
|
|
191
|
-
imports.wbg.
|
|
192
|
-
const ret = arg0.call(arg1);
|
|
207
|
+
imports.wbg.__wbg_call_f2db6205e5c51dc8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
208
|
+
const ret = arg0.call(arg1, arg2);
|
|
193
209
|
return ret;
|
|
194
210
|
}, arguments) };
|
|
195
|
-
imports.wbg.
|
|
196
|
-
const ret = arg0.call(arg1
|
|
211
|
+
imports.wbg.__wbg_call_fbe8be8bf6436ce5 = function() { return handleError(function (arg0, arg1) {
|
|
212
|
+
const ret = arg0.call(arg1);
|
|
197
213
|
return ret;
|
|
198
214
|
}, arguments) };
|
|
199
215
|
imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
@@ -207,19 +223,19 @@ function __wbg_get_imports() {
|
|
|
207
223
|
const ret = arg0.msCrypto;
|
|
208
224
|
return ret;
|
|
209
225
|
};
|
|
210
|
-
imports.wbg.
|
|
226
|
+
imports.wbg.__wbg_new_e52b3efaaa774f96 = function(arg0) {
|
|
211
227
|
const ret = new Uint8Array(arg0);
|
|
212
228
|
return ret;
|
|
213
229
|
};
|
|
214
|
-
imports.wbg.
|
|
230
|
+
imports.wbg.__wbg_newnoargs_ff528e72d35de39a = function(arg0, arg1) {
|
|
215
231
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
216
232
|
return ret;
|
|
217
233
|
};
|
|
218
|
-
imports.wbg.
|
|
234
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_3b01ecda099177e8 = function(arg0, arg1, arg2) {
|
|
219
235
|
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
220
236
|
return ret;
|
|
221
237
|
};
|
|
222
|
-
imports.wbg.
|
|
238
|
+
imports.wbg.__wbg_newwithlength_08f872dc1e3ada2e = function(arg0) {
|
|
223
239
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
224
240
|
return ret;
|
|
225
241
|
};
|
|
@@ -238,26 +254,26 @@ function __wbg_get_imports() {
|
|
|
238
254
|
const ret = module.require;
|
|
239
255
|
return ret;
|
|
240
256
|
}, arguments) };
|
|
241
|
-
imports.wbg.
|
|
257
|
+
imports.wbg.__wbg_set_fe4e79d1ed3b0e9b = function(arg0, arg1, arg2) {
|
|
242
258
|
arg0.set(arg1, arg2 >>> 0);
|
|
243
259
|
};
|
|
244
|
-
imports.wbg.
|
|
260
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_487c52c58d65314d = function() {
|
|
245
261
|
const ret = typeof global === 'undefined' ? null : global;
|
|
246
262
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
247
263
|
};
|
|
248
|
-
imports.wbg.
|
|
264
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_ee9704f328b6b291 = function() {
|
|
249
265
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
250
266
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
251
267
|
};
|
|
252
|
-
imports.wbg.
|
|
268
|
+
imports.wbg.__wbg_static_accessor_SELF_78c9e3071b912620 = function() {
|
|
253
269
|
const ret = typeof self === 'undefined' ? null : self;
|
|
254
270
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
255
271
|
};
|
|
256
|
-
imports.wbg.
|
|
272
|
+
imports.wbg.__wbg_static_accessor_WINDOW_a093d21393777366 = function() {
|
|
257
273
|
const ret = typeof window === 'undefined' ? null : window;
|
|
258
274
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
259
275
|
};
|
|
260
|
-
imports.wbg.
|
|
276
|
+
imports.wbg.__wbg_subarray_dd4ade7d53bd8e26 = function(arg0, arg1, arg2) {
|
|
261
277
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
262
278
|
return ret;
|
|
263
279
|
};
|
package/dist/web/e3_wasm_bg.wasm
CHANGED
|
Binary file
|
package/dist/web/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enclave-e3/wasm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12-test",
|
|
4
4
|
"description": "Wasm modules for enclave.",
|
|
5
5
|
"main": "dist/nodejs/e3_wasm.js",
|
|
6
6
|
"module": "dist/web/e3_wasm.js",
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
"init.d.ts"
|
|
16
16
|
],
|
|
17
17
|
"publishConfig": {
|
|
18
|
-
"access": "public"
|
|
19
|
-
"git-checks": false
|
|
18
|
+
"access": "public"
|
|
20
19
|
},
|
|
21
20
|
"exports": {
|
|
22
21
|
".": {
|