@noir-lang/noir_wasm 0.6.0 → 0.10.0-17b9181c

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.
File without changes
@@ -2,15 +2,11 @@ let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
4
  const { read_file } = require(String.raw`./snippets/fm-cffb18dcbd478425/file_reader.js`);
5
- const { TextEncoder, TextDecoder } = require(`util`);
5
+ const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
- const heap = new Array(32).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
7
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
12
8
 
13
- let WASM_VECTOR_LEN = 0;
9
+ cachedTextDecoder.decode();
14
10
 
15
11
  let cachedUint8Memory0 = new Uint8Array();
16
12
 
@@ -21,6 +17,29 @@ function getUint8Memory0() {
21
17
  return cachedUint8Memory0;
22
18
  }
23
19
 
20
+ function getStringFromWasm0(ptr, len) {
21
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
22
+ }
23
+
24
+ const heap = new Array(32).fill(undefined);
25
+
26
+ heap.push(undefined, null, true, false);
27
+
28
+ let heap_next = heap.length;
29
+
30
+ function addHeapObject(obj) {
31
+ if (heap_next === heap.length) heap.push(heap.length + 1);
32
+ const idx = heap_next;
33
+ heap_next = heap[idx];
34
+
35
+ heap[idx] = obj;
36
+ return idx;
37
+ }
38
+
39
+ function getObject(idx) { return heap[idx]; }
40
+
41
+ let WASM_VECTOR_LEN = 0;
42
+
24
43
  let cachedTextEncoder = new TextEncoder('utf-8');
25
44
 
26
45
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -83,8 +102,6 @@ function getInt32Memory0() {
83
102
  return cachedInt32Memory0;
84
103
  }
85
104
 
86
- let heap_next = heap.length;
87
-
88
105
  function dropObject(idx) {
89
106
  if (idx < 36) return;
90
107
  heap[idx] = heap_next;
@@ -96,23 +113,6 @@ function takeObject(idx) {
96
113
  dropObject(idx);
97
114
  return ret;
98
115
  }
99
-
100
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
101
-
102
- cachedTextDecoder.decode();
103
-
104
- function getStringFromWasm0(ptr, len) {
105
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
106
- }
107
-
108
- function addHeapObject(obj) {
109
- if (heap_next === heap.length) heap.push(heap.length + 1);
110
- const idx = heap_next;
111
- heap_next = heap[idx];
112
-
113
- heap[idx] = obj;
114
- return idx;
115
- }
116
116
  /**
117
117
  * @param {string} src
118
118
  * @returns {any}
@@ -170,6 +170,11 @@ function handleError(f, args) {
170
170
  }
171
171
  }
172
172
 
173
+ module.exports.__wbindgen_json_parse = function(arg0, arg1) {
174
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
175
+ return addHeapObject(ret);
176
+ };
177
+
173
178
  module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
174
179
  const obj = getObject(arg1);
175
180
  const ret = JSON.stringify(obj === undefined ? null : obj);
@@ -183,12 +188,7 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
183
188
  takeObject(arg0);
184
189
  };
185
190
 
186
- module.exports.__wbindgen_json_parse = function(arg0, arg1) {
187
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
188
- return addHeapObject(ret);
189
- };
190
-
191
- module.exports.__wbg_readfile_381ecedf0ec0c1aa = function() { return handleError(function (arg0, arg1, arg2) {
191
+ module.exports.__wbg_readfile_a255adfa6d841e23 = function() { return handleError(function (arg0, arg1, arg2) {
192
192
  const ret = read_file(getStringFromWasm0(arg1, arg2));
193
193
  const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
194
194
  const len0 = WASM_VECTOR_LEN;
@@ -196,12 +196,12 @@ module.exports.__wbg_readfile_381ecedf0ec0c1aa = function() { return handleError
196
196
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
197
197
  }, arguments) };
198
198
 
199
- module.exports.__wbg_new_693216e109162396 = function() {
199
+ module.exports.__wbg_new_abda76e883ba8a5f = function() {
200
200
  const ret = new Error();
201
201
  return addHeapObject(ret);
202
202
  };
203
203
 
204
- module.exports.__wbg_stack_0ddaca5d1abfb52f = function(arg0, arg1) {
204
+ module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
205
205
  const ret = getObject(arg1).stack;
206
206
  const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
207
207
  const len0 = WASM_VECTOR_LEN;
@@ -209,7 +209,7 @@ module.exports.__wbg_stack_0ddaca5d1abfb52f = function(arg0, arg1) {
209
209
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
210
210
  };
211
211
 
212
- module.exports.__wbg_error_09919627ac0992f5 = function(arg0, arg1) {
212
+ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
213
213
  try {
214
214
  console.error(getStringFromWasm0(arg0, arg1));
215
215
  } finally {
@@ -217,138 +217,6 @@ module.exports.__wbg_error_09919627ac0992f5 = function(arg0, arg1) {
217
217
  }
218
218
  };
219
219
 
220
- module.exports.__wbg_randomFillSync_91e2b39becca6147 = function() { return handleError(function (arg0, arg1, arg2) {
221
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
222
- }, arguments) };
223
-
224
- module.exports.__wbg_getRandomValues_b14734aa289bc356 = function() { return handleError(function (arg0, arg1) {
225
- getObject(arg0).getRandomValues(getObject(arg1));
226
- }, arguments) };
227
-
228
- module.exports.__wbg_process_e56fd54cf6319b6c = function(arg0) {
229
- const ret = getObject(arg0).process;
230
- return addHeapObject(ret);
231
- };
232
-
233
- module.exports.__wbindgen_is_object = function(arg0) {
234
- const val = getObject(arg0);
235
- const ret = typeof(val) === 'object' && val !== null;
236
- return ret;
237
- };
238
-
239
- module.exports.__wbg_versions_77e21455908dad33 = function(arg0) {
240
- const ret = getObject(arg0).versions;
241
- return addHeapObject(ret);
242
- };
243
-
244
- module.exports.__wbg_node_0dd25d832e4785d5 = function(arg0) {
245
- const ret = getObject(arg0).node;
246
- return addHeapObject(ret);
247
- };
248
-
249
- module.exports.__wbindgen_is_string = function(arg0) {
250
- const ret = typeof(getObject(arg0)) === 'string';
251
- return ret;
252
- };
253
-
254
- module.exports.__wbg_crypto_b95d7173266618a9 = function(arg0) {
255
- const ret = getObject(arg0).crypto;
256
- return addHeapObject(ret);
257
- };
258
-
259
- module.exports.__wbg_msCrypto_5a86d77a66230f81 = function(arg0) {
260
- const ret = getObject(arg0).msCrypto;
261
- return addHeapObject(ret);
262
- };
263
-
264
- module.exports.__wbg_static_accessor_NODE_MODULE_26b231378c1be7dd = function() {
265
- const ret = module;
266
- return addHeapObject(ret);
267
- };
268
-
269
- module.exports.__wbg_require_0db1598d9ccecb30 = function() { return handleError(function (arg0, arg1, arg2) {
270
- const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
271
- return addHeapObject(ret);
272
- }, arguments) };
273
-
274
- module.exports.__wbg_newnoargs_971e9a5abe185139 = function(arg0, arg1) {
275
- const ret = new Function(getStringFromWasm0(arg0, arg1));
276
- return addHeapObject(ret);
277
- };
278
-
279
- module.exports.__wbg_call_33d7bcddbbfa394a = function() { return handleError(function (arg0, arg1) {
280
- const ret = getObject(arg0).call(getObject(arg1));
281
- return addHeapObject(ret);
282
- }, arguments) };
283
-
284
- module.exports.__wbindgen_object_clone_ref = function(arg0) {
285
- const ret = getObject(arg0);
286
- return addHeapObject(ret);
287
- };
288
-
289
- module.exports.__wbg_self_fd00a1ef86d1b2ed = function() { return handleError(function () {
290
- const ret = self.self;
291
- return addHeapObject(ret);
292
- }, arguments) };
293
-
294
- module.exports.__wbg_window_6f6e346d8bbd61d7 = function() { return handleError(function () {
295
- const ret = window.window;
296
- return addHeapObject(ret);
297
- }, arguments) };
298
-
299
- module.exports.__wbg_globalThis_3348936ac49df00a = function() { return handleError(function () {
300
- const ret = globalThis.globalThis;
301
- return addHeapObject(ret);
302
- }, arguments) };
303
-
304
- module.exports.__wbg_global_67175caf56f55ca9 = function() { return handleError(function () {
305
- const ret = global.global;
306
- return addHeapObject(ret);
307
- }, arguments) };
308
-
309
- module.exports.__wbindgen_is_undefined = function(arg0) {
310
- const ret = getObject(arg0) === undefined;
311
- return ret;
312
- };
313
-
314
- module.exports.__wbg_buffer_34f5ec9f8a838ba0 = function(arg0) {
315
- const ret = getObject(arg0).buffer;
316
- return addHeapObject(ret);
317
- };
318
-
319
- module.exports.__wbg_new_cda198d9dbc6d7ea = function(arg0) {
320
- const ret = new Uint8Array(getObject(arg0));
321
- return addHeapObject(ret);
322
- };
323
-
324
- module.exports.__wbg_set_1a930cfcda1a8067 = function(arg0, arg1, arg2) {
325
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
326
- };
327
-
328
- module.exports.__wbg_length_51f19f73d6d9eff3 = function(arg0) {
329
- const ret = getObject(arg0).length;
330
- return ret;
331
- };
332
-
333
- module.exports.__wbg_newwithlength_66e5530e7079ea1b = function(arg0) {
334
- const ret = new Uint8Array(arg0 >>> 0);
335
- return addHeapObject(ret);
336
- };
337
-
338
- module.exports.__wbg_subarray_270ff8dd5582c1ac = function(arg0, arg1, arg2) {
339
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
340
- return addHeapObject(ret);
341
- };
342
-
343
- module.exports.__wbindgen_throw = function(arg0, arg1) {
344
- throw new Error(getStringFromWasm0(arg0, arg1));
345
- };
346
-
347
- module.exports.__wbindgen_memory = function() {
348
- const ret = wasm.memory;
349
- return addHeapObject(ret);
350
- };
351
-
352
220
  const path = require('path').join(__dirname, 'noir_wasm_bg.wasm');
353
221
  const bytes = require('fs').readFileSync(path);
354
222
 
Binary file
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@noir-lang/noir_wasm",
3
- "version": "0.6.0",
3
+ "version": "0.10.0-17b9181c",
4
4
  "files": [
5
- "noir_wasm_bg.wasm",
6
- "noir_wasm.js",
7
- "noir_wasm_bg.wasm.d.ts",
8
- "noir_wasm.d.ts",
9
- "snippets/*"
5
+ "nodejs",
6
+ "web",
7
+ "package.json"
10
8
  ],
11
- "main": "noir_wasm.js",
12
- "types": "noir_wasm.d.ts"
13
- }
9
+ "main": "./nodejs/noir_wasm.js",
10
+ "types": "./web/noir_wasm.d.ts",
11
+ "module": "./web/noir_wasm.js",
12
+ "sideEffects": false
13
+ }
@@ -0,0 +1,56 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * @param {string} src
5
+ * @returns {any}
6
+ */
7
+ export function compile(src: string): any;
8
+ /**
9
+ * @param {Uint8Array} bytes
10
+ * @returns {any}
11
+ */
12
+ export function acir_from_bytes(bytes: Uint8Array): any;
13
+ /**
14
+ * @param {any} acir
15
+ * @returns {Uint8Array}
16
+ */
17
+ export function acir_to_bytes(acir: any): Uint8Array;
18
+
19
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
20
+
21
+ export interface InitOutput {
22
+ readonly memory: WebAssembly.Memory;
23
+ readonly compile: (a: number, b: number) => number;
24
+ readonly acir_from_bytes: (a: number, b: number) => number;
25
+ readonly acir_to_bytes: (a: number, b: number) => void;
26
+ readonly rust_psm_on_stack: (a: number, b: number, c: number, d: number) => void;
27
+ readonly rust_psm_stack_direction: () => number;
28
+ readonly rust_psm_stack_pointer: () => number;
29
+ readonly rust_psm_replace_stack: (a: number, b: number, c: number) => void;
30
+ readonly __wbindgen_export_0: (a: number) => number;
31
+ readonly __wbindgen_export_1: (a: number, b: number, c: number) => number;
32
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
33
+ readonly __wbindgen_export_2: (a: number, b: number) => void;
34
+ readonly __wbindgen_export_3: (a: number) => void;
35
+ }
36
+
37
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
38
+ /**
39
+ * Instantiates the given `module`, which can either be bytes or
40
+ * a precompiled `WebAssembly.Module`.
41
+ *
42
+ * @param {SyncInitInput} module
43
+ *
44
+ * @returns {InitOutput}
45
+ */
46
+ export function initSync(module: SyncInitInput): InitOutput;
47
+
48
+ /**
49
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
50
+ * for everything else, calls `WebAssembly.instantiate` directly.
51
+ *
52
+ * @param {InitInput | Promise<InitInput>} module_or_path
53
+ *
54
+ * @returns {Promise<InitOutput>}
55
+ */
56
+ export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,295 @@
1
+ import { read_file } from './snippets/fm-cffb18dcbd478425/file_reader.js';
2
+
3
+ let wasm;
4
+
5
+ const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
6
+
7
+ cachedTextDecoder.decode();
8
+
9
+ let cachedUint8Memory0 = new Uint8Array();
10
+
11
+ function getUint8Memory0() {
12
+ if (cachedUint8Memory0.byteLength === 0) {
13
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
14
+ }
15
+ return cachedUint8Memory0;
16
+ }
17
+
18
+ function getStringFromWasm0(ptr, len) {
19
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
20
+ }
21
+
22
+ const heap = new Array(32).fill(undefined);
23
+
24
+ heap.push(undefined, null, true, false);
25
+
26
+ let heap_next = heap.length;
27
+
28
+ function addHeapObject(obj) {
29
+ if (heap_next === heap.length) heap.push(heap.length + 1);
30
+ const idx = heap_next;
31
+ heap_next = heap[idx];
32
+
33
+ heap[idx] = obj;
34
+ return idx;
35
+ }
36
+
37
+ function getObject(idx) { return heap[idx]; }
38
+
39
+ let WASM_VECTOR_LEN = 0;
40
+
41
+ const cachedTextEncoder = new TextEncoder('utf-8');
42
+
43
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
44
+ ? function (arg, view) {
45
+ return cachedTextEncoder.encodeInto(arg, view);
46
+ }
47
+ : function (arg, view) {
48
+ const buf = cachedTextEncoder.encode(arg);
49
+ view.set(buf);
50
+ return {
51
+ read: arg.length,
52
+ written: buf.length
53
+ };
54
+ });
55
+
56
+ function passStringToWasm0(arg, malloc, realloc) {
57
+
58
+ if (realloc === undefined) {
59
+ const buf = cachedTextEncoder.encode(arg);
60
+ const ptr = malloc(buf.length);
61
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
62
+ WASM_VECTOR_LEN = buf.length;
63
+ return ptr;
64
+ }
65
+
66
+ let len = arg.length;
67
+ let ptr = malloc(len);
68
+
69
+ const mem = getUint8Memory0();
70
+
71
+ let offset = 0;
72
+
73
+ for (; offset < len; offset++) {
74
+ const code = arg.charCodeAt(offset);
75
+ if (code > 0x7F) break;
76
+ mem[ptr + offset] = code;
77
+ }
78
+
79
+ if (offset !== len) {
80
+ if (offset !== 0) {
81
+ arg = arg.slice(offset);
82
+ }
83
+ ptr = realloc(ptr, len, len = offset + arg.length * 3);
84
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
85
+ const ret = encodeString(arg, view);
86
+
87
+ offset += ret.written;
88
+ }
89
+
90
+ WASM_VECTOR_LEN = offset;
91
+ return ptr;
92
+ }
93
+
94
+ let cachedInt32Memory0 = new Int32Array();
95
+
96
+ function getInt32Memory0() {
97
+ if (cachedInt32Memory0.byteLength === 0) {
98
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
99
+ }
100
+ return cachedInt32Memory0;
101
+ }
102
+
103
+ function dropObject(idx) {
104
+ if (idx < 36) return;
105
+ heap[idx] = heap_next;
106
+ heap_next = idx;
107
+ }
108
+
109
+ function takeObject(idx) {
110
+ const ret = getObject(idx);
111
+ dropObject(idx);
112
+ return ret;
113
+ }
114
+ /**
115
+ * @param {string} src
116
+ * @returns {any}
117
+ */
118
+ export function compile(src) {
119
+ const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
120
+ const len0 = WASM_VECTOR_LEN;
121
+ const ret = wasm.compile(ptr0, len0);
122
+ return takeObject(ret);
123
+ }
124
+
125
+ function passArray8ToWasm0(arg, malloc) {
126
+ const ptr = malloc(arg.length * 1);
127
+ getUint8Memory0().set(arg, ptr / 1);
128
+ WASM_VECTOR_LEN = arg.length;
129
+ return ptr;
130
+ }
131
+ /**
132
+ * @param {Uint8Array} bytes
133
+ * @returns {any}
134
+ */
135
+ export function acir_from_bytes(bytes) {
136
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_0);
137
+ const len0 = WASM_VECTOR_LEN;
138
+ const ret = wasm.acir_from_bytes(ptr0, len0);
139
+ return takeObject(ret);
140
+ }
141
+
142
+ function getArrayU8FromWasm0(ptr, len) {
143
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
144
+ }
145
+ /**
146
+ * @param {any} acir
147
+ * @returns {Uint8Array}
148
+ */
149
+ export function acir_to_bytes(acir) {
150
+ try {
151
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
152
+ wasm.acir_to_bytes(retptr, addHeapObject(acir));
153
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
154
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
155
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
156
+ wasm.__wbindgen_export_2(r0, r1 * 1);
157
+ return v0;
158
+ } finally {
159
+ wasm.__wbindgen_add_to_stack_pointer(16);
160
+ }
161
+ }
162
+
163
+ function handleError(f, args) {
164
+ try {
165
+ return f.apply(this, args);
166
+ } catch (e) {
167
+ wasm.__wbindgen_export_3(addHeapObject(e));
168
+ }
169
+ }
170
+
171
+ async function load(module, imports) {
172
+ if (typeof Response === 'function' && module instanceof Response) {
173
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
174
+ try {
175
+ return await WebAssembly.instantiateStreaming(module, imports);
176
+
177
+ } catch (e) {
178
+ if (module.headers.get('Content-Type') != 'application/wasm') {
179
+ 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);
180
+
181
+ } else {
182
+ throw e;
183
+ }
184
+ }
185
+ }
186
+
187
+ const bytes = await module.arrayBuffer();
188
+ return await WebAssembly.instantiate(bytes, imports);
189
+
190
+ } else {
191
+ const instance = await WebAssembly.instantiate(module, imports);
192
+
193
+ if (instance instanceof WebAssembly.Instance) {
194
+ return { instance, module };
195
+
196
+ } else {
197
+ return instance;
198
+ }
199
+ }
200
+ }
201
+
202
+ function getImports() {
203
+ const imports = {};
204
+ imports.wbg = {};
205
+ imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
206
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
207
+ return addHeapObject(ret);
208
+ };
209
+ imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
210
+ const obj = getObject(arg1);
211
+ const ret = JSON.stringify(obj === undefined ? null : obj);
212
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
213
+ const len0 = WASM_VECTOR_LEN;
214
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
215
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
216
+ };
217
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
218
+ takeObject(arg0);
219
+ };
220
+ imports.wbg.__wbg_readfile_a255adfa6d841e23 = function() { return handleError(function (arg0, arg1, arg2) {
221
+ const ret = read_file(getStringFromWasm0(arg1, arg2));
222
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
223
+ const len0 = WASM_VECTOR_LEN;
224
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
225
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
226
+ }, arguments) };
227
+ imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
228
+ const ret = new Error();
229
+ return addHeapObject(ret);
230
+ };
231
+ imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
232
+ const ret = getObject(arg1).stack;
233
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
234
+ const len0 = WASM_VECTOR_LEN;
235
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
236
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
237
+ };
238
+ imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
239
+ try {
240
+ console.error(getStringFromWasm0(arg0, arg1));
241
+ } finally {
242
+ wasm.__wbindgen_export_2(arg0, arg1);
243
+ }
244
+ };
245
+
246
+ return imports;
247
+ }
248
+
249
+ function initMemory(imports, maybe_memory) {
250
+
251
+ }
252
+
253
+ function finalizeInit(instance, module) {
254
+ wasm = instance.exports;
255
+ init.__wbindgen_wasm_module = module;
256
+ cachedInt32Memory0 = new Int32Array();
257
+ cachedUint8Memory0 = new Uint8Array();
258
+
259
+
260
+ return wasm;
261
+ }
262
+
263
+ function initSync(module) {
264
+ const imports = getImports();
265
+
266
+ initMemory(imports);
267
+
268
+ if (!(module instanceof WebAssembly.Module)) {
269
+ module = new WebAssembly.Module(module);
270
+ }
271
+
272
+ const instance = new WebAssembly.Instance(module, imports);
273
+
274
+ return finalizeInit(instance, module);
275
+ }
276
+
277
+ async function init(input) {
278
+ if (typeof input === 'undefined') {
279
+ input = new URL('noir_wasm_bg.wasm', import.meta.url);
280
+ }
281
+ const imports = getImports();
282
+
283
+ if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
284
+ input = fetch(input);
285
+ }
286
+
287
+ initMemory(imports);
288
+
289
+ const { instance, module } = await load(await input, imports);
290
+
291
+ return finalizeInit(instance, module);
292
+ }
293
+
294
+ export { initSync }
295
+ export default init;
Binary file
@@ -0,0 +1,15 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export function compile(a: number, b: number): number;
5
+ export function acir_from_bytes(a: number, b: number): number;
6
+ export function acir_to_bytes(a: number, b: number): void;
7
+ export function rust_psm_on_stack(a: number, b: number, c: number, d: number): void;
8
+ export function rust_psm_stack_direction(): number;
9
+ export function rust_psm_stack_pointer(): number;
10
+ export function rust_psm_replace_stack(a: number, b: number, c: number): void;
11
+ export function __wbindgen_export_0(a: number): number;
12
+ export function __wbindgen_export_1(a: number, b: number, c: number): number;
13
+ export function __wbindgen_add_to_stack_pointer(a: number): number;
14
+ export function __wbindgen_export_2(a: number, b: number): void;
15
+ export function __wbindgen_export_3(a: number): void;
@@ -0,0 +1,6 @@
1
+ // Synchronously reads a file
2
+ const fs = require("fs");
3
+
4
+ module.exports.read_file = function (path) {
5
+ return fs.readFileSync(path, { encoding: "utf8" });
6
+ };
package/noir_wasm_bg.wasm DELETED
Binary file