@enclave-e3/wasm 0.0.10-test → 0.0.11-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.
@@ -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 cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
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.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
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.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
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.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
168
- const ret = arg0.call(arg1, arg2);
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.__wbg_new_a12002a7f91c75be = function(arg0) {
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.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
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.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
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.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
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.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
229
+ module.exports.__wbg_set_fe4e79d1ed3b0e9b = function(arg0, arg1, arg2) {
226
230
  arg0.set(arg1, arg2 >>> 0);
227
231
  };
228
232
 
229
- module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
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.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
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.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
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.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
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.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "e3-wasm",
3
3
  "description": "E3 — Encrypted Execution Environments",
4
- "version": "0.1.0",
4
+ "version": "0.0.1-test",
5
5
  "license": "LGPL-3.0-only",
6
6
  "repository": {
7
7
  "type": "git",
@@ -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 cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
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
- if (module.headers.get('Content-Type') != 'application/wasm') {
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.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
203
+ imports.wbg.__wbg_buffer_a1a27a0dfa70165d = function(arg0) {
188
204
  const ret = arg0.buffer;
189
205
  return ret;
190
206
  };
191
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
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.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
196
- const ret = arg0.call(arg1, arg2);
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.__wbg_new_a12002a7f91c75be = function(arg0) {
226
+ imports.wbg.__wbg_new_e52b3efaaa774f96 = function(arg0) {
211
227
  const ret = new Uint8Array(arg0);
212
228
  return ret;
213
229
  };
214
- imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
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.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
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.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
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.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
257
+ imports.wbg.__wbg_set_fe4e79d1ed3b0e9b = function(arg0, arg1, arg2) {
242
258
  arg0.set(arg1, arg2 >>> 0);
243
259
  };
244
- imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
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.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
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.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
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.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
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.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
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
  };
Binary file
@@ -2,7 +2,7 @@
2
2
  "name": "e3-wasm",
3
3
  "type": "module",
4
4
  "description": "E3 — Encrypted Execution Environments",
5
- "version": "0.1.0",
5
+ "version": "0.0.1-test",
6
6
  "license": "LGPL-3.0-only",
7
7
  "repository": {
8
8
  "type": "git",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enclave-e3/wasm",
3
- "version": "0.0.10-test",
3
+ "version": "0.0.11-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
  ".": {