@enclave-e3/wasm 0.0.8-test → 0.0.9-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/.gitignore +1 -0
- package/dist/nodejs/e3_wasm.d.ts +43 -0
- package/dist/nodejs/e3_wasm_bg.wasm +0 -0
- package/dist/nodejs/e3_wasm_bg.wasm.d.ts +13 -0
- package/dist/nodejs/package.json +17 -0
- package/dist/web/.gitignore +1 -0
- package/dist/web/e3_wasm.d.ts +80 -0
- package/dist/web/e3_wasm.js +385 -0
- package/dist/web/e3_wasm_bg.wasm +0 -0
- package/dist/web/e3_wasm_bg.wasm.d.ts +13 -0
- package/dist/web/package.json +21 -0
- package/package.json +3 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* A function to encrypt a u64 value using BFV and default params.
|
|
5
|
+
*
|
|
6
|
+
* # Arguments
|
|
7
|
+
*
|
|
8
|
+
* * `data` - The data to encrypt - must be a u64
|
|
9
|
+
* * `public_key` - The public key to be used for encryption
|
|
10
|
+
* * `degree` - Polynomial degree for BFV parameters
|
|
11
|
+
* * `plaintext_modulus` - Plaintext modulus for BFV parameters
|
|
12
|
+
* * `moduli` - Modulus for BFV parameters
|
|
13
|
+
*
|
|
14
|
+
* # Returns
|
|
15
|
+
*
|
|
16
|
+
* Returns a `Result<Vec<u8>, JsValue>` containing the encrypted data and any errors.
|
|
17
|
+
*
|
|
18
|
+
* # Panics
|
|
19
|
+
*
|
|
20
|
+
* Panics if the data cannot be encrypted
|
|
21
|
+
*/
|
|
22
|
+
export function bfv_encrypt_number(data: bigint, public_key: Uint8Array, degree: number, plaintext_modulus: bigint, moduli: bigint): Uint8Array;
|
|
23
|
+
/**
|
|
24
|
+
* A function to encrypt a u64 value using BFV and default params and
|
|
25
|
+
* generate circuit inputs for Greco
|
|
26
|
+
*
|
|
27
|
+
* # Arguments
|
|
28
|
+
*
|
|
29
|
+
* * `data` - The data to encrypt - must be a u64
|
|
30
|
+
* * `public_key` - The public key to be used for encryption
|
|
31
|
+
* * `degree` - Polynomial degree for BFV parameters
|
|
32
|
+
* * `plaintext_modulus` - Plaintext modulus for BFV parameters
|
|
33
|
+
* * `moduli` - Modulus for BFV parameters
|
|
34
|
+
*
|
|
35
|
+
* # Returns
|
|
36
|
+
*
|
|
37
|
+
* Returns a `Result<Vec<JsValue>, JsValue>` containing the encrypted data, circuit inputs and any errors.
|
|
38
|
+
*
|
|
39
|
+
* # Panics
|
|
40
|
+
*
|
|
41
|
+
* Panics if the data cannot be encrypted
|
|
42
|
+
*/
|
|
43
|
+
export function bfv_verifiable_encrypt_number(data: bigint, public_key: Uint8Array, degree: number, plaintext_modulus: bigint, moduli: bigint): any[];
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const bfv_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f: bigint) => [number, number, number, number];
|
|
5
|
+
export const bfv_verifiable_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f: bigint) => [number, number, number, number];
|
|
6
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
7
|
+
export const __externref_table_alloc: () => number;
|
|
8
|
+
export const __wbindgen_export_2: WebAssembly.Table;
|
|
9
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
10
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
11
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
12
|
+
export const __externref_drop_slice: (a: number, b: number) => void;
|
|
13
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "e3-wasm",
|
|
3
|
+
"description": "E3 — Encrypted Execution Environments",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"license": "LGPL-3.0-only",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/gnosisguild/enclave"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"e3_wasm_bg.wasm",
|
|
12
|
+
"e3_wasm.js",
|
|
13
|
+
"e3_wasm.d.ts"
|
|
14
|
+
],
|
|
15
|
+
"main": "e3_wasm.js",
|
|
16
|
+
"types": "e3_wasm.d.ts"
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* A function to encrypt a u64 value using BFV and default params.
|
|
5
|
+
*
|
|
6
|
+
* # Arguments
|
|
7
|
+
*
|
|
8
|
+
* * `data` - The data to encrypt - must be a u64
|
|
9
|
+
* * `public_key` - The public key to be used for encryption
|
|
10
|
+
* * `degree` - Polynomial degree for BFV parameters
|
|
11
|
+
* * `plaintext_modulus` - Plaintext modulus for BFV parameters
|
|
12
|
+
* * `moduli` - Modulus for BFV parameters
|
|
13
|
+
*
|
|
14
|
+
* # Returns
|
|
15
|
+
*
|
|
16
|
+
* Returns a `Result<Vec<u8>, JsValue>` containing the encrypted data and any errors.
|
|
17
|
+
*
|
|
18
|
+
* # Panics
|
|
19
|
+
*
|
|
20
|
+
* Panics if the data cannot be encrypted
|
|
21
|
+
*/
|
|
22
|
+
export function bfv_encrypt_number(data: bigint, public_key: Uint8Array, degree: number, plaintext_modulus: bigint, moduli: bigint): Uint8Array;
|
|
23
|
+
/**
|
|
24
|
+
* A function to encrypt a u64 value using BFV and default params and
|
|
25
|
+
* generate circuit inputs for Greco
|
|
26
|
+
*
|
|
27
|
+
* # Arguments
|
|
28
|
+
*
|
|
29
|
+
* * `data` - The data to encrypt - must be a u64
|
|
30
|
+
* * `public_key` - The public key to be used for encryption
|
|
31
|
+
* * `degree` - Polynomial degree for BFV parameters
|
|
32
|
+
* * `plaintext_modulus` - Plaintext modulus for BFV parameters
|
|
33
|
+
* * `moduli` - Modulus for BFV parameters
|
|
34
|
+
*
|
|
35
|
+
* # Returns
|
|
36
|
+
*
|
|
37
|
+
* Returns a `Result<Vec<JsValue>, JsValue>` containing the encrypted data, circuit inputs and any errors.
|
|
38
|
+
*
|
|
39
|
+
* # Panics
|
|
40
|
+
*
|
|
41
|
+
* Panics if the data cannot be encrypted
|
|
42
|
+
*/
|
|
43
|
+
export function bfv_verifiable_encrypt_number(data: bigint, public_key: Uint8Array, degree: number, plaintext_modulus: bigint, moduli: bigint): any[];
|
|
44
|
+
|
|
45
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
46
|
+
|
|
47
|
+
export interface InitOutput {
|
|
48
|
+
readonly memory: WebAssembly.Memory;
|
|
49
|
+
readonly bfv_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f: bigint) => [number, number, number, number];
|
|
50
|
+
readonly bfv_verifiable_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f: bigint) => [number, number, number, number];
|
|
51
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
52
|
+
readonly __externref_table_alloc: () => number;
|
|
53
|
+
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
54
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
55
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
56
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
57
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
58
|
+
readonly __wbindgen_start: () => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
62
|
+
/**
|
|
63
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
64
|
+
* a precompiled `WebAssembly.Module`.
|
|
65
|
+
*
|
|
66
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
67
|
+
*
|
|
68
|
+
* @returns {InitOutput}
|
|
69
|
+
*/
|
|
70
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
74
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
75
|
+
*
|
|
76
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
77
|
+
*
|
|
78
|
+
* @returns {Promise<InitOutput>}
|
|
79
|
+
*/
|
|
80
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
function addToExternrefTable0(obj) {
|
|
4
|
+
const idx = wasm.__externref_table_alloc();
|
|
5
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
6
|
+
return idx;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function handleError(f, args) {
|
|
10
|
+
try {
|
|
11
|
+
return f.apply(this, args);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
const idx = addToExternrefTable0(e);
|
|
14
|
+
wasm.__wbindgen_exn_store(idx);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
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
|
+
let cachedUint8ArrayMemory0 = null;
|
|
23
|
+
|
|
24
|
+
function getUint8ArrayMemory0() {
|
|
25
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
26
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
27
|
+
}
|
|
28
|
+
return cachedUint8ArrayMemory0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getStringFromWasm0(ptr, len) {
|
|
32
|
+
ptr = ptr >>> 0;
|
|
33
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function isLikeNone(x) {
|
|
37
|
+
return x === undefined || x === null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
41
|
+
ptr = ptr >>> 0;
|
|
42
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let WASM_VECTOR_LEN = 0;
|
|
46
|
+
|
|
47
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
48
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
49
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
50
|
+
WASM_VECTOR_LEN = arg.length;
|
|
51
|
+
return ptr;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function takeFromExternrefTable0(idx) {
|
|
55
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
56
|
+
wasm.__externref_table_dealloc(idx);
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A function to encrypt a u64 value using BFV and default params.
|
|
61
|
+
*
|
|
62
|
+
* # Arguments
|
|
63
|
+
*
|
|
64
|
+
* * `data` - The data to encrypt - must be a u64
|
|
65
|
+
* * `public_key` - The public key to be used for encryption
|
|
66
|
+
* * `degree` - Polynomial degree for BFV parameters
|
|
67
|
+
* * `plaintext_modulus` - Plaintext modulus for BFV parameters
|
|
68
|
+
* * `moduli` - Modulus for BFV parameters
|
|
69
|
+
*
|
|
70
|
+
* # Returns
|
|
71
|
+
*
|
|
72
|
+
* Returns a `Result<Vec<u8>, JsValue>` containing the encrypted data and any errors.
|
|
73
|
+
*
|
|
74
|
+
* # Panics
|
|
75
|
+
*
|
|
76
|
+
* Panics if the data cannot be encrypted
|
|
77
|
+
* @param {bigint} data
|
|
78
|
+
* @param {Uint8Array} public_key
|
|
79
|
+
* @param {number} degree
|
|
80
|
+
* @param {bigint} plaintext_modulus
|
|
81
|
+
* @param {bigint} moduli
|
|
82
|
+
* @returns {Uint8Array}
|
|
83
|
+
*/
|
|
84
|
+
export function bfv_encrypt_number(data, public_key, degree, plaintext_modulus, moduli) {
|
|
85
|
+
const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
|
|
86
|
+
const len0 = WASM_VECTOR_LEN;
|
|
87
|
+
const ret = wasm.bfv_encrypt_number(data, ptr0, len0, degree, plaintext_modulus, moduli);
|
|
88
|
+
if (ret[3]) {
|
|
89
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
90
|
+
}
|
|
91
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
92
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
93
|
+
return v2;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let cachedDataViewMemory0 = null;
|
|
97
|
+
|
|
98
|
+
function getDataViewMemory0() {
|
|
99
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
100
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
101
|
+
}
|
|
102
|
+
return cachedDataViewMemory0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
106
|
+
ptr = ptr >>> 0;
|
|
107
|
+
const mem = getDataViewMemory0();
|
|
108
|
+
const result = [];
|
|
109
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
110
|
+
result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
|
|
111
|
+
}
|
|
112
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A function to encrypt a u64 value using BFV and default params and
|
|
117
|
+
* generate circuit inputs for Greco
|
|
118
|
+
*
|
|
119
|
+
* # Arguments
|
|
120
|
+
*
|
|
121
|
+
* * `data` - The data to encrypt - must be a u64
|
|
122
|
+
* * `public_key` - The public key to be used for encryption
|
|
123
|
+
* * `degree` - Polynomial degree for BFV parameters
|
|
124
|
+
* * `plaintext_modulus` - Plaintext modulus for BFV parameters
|
|
125
|
+
* * `moduli` - Modulus for BFV parameters
|
|
126
|
+
*
|
|
127
|
+
* # Returns
|
|
128
|
+
*
|
|
129
|
+
* Returns a `Result<Vec<JsValue>, JsValue>` containing the encrypted data, circuit inputs and any errors.
|
|
130
|
+
*
|
|
131
|
+
* # Panics
|
|
132
|
+
*
|
|
133
|
+
* Panics if the data cannot be encrypted
|
|
134
|
+
* @param {bigint} data
|
|
135
|
+
* @param {Uint8Array} public_key
|
|
136
|
+
* @param {number} degree
|
|
137
|
+
* @param {bigint} plaintext_modulus
|
|
138
|
+
* @param {bigint} moduli
|
|
139
|
+
* @returns {any[]}
|
|
140
|
+
*/
|
|
141
|
+
export function bfv_verifiable_encrypt_number(data, public_key, degree, plaintext_modulus, moduli) {
|
|
142
|
+
const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
|
|
143
|
+
const len0 = WASM_VECTOR_LEN;
|
|
144
|
+
const ret = wasm.bfv_verifiable_encrypt_number(data, ptr0, len0, degree, plaintext_modulus, moduli);
|
|
145
|
+
if (ret[3]) {
|
|
146
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
147
|
+
}
|
|
148
|
+
var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
149
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
150
|
+
return v2;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async function __wbg_load(module, imports) {
|
|
154
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
155
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
156
|
+
try {
|
|
157
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
158
|
+
|
|
159
|
+
} catch (e) {
|
|
160
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
161
|
+
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
|
+
|
|
163
|
+
} else {
|
|
164
|
+
throw e;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const bytes = await module.arrayBuffer();
|
|
170
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
171
|
+
|
|
172
|
+
} else {
|
|
173
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
174
|
+
|
|
175
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
176
|
+
return { instance, module };
|
|
177
|
+
|
|
178
|
+
} else {
|
|
179
|
+
return instance;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function __wbg_get_imports() {
|
|
185
|
+
const imports = {};
|
|
186
|
+
imports.wbg = {};
|
|
187
|
+
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
188
|
+
const ret = arg0.buffer;
|
|
189
|
+
return ret;
|
|
190
|
+
};
|
|
191
|
+
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
192
|
+
const ret = arg0.call(arg1);
|
|
193
|
+
return ret;
|
|
194
|
+
}, arguments) };
|
|
195
|
+
imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
196
|
+
const ret = arg0.call(arg1, arg2);
|
|
197
|
+
return ret;
|
|
198
|
+
}, arguments) };
|
|
199
|
+
imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
200
|
+
const ret = arg0.crypto;
|
|
201
|
+
return ret;
|
|
202
|
+
};
|
|
203
|
+
imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
204
|
+
arg0.getRandomValues(arg1);
|
|
205
|
+
}, arguments) };
|
|
206
|
+
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
207
|
+
const ret = arg0.msCrypto;
|
|
208
|
+
return ret;
|
|
209
|
+
};
|
|
210
|
+
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
211
|
+
const ret = new Uint8Array(arg0);
|
|
212
|
+
return ret;
|
|
213
|
+
};
|
|
214
|
+
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
215
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
216
|
+
return ret;
|
|
217
|
+
};
|
|
218
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
219
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
220
|
+
return ret;
|
|
221
|
+
};
|
|
222
|
+
imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
223
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
224
|
+
return ret;
|
|
225
|
+
};
|
|
226
|
+
imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
|
|
227
|
+
const ret = arg0.node;
|
|
228
|
+
return ret;
|
|
229
|
+
};
|
|
230
|
+
imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
|
|
231
|
+
const ret = arg0.process;
|
|
232
|
+
return ret;
|
|
233
|
+
};
|
|
234
|
+
imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
|
|
235
|
+
arg0.randomFillSync(arg1);
|
|
236
|
+
}, arguments) };
|
|
237
|
+
imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
|
|
238
|
+
const ret = module.require;
|
|
239
|
+
return ret;
|
|
240
|
+
}, arguments) };
|
|
241
|
+
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
242
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
243
|
+
};
|
|
244
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
245
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
246
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
247
|
+
};
|
|
248
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
249
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
250
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
251
|
+
};
|
|
252
|
+
imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
253
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
254
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
255
|
+
};
|
|
256
|
+
imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
257
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
258
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
259
|
+
};
|
|
260
|
+
imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
261
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
262
|
+
return ret;
|
|
263
|
+
};
|
|
264
|
+
imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
|
|
265
|
+
const ret = arg0.versions;
|
|
266
|
+
return ret;
|
|
267
|
+
};
|
|
268
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
269
|
+
const table = wasm.__wbindgen_export_2;
|
|
270
|
+
const offset = table.grow(4);
|
|
271
|
+
table.set(0, undefined);
|
|
272
|
+
table.set(offset + 0, undefined);
|
|
273
|
+
table.set(offset + 1, null);
|
|
274
|
+
table.set(offset + 2, true);
|
|
275
|
+
table.set(offset + 3, false);
|
|
276
|
+
;
|
|
277
|
+
};
|
|
278
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
279
|
+
const ret = typeof(arg0) === 'function';
|
|
280
|
+
return ret;
|
|
281
|
+
};
|
|
282
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
283
|
+
const val = arg0;
|
|
284
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
285
|
+
return ret;
|
|
286
|
+
};
|
|
287
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
288
|
+
const ret = typeof(arg0) === 'string';
|
|
289
|
+
return ret;
|
|
290
|
+
};
|
|
291
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
292
|
+
const ret = arg0 === undefined;
|
|
293
|
+
return ret;
|
|
294
|
+
};
|
|
295
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
296
|
+
const ret = wasm.memory;
|
|
297
|
+
return ret;
|
|
298
|
+
};
|
|
299
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
300
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
301
|
+
return ret;
|
|
302
|
+
};
|
|
303
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
304
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
305
|
+
};
|
|
306
|
+
imports.wbg.__wbindgen_uint8_array_new = function(arg0, arg1) {
|
|
307
|
+
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
308
|
+
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
309
|
+
const ret = v0;
|
|
310
|
+
return ret;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
return imports;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function __wbg_init_memory(imports, memory) {
|
|
317
|
+
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function __wbg_finalize_init(instance, module) {
|
|
321
|
+
wasm = instance.exports;
|
|
322
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
323
|
+
cachedDataViewMemory0 = null;
|
|
324
|
+
cachedUint8ArrayMemory0 = null;
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
wasm.__wbindgen_start();
|
|
328
|
+
return wasm;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function initSync(module) {
|
|
332
|
+
if (wasm !== undefined) return wasm;
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
if (typeof module !== 'undefined') {
|
|
336
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
337
|
+
({module} = module)
|
|
338
|
+
} else {
|
|
339
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const imports = __wbg_get_imports();
|
|
344
|
+
|
|
345
|
+
__wbg_init_memory(imports);
|
|
346
|
+
|
|
347
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
348
|
+
module = new WebAssembly.Module(module);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
352
|
+
|
|
353
|
+
return __wbg_finalize_init(instance, module);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
async function __wbg_init(module_or_path) {
|
|
357
|
+
if (wasm !== undefined) return wasm;
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
if (typeof module_or_path !== 'undefined') {
|
|
361
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
362
|
+
({module_or_path} = module_or_path)
|
|
363
|
+
} else {
|
|
364
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (typeof module_or_path === 'undefined') {
|
|
369
|
+
module_or_path = new URL('e3_wasm_bg.wasm', import.meta.url);
|
|
370
|
+
}
|
|
371
|
+
const imports = __wbg_get_imports();
|
|
372
|
+
|
|
373
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
374
|
+
module_or_path = fetch(module_or_path);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
__wbg_init_memory(imports);
|
|
378
|
+
|
|
379
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
380
|
+
|
|
381
|
+
return __wbg_finalize_init(instance, module);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export { initSync };
|
|
385
|
+
export default __wbg_init;
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const bfv_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f: bigint) => [number, number, number, number];
|
|
5
|
+
export const bfv_verifiable_encrypt_number: (a: bigint, b: number, c: number, d: number, e: bigint, f: bigint) => [number, number, number, number];
|
|
6
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
7
|
+
export const __externref_table_alloc: () => number;
|
|
8
|
+
export const __wbindgen_export_2: WebAssembly.Table;
|
|
9
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
10
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
11
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
12
|
+
export const __externref_drop_slice: (a: number, b: number) => void;
|
|
13
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "e3-wasm",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"description": "E3 — Encrypted Execution Environments",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"license": "LGPL-3.0-only",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/gnosisguild/enclave"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"e3_wasm_bg.wasm",
|
|
13
|
+
"e3_wasm.js",
|
|
14
|
+
"e3_wasm.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"main": "e3_wasm.js",
|
|
17
|
+
"types": "e3_wasm.d.ts",
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./snippets/*"
|
|
20
|
+
]
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enclave-e3/wasm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9-test",
|
|
4
4
|
"description": "Wasm modules for enclave.",
|
|
5
5
|
"main": "dist/nodejs/e3_wasm.js",
|
|
6
6
|
"module": "dist/web/e3_wasm.js",
|
|
7
7
|
"types": "dist/web/e3_wasm.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist/",
|
|
10
|
+
"dist/nodejs/**",
|
|
11
|
+
"dist/web/**",
|
|
10
12
|
"init_node.js",
|
|
11
13
|
"init_node.cjs",
|
|
12
14
|
"init_web.js",
|