@enclave-e3/wasm 0.1.4 → 0.1.6
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/README.md +11 -8
- package/dist/node/e3_wasm.d.ts +73 -2
- package/dist/node/e3_wasm.js +342 -108
- package/dist/node/e3_wasm_bg.wasm +0 -0
- package/dist/node/e3_wasm_bg.wasm.d.ts +9 -4
- package/dist/web/e3_wasm.d.ts +82 -6
- package/dist/web/e3_wasm.js +322 -96
- package/dist/web/e3_wasm_base64.js +1 -1
- package/init.d.ts +3 -3
- package/init_node.cjs +1 -1
- package/init_web.js +12 -12
- package/package.json +14 -7
- package/LICENSE.md +0 -165
package/dist/node/e3_wasm.js
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
let imports = {};
|
|
3
3
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
-
let wasm;
|
|
5
|
-
const { TextDecoder } = require(`util`);
|
|
6
|
-
|
|
7
|
-
function addToExternrefTable0(obj) {
|
|
8
|
-
const idx = wasm.__externref_table_alloc();
|
|
9
|
-
wasm.__wbindgen_export_2.set(idx, obj);
|
|
10
|
-
return idx;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function handleError(f, args) {
|
|
14
|
-
try {
|
|
15
|
-
return f.apply(this, args);
|
|
16
|
-
} catch (e) {
|
|
17
|
-
const idx = addToExternrefTable0(e);
|
|
18
|
-
wasm.__wbindgen_exn_store(idx);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
4
|
|
|
22
5
|
let cachedUint8ArrayMemory0 = null;
|
|
23
6
|
|
|
@@ -41,8 +24,82 @@ function getStringFromWasm0(ptr, len) {
|
|
|
41
24
|
return decodeText(ptr, len);
|
|
42
25
|
}
|
|
43
26
|
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
let WASM_VECTOR_LEN = 0;
|
|
28
|
+
|
|
29
|
+
const cachedTextEncoder = new TextEncoder();
|
|
30
|
+
|
|
31
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
32
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
33
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
34
|
+
view.set(buf);
|
|
35
|
+
return {
|
|
36
|
+
read: arg.length,
|
|
37
|
+
written: buf.length
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
43
|
+
|
|
44
|
+
if (realloc === undefined) {
|
|
45
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
46
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
47
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
48
|
+
WASM_VECTOR_LEN = buf.length;
|
|
49
|
+
return ptr;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let len = arg.length;
|
|
53
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
54
|
+
|
|
55
|
+
const mem = getUint8ArrayMemory0();
|
|
56
|
+
|
|
57
|
+
let offset = 0;
|
|
58
|
+
|
|
59
|
+
for (; offset < len; offset++) {
|
|
60
|
+
const code = arg.charCodeAt(offset);
|
|
61
|
+
if (code > 0x7F) break;
|
|
62
|
+
mem[ptr + offset] = code;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (offset !== len) {
|
|
66
|
+
if (offset !== 0) {
|
|
67
|
+
arg = arg.slice(offset);
|
|
68
|
+
}
|
|
69
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
70
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
71
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
72
|
+
|
|
73
|
+
offset += ret.written;
|
|
74
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
WASM_VECTOR_LEN = offset;
|
|
78
|
+
return ptr;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let cachedDataViewMemory0 = null;
|
|
82
|
+
|
|
83
|
+
function getDataViewMemory0() {
|
|
84
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
85
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
86
|
+
}
|
|
87
|
+
return cachedDataViewMemory0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function addToExternrefTable0(obj) {
|
|
91
|
+
const idx = wasm.__externref_table_alloc();
|
|
92
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
93
|
+
return idx;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function handleError(f, args) {
|
|
97
|
+
try {
|
|
98
|
+
return f.apply(this, args);
|
|
99
|
+
} catch (e) {
|
|
100
|
+
const idx = addToExternrefTable0(e);
|
|
101
|
+
wasm.__wbindgen_exn_store(idx);
|
|
102
|
+
}
|
|
46
103
|
}
|
|
47
104
|
|
|
48
105
|
function getArrayU8FromWasm0(ptr, len) {
|
|
@@ -50,7 +107,9 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
50
107
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
51
108
|
}
|
|
52
109
|
|
|
53
|
-
|
|
110
|
+
function isLikeNone(x) {
|
|
111
|
+
return x === undefined || x === null;
|
|
112
|
+
}
|
|
54
113
|
|
|
55
114
|
function passArray8ToWasm0(arg, malloc) {
|
|
56
115
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
@@ -59,8 +118,24 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
59
118
|
return ptr;
|
|
60
119
|
}
|
|
61
120
|
|
|
121
|
+
let cachedBigUint64ArrayMemory0 = null;
|
|
122
|
+
|
|
123
|
+
function getBigUint64ArrayMemory0() {
|
|
124
|
+
if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) {
|
|
125
|
+
cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer);
|
|
126
|
+
}
|
|
127
|
+
return cachedBigUint64ArrayMemory0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function passArray64ToWasm0(arg, malloc) {
|
|
131
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
132
|
+
getBigUint64ArrayMemory0().set(arg, ptr / 8);
|
|
133
|
+
WASM_VECTOR_LEN = arg.length;
|
|
134
|
+
return ptr;
|
|
135
|
+
}
|
|
136
|
+
|
|
62
137
|
function takeFromExternrefTable0(idx) {
|
|
63
|
-
const value = wasm.
|
|
138
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
64
139
|
wasm.__externref_table_dealloc(idx);
|
|
65
140
|
return value;
|
|
66
141
|
}
|
|
@@ -86,36 +161,70 @@ function takeFromExternrefTable0(idx) {
|
|
|
86
161
|
* @param {Uint8Array} public_key
|
|
87
162
|
* @param {number} degree
|
|
88
163
|
* @param {bigint} plaintext_modulus
|
|
89
|
-
* @param {
|
|
164
|
+
* @param {BigUint64Array} moduli
|
|
90
165
|
* @returns {Uint8Array}
|
|
91
166
|
*/
|
|
92
|
-
|
|
167
|
+
exports.bfv_encrypt_number = function(data, public_key, degree, plaintext_modulus, moduli) {
|
|
93
168
|
const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
|
|
94
169
|
const len0 = WASM_VECTOR_LEN;
|
|
95
|
-
const
|
|
170
|
+
const ptr1 = passArray64ToWasm0(moduli, wasm.__wbindgen_malloc);
|
|
171
|
+
const len1 = WASM_VECTOR_LEN;
|
|
172
|
+
const ret = wasm.bfv_encrypt_number(data, ptr0, len0, degree, plaintext_modulus, ptr1, len1);
|
|
96
173
|
if (ret[3]) {
|
|
97
174
|
throw takeFromExternrefTable0(ret[2]);
|
|
98
175
|
}
|
|
99
|
-
var
|
|
176
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
100
177
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
101
|
-
return
|
|
178
|
+
return v3;
|
|
102
179
|
};
|
|
103
180
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
181
|
+
/**
|
|
182
|
+
* A function to encrypt a Vec<u64> value using BFV and default params.
|
|
183
|
+
*
|
|
184
|
+
* # Arguments
|
|
185
|
+
*
|
|
186
|
+
* * `data` - The data to encrypt - must be a Vec<u64>
|
|
187
|
+
* * `public_key` - The public key to be used for encryption
|
|
188
|
+
* * `degree` - Polynomial degree for BFV parameters
|
|
189
|
+
* * `plaintext_modulus` - Plaintext modulus for BFV parameters
|
|
190
|
+
* * `moduli` - Modulus for BFV parameters
|
|
191
|
+
*
|
|
192
|
+
* # Returns
|
|
193
|
+
*
|
|
194
|
+
* Returns a `Result<Vec<u8>, JsValue>` containing the encrypted data and any errors.
|
|
195
|
+
*
|
|
196
|
+
* # Panics
|
|
197
|
+
*
|
|
198
|
+
* Panics if the data cannot be encrypted
|
|
199
|
+
* @param {BigUint64Array} data
|
|
200
|
+
* @param {Uint8Array} public_key
|
|
201
|
+
* @param {number} degree
|
|
202
|
+
* @param {bigint} plaintext_modulus
|
|
203
|
+
* @param {BigUint64Array} moduli
|
|
204
|
+
* @returns {Uint8Array}
|
|
205
|
+
*/
|
|
206
|
+
exports.bfv_encrypt_vector = function(data, public_key, degree, plaintext_modulus, moduli) {
|
|
207
|
+
const ptr0 = passArray64ToWasm0(data, wasm.__wbindgen_malloc);
|
|
208
|
+
const len0 = WASM_VECTOR_LEN;
|
|
209
|
+
const ptr1 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
|
|
210
|
+
const len1 = WASM_VECTOR_LEN;
|
|
211
|
+
const ptr2 = passArray64ToWasm0(moduli, wasm.__wbindgen_malloc);
|
|
212
|
+
const len2 = WASM_VECTOR_LEN;
|
|
213
|
+
const ret = wasm.bfv_encrypt_vector(ptr0, len0, ptr1, len1, degree, plaintext_modulus, ptr2, len2);
|
|
214
|
+
if (ret[3]) {
|
|
215
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
109
216
|
}
|
|
110
|
-
|
|
111
|
-
|
|
217
|
+
var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
218
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
219
|
+
return v4;
|
|
220
|
+
};
|
|
112
221
|
|
|
113
222
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
114
223
|
ptr = ptr >>> 0;
|
|
115
224
|
const mem = getDataViewMemory0();
|
|
116
225
|
const result = [];
|
|
117
226
|
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
118
|
-
result.push(wasm.
|
|
227
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
119
228
|
}
|
|
120
229
|
wasm.__externref_drop_slice(ptr, len);
|
|
121
230
|
return result;
|
|
@@ -143,183 +252,308 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
143
252
|
* @param {Uint8Array} public_key
|
|
144
253
|
* @param {number} degree
|
|
145
254
|
* @param {bigint} plaintext_modulus
|
|
146
|
-
* @param {
|
|
255
|
+
* @param {BigUint64Array} moduli
|
|
147
256
|
* @returns {any[]}
|
|
148
257
|
*/
|
|
149
|
-
|
|
258
|
+
exports.bfv_verifiable_encrypt_number = function(data, public_key, degree, plaintext_modulus, moduli) {
|
|
150
259
|
const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
|
|
151
260
|
const len0 = WASM_VECTOR_LEN;
|
|
152
|
-
const
|
|
261
|
+
const ptr1 = passArray64ToWasm0(moduli, wasm.__wbindgen_malloc);
|
|
262
|
+
const len1 = WASM_VECTOR_LEN;
|
|
263
|
+
const ret = wasm.bfv_verifiable_encrypt_number(data, ptr0, len0, degree, plaintext_modulus, ptr1, len1);
|
|
264
|
+
if (ret[3]) {
|
|
265
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
266
|
+
}
|
|
267
|
+
var v3 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
268
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
269
|
+
return v3;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* A function to encrypt a Vec<u64> value using BFV and default params and
|
|
274
|
+
* generate circuit inputs for Greco
|
|
275
|
+
*
|
|
276
|
+
* # Arguments
|
|
277
|
+
*
|
|
278
|
+
* * `data` - The data to encrypt - must be a Vec<u64>
|
|
279
|
+
* * `public_key` - The public key to be used for encryption
|
|
280
|
+
* * `degree` - Polynomial degree for BFV parameters
|
|
281
|
+
* * `plaintext_modulus` - Plaintext modulus for BFV parameters
|
|
282
|
+
* * `moduli` - Modulus for BFV parameters
|
|
283
|
+
*
|
|
284
|
+
* # Returns
|
|
285
|
+
*
|
|
286
|
+
* Returns a `Result<Vec<JsValue>, JsValue>` containing the encrypted data, circuit inputs and any errors.
|
|
287
|
+
*
|
|
288
|
+
* # Panics
|
|
289
|
+
*
|
|
290
|
+
* Panics if the data cannot be encrypted
|
|
291
|
+
* @param {BigUint64Array} data
|
|
292
|
+
* @param {Uint8Array} public_key
|
|
293
|
+
* @param {number} degree
|
|
294
|
+
* @param {bigint} plaintext_modulus
|
|
295
|
+
* @param {BigUint64Array} moduli
|
|
296
|
+
* @returns {any[]}
|
|
297
|
+
*/
|
|
298
|
+
exports.bfv_verifiable_encrypt_vector = function(data, public_key, degree, plaintext_modulus, moduli) {
|
|
299
|
+
const ptr0 = passArray64ToWasm0(data, wasm.__wbindgen_malloc);
|
|
300
|
+
const len0 = WASM_VECTOR_LEN;
|
|
301
|
+
const ptr1 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
|
|
302
|
+
const len1 = WASM_VECTOR_LEN;
|
|
303
|
+
const ptr2 = passArray64ToWasm0(moduli, wasm.__wbindgen_malloc);
|
|
304
|
+
const len2 = WASM_VECTOR_LEN;
|
|
305
|
+
const ret = wasm.bfv_verifiable_encrypt_vector(ptr0, len0, ptr1, len1, degree, plaintext_modulus, ptr2, len2);
|
|
153
306
|
if (ret[3]) {
|
|
154
307
|
throw takeFromExternrefTable0(ret[2]);
|
|
155
308
|
}
|
|
156
|
-
var
|
|
309
|
+
var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
310
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
311
|
+
return v4;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Retrieves a BFV parameter set by name.
|
|
316
|
+
*
|
|
317
|
+
* # Parameters
|
|
318
|
+
* * `name` - Parameter set identifier (e.g., "SET_8192_1000_4")
|
|
319
|
+
*
|
|
320
|
+
* # Returns
|
|
321
|
+
* A JavaScript object with the following structure:
|
|
322
|
+
* ```typescript
|
|
323
|
+
* {
|
|
324
|
+
* degree: number; // Polynomial degree (e.g., 8192)
|
|
325
|
+
* plaintext_modulus: number; // Plaintext modulus value (e.g., 1000)
|
|
326
|
+
* moduli: bigint[]; // Array of moduli
|
|
327
|
+
* error1_variance: string | null; // Error variance as string or null
|
|
328
|
+
* }
|
|
329
|
+
* ```
|
|
330
|
+
*
|
|
331
|
+
* # Errors
|
|
332
|
+
* Returns error if the parameter set name is invalid or serialization fails.
|
|
333
|
+
* @param {string} name
|
|
334
|
+
* @returns {any}
|
|
335
|
+
*/
|
|
336
|
+
exports.get_bfv_params = function(name) {
|
|
337
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
338
|
+
const len0 = WASM_VECTOR_LEN;
|
|
339
|
+
const ret = wasm.get_bfv_params(ptr0, len0);
|
|
340
|
+
if (ret[2]) {
|
|
341
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
342
|
+
}
|
|
343
|
+
return takeFromExternrefTable0(ret[0]);
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Returns all available BFV parameter set identifiers.
|
|
348
|
+
*
|
|
349
|
+
* # Returns
|
|
350
|
+
* Array of parameter set names that can be passed to `get_bfv_params()`.
|
|
351
|
+
* Includes both production-ready sets (e.g., "SET_8192_1000_4") and
|
|
352
|
+
* insecure sets for testing (prefixed with "INSECURE_").
|
|
353
|
+
* @returns {string[]}
|
|
354
|
+
*/
|
|
355
|
+
exports.get_bfv_params_list = function() {
|
|
356
|
+
const ret = wasm.get_bfv_params_list();
|
|
357
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
157
358
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
158
|
-
return
|
|
359
|
+
return v1;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
exports.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
363
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
364
|
+
return ret;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
368
|
+
const ret = String(arg1);
|
|
369
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
370
|
+
const len1 = WASM_VECTOR_LEN;
|
|
371
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
372
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
exports.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
376
|
+
const ret = typeof(arg0) === 'function';
|
|
377
|
+
return ret;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
exports.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
381
|
+
const val = arg0;
|
|
382
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
383
|
+
return ret;
|
|
159
384
|
};
|
|
160
385
|
|
|
161
|
-
|
|
162
|
-
const ret = arg0
|
|
386
|
+
exports.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
387
|
+
const ret = typeof(arg0) === 'string';
|
|
163
388
|
return ret;
|
|
164
389
|
};
|
|
165
390
|
|
|
166
|
-
|
|
391
|
+
exports.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
392
|
+
const ret = arg0 === undefined;
|
|
393
|
+
return ret;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
exports.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
397
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
exports.__wbg_call_525440f72fbfc0ea = function() { return handleError(function (arg0, arg1, arg2) {
|
|
167
401
|
const ret = arg0.call(arg1, arg2);
|
|
168
402
|
return ret;
|
|
169
403
|
}, arguments) };
|
|
170
404
|
|
|
171
|
-
|
|
405
|
+
exports.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
|
|
172
406
|
const ret = arg0.call(arg1);
|
|
173
407
|
return ret;
|
|
174
408
|
}, arguments) };
|
|
175
409
|
|
|
176
|
-
|
|
410
|
+
exports.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
177
411
|
const ret = arg0.crypto;
|
|
178
412
|
return ret;
|
|
179
413
|
};
|
|
180
414
|
|
|
181
|
-
|
|
415
|
+
exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
182
416
|
arg0.getRandomValues(arg1);
|
|
183
417
|
}, arguments) };
|
|
184
418
|
|
|
185
|
-
|
|
419
|
+
exports.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
420
|
+
const ret = arg0.length;
|
|
421
|
+
return ret;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
exports.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
186
425
|
const ret = arg0.msCrypto;
|
|
187
426
|
return ret;
|
|
188
427
|
};
|
|
189
428
|
|
|
190
|
-
|
|
191
|
-
const ret = new
|
|
429
|
+
exports.__wbg_new_1acc0b6eea89d040 = function() {
|
|
430
|
+
const ret = new Object();
|
|
192
431
|
return ret;
|
|
193
432
|
};
|
|
194
433
|
|
|
195
|
-
|
|
196
|
-
const ret = new
|
|
434
|
+
exports.__wbg_new_e17d9f43105b08be = function() {
|
|
435
|
+
const ret = new Array();
|
|
197
436
|
return ret;
|
|
198
437
|
};
|
|
199
438
|
|
|
200
|
-
|
|
201
|
-
const ret = new
|
|
439
|
+
exports.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
|
|
440
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
202
441
|
return ret;
|
|
203
442
|
};
|
|
204
443
|
|
|
205
|
-
|
|
444
|
+
exports.__wbg_new_with_length_01aa0dc35aa13543 = function(arg0) {
|
|
206
445
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
207
446
|
return ret;
|
|
208
447
|
};
|
|
209
448
|
|
|
210
|
-
|
|
449
|
+
exports.__wbg_node_905d3e251edff8a2 = function(arg0) {
|
|
211
450
|
const ret = arg0.node;
|
|
212
451
|
return ret;
|
|
213
452
|
};
|
|
214
453
|
|
|
215
|
-
|
|
454
|
+
exports.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
|
|
216
455
|
const ret = arg0.process;
|
|
217
456
|
return ret;
|
|
218
457
|
};
|
|
219
458
|
|
|
220
|
-
|
|
459
|
+
exports.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
460
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
exports.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
|
|
221
464
|
arg0.randomFillSync(arg1);
|
|
222
465
|
}, arguments) };
|
|
223
466
|
|
|
224
|
-
|
|
467
|
+
exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
|
|
225
468
|
const ret = module.require;
|
|
226
469
|
return ret;
|
|
227
470
|
}, arguments) };
|
|
228
471
|
|
|
229
|
-
|
|
230
|
-
arg0
|
|
472
|
+
exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
473
|
+
arg0[arg1] = arg2;
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
exports.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
477
|
+
arg0[arg1 >>> 0] = arg2;
|
|
231
478
|
};
|
|
232
479
|
|
|
233
|
-
|
|
480
|
+
exports.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {
|
|
234
481
|
const ret = typeof global === 'undefined' ? null : global;
|
|
235
482
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
236
483
|
};
|
|
237
484
|
|
|
238
|
-
|
|
485
|
+
exports.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {
|
|
239
486
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
240
487
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
241
488
|
};
|
|
242
489
|
|
|
243
|
-
|
|
490
|
+
exports.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {
|
|
244
491
|
const ret = typeof self === 'undefined' ? null : self;
|
|
245
492
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
246
493
|
};
|
|
247
494
|
|
|
248
|
-
|
|
495
|
+
exports.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {
|
|
249
496
|
const ret = typeof window === 'undefined' ? null : window;
|
|
250
497
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
251
498
|
};
|
|
252
499
|
|
|
253
|
-
|
|
500
|
+
exports.__wbg_subarray_480600f3d6a9f26c = function(arg0, arg1, arg2) {
|
|
254
501
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
255
502
|
return ret;
|
|
256
503
|
};
|
|
257
504
|
|
|
258
|
-
|
|
505
|
+
exports.__wbg_versions_c01dfd4722a88165 = function(arg0) {
|
|
259
506
|
const ret = arg0.versions;
|
|
260
507
|
return ret;
|
|
261
508
|
};
|
|
262
509
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
table.set(0, undefined);
|
|
267
|
-
table.set(offset + 0, undefined);
|
|
268
|
-
table.set(offset + 1, null);
|
|
269
|
-
table.set(offset + 2, true);
|
|
270
|
-
table.set(offset + 3, false);
|
|
271
|
-
;
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
module.exports.__wbindgen_is_function = function(arg0) {
|
|
275
|
-
const ret = typeof(arg0) === 'function';
|
|
276
|
-
return ret;
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
module.exports.__wbindgen_is_object = function(arg0) {
|
|
280
|
-
const val = arg0;
|
|
281
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
510
|
+
exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
511
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
512
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
282
513
|
return ret;
|
|
283
514
|
};
|
|
284
515
|
|
|
285
|
-
|
|
286
|
-
|
|
516
|
+
exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
517
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
518
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
287
519
|
return ret;
|
|
288
520
|
};
|
|
289
521
|
|
|
290
|
-
|
|
291
|
-
|
|
522
|
+
exports.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
|
|
523
|
+
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
524
|
+
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
525
|
+
// Cast intrinsic for `Vector(U8) -> Externref`.
|
|
526
|
+
const ret = v0;
|
|
292
527
|
return ret;
|
|
293
528
|
};
|
|
294
529
|
|
|
295
|
-
|
|
296
|
-
|
|
530
|
+
exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
531
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
532
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
297
533
|
return ret;
|
|
298
534
|
};
|
|
299
535
|
|
|
300
|
-
|
|
301
|
-
|
|
536
|
+
exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
537
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
538
|
+
const ret = arg0;
|
|
302
539
|
return ret;
|
|
303
540
|
};
|
|
304
541
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
542
|
+
exports.__wbindgen_init_externref_table = function() {
|
|
543
|
+
const table = wasm.__wbindgen_externrefs;
|
|
544
|
+
const offset = table.grow(4);
|
|
545
|
+
table.set(0, undefined);
|
|
546
|
+
table.set(offset + 0, undefined);
|
|
547
|
+
table.set(offset + 1, null);
|
|
548
|
+
table.set(offset + 2, true);
|
|
549
|
+
table.set(offset + 3, false);
|
|
550
|
+
;
|
|
314
551
|
};
|
|
315
552
|
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
321
|
-
wasm = wasmInstance.exports;
|
|
322
|
-
module.exports.__wasm = wasm;
|
|
553
|
+
const wasmPath = `${__dirname}/e3_wasm_bg.wasm`;
|
|
554
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
555
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
556
|
+
const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
|
|
323
557
|
|
|
324
558
|
wasm.__wbindgen_start();
|
|
325
559
|
|
|
Binary file
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const bfv_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f:
|
|
5
|
-
export const
|
|
4
|
+
export const bfv_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f: number, g: number) => [number, number, number, number];
|
|
5
|
+
export const bfv_encrypt_vector: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number) => [number, number, number, number];
|
|
6
|
+
export const bfv_verifiable_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f: number, g: number) => [number, number, number, number];
|
|
7
|
+
export const bfv_verifiable_encrypt_vector: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number) => [number, number, number, number];
|
|
8
|
+
export const get_bfv_params: (a: number, b: number) => [number, number, number];
|
|
9
|
+
export const get_bfv_params_list: () => [number, number];
|
|
10
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
11
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
6
12
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
7
13
|
export const __externref_table_alloc: () => number;
|
|
8
|
-
export const
|
|
14
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
9
15
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
10
|
-
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
11
16
|
export const __externref_table_dealloc: (a: number) => void;
|
|
12
17
|
export const __externref_drop_slice: (a: number, b: number) => void;
|
|
13
18
|
export const __wbindgen_start: () => void;
|