@noir-lang/acvm_js 0.46.0-7936262.nightly → 0.46.0
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/nodejs/acvm_js.d.ts +74 -74
- package/nodejs/acvm_js.js +629 -246
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +14 -12
- package/package.json +1 -1
- package/web/acvm_js.d.ts +88 -86
- package/web/acvm_js.js +571 -250
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +14 -12
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function
|
|
5
|
-
export function
|
|
6
|
-
export function compressWitnessStack(a: number, b: number): void;
|
|
7
|
-
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
8
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
9
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
10
|
-
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
4
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
5
|
+
export function buildInfo(): number;
|
|
11
6
|
export function and(a: number, b: number): number;
|
|
12
7
|
export function xor(a: number, b: number): number;
|
|
13
8
|
export function sha256(a: number, b: number, c: number): void;
|
|
@@ -15,6 +10,10 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
15
10
|
export function keccak256(a: number, b: number, c: number): void;
|
|
16
11
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
17
12
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
13
|
+
export function compressWitness(a: number, b: number): void;
|
|
14
|
+
export function decompressWitness(a: number, b: number, c: number): void;
|
|
15
|
+
export function compressWitnessStack(a: number, b: number): void;
|
|
16
|
+
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
18
17
|
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
19
18
|
export function createBlackBoxSolver(): number;
|
|
20
19
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
@@ -22,14 +21,17 @@ export function executeCircuitWithReturnWitness(a: number, b: number, c: number,
|
|
|
22
21
|
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
23
22
|
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
24
23
|
export function executeProgramWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
25
|
-
export function
|
|
26
|
-
export function
|
|
24
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
25
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
26
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
27
|
+
export function __wbg_trap_free(a: number): void;
|
|
28
|
+
export function trap___wbg_wasmer_trap(): void;
|
|
27
29
|
export function __wbindgen_malloc(a: number): number;
|
|
28
30
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
29
31
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
30
|
-
export function
|
|
32
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5258430255de068(a: number, b: number, c: number): void;
|
|
31
33
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
32
34
|
export function __wbindgen_free(a: number, b: number): void;
|
|
33
|
-
export function wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(a: number, b: number, c: number, d: number, e: number): void;
|
|
34
35
|
export function __wbindgen_exn_store(a: number): void;
|
|
35
|
-
export function
|
|
36
|
+
export function wasm_bindgen__convert__closures__invoke3_mut__h1e7d8ac96c74bd35(a: number, b: number, c: number, d: number, e: number): void;
|
|
37
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h188e918906ff9a40(a: number, b: number, c: number, d: number): void;
|
package/package.json
CHANGED
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,67 +1,16 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
7
|
-
* @returns {Uint8Array} A compressed witness map
|
|
8
|
-
*/
|
|
9
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
10
|
-
/**
|
|
11
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
12
|
-
* This should be used to only fetch the witness map for the main function.
|
|
13
|
-
*
|
|
14
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
15
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
16
|
-
*/
|
|
17
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
18
|
-
/**
|
|
19
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
20
|
-
*
|
|
21
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
22
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
23
|
-
*/
|
|
24
|
-
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
25
|
-
/**
|
|
26
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
27
|
-
*
|
|
28
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
29
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
30
|
-
*/
|
|
31
|
-
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
32
|
-
/**
|
|
33
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
34
|
-
*
|
|
35
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
36
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
37
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
38
|
-
* @param {Uint8Array} program
|
|
39
|
-
* @param {WitnessMap} witness_map
|
|
40
|
-
* @returns {WitnessMap}
|
|
41
|
-
*/
|
|
42
|
-
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
43
|
-
/**
|
|
44
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
4
|
+
* Sets the package's logging level.
|
|
45
5
|
*
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
48
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
49
|
-
* @param {Uint8Array} program
|
|
50
|
-
* @param {WitnessMap} solved_witness
|
|
51
|
-
* @returns {WitnessMap}
|
|
6
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
52
7
|
*/
|
|
53
|
-
export function
|
|
8
|
+
export function initLogLevel(filter: string): void;
|
|
54
9
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
58
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
59
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
60
|
-
* @param {Uint8Array} program
|
|
61
|
-
* @param {WitnessMap} solved_witness
|
|
62
|
-
* @returns {WitnessMap}
|
|
10
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
11
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
63
12
|
*/
|
|
64
|
-
export function
|
|
13
|
+
export function buildInfo(): BuildInfo;
|
|
65
14
|
/**
|
|
66
15
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
67
16
|
* @param {string} lhs
|
|
@@ -113,6 +62,35 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
113
62
|
*/
|
|
114
63
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
115
64
|
/**
|
|
65
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
66
|
+
*
|
|
67
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
68
|
+
* @returns {Uint8Array} A compressed witness map
|
|
69
|
+
*/
|
|
70
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
71
|
+
/**
|
|
72
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
73
|
+
* This should be used to only fetch the witness map for the main function.
|
|
74
|
+
*
|
|
75
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
76
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
77
|
+
*/
|
|
78
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
79
|
+
/**
|
|
80
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
81
|
+
*
|
|
82
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
83
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
84
|
+
*/
|
|
85
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
86
|
+
/**
|
|
87
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
88
|
+
*
|
|
89
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
90
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
91
|
+
*/
|
|
92
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
93
|
+
/**
|
|
116
94
|
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
117
95
|
*/
|
|
118
96
|
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
@@ -153,16 +131,38 @@ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap,
|
|
|
153
131
|
*/
|
|
154
132
|
export function executeProgramWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_executor: ForeignCallHandler): Promise<WitnessStack>;
|
|
155
133
|
/**
|
|
156
|
-
*
|
|
134
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
157
135
|
*
|
|
158
|
-
* @param {
|
|
136
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
137
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
138
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
139
|
+
* @param {Uint8Array} program
|
|
140
|
+
* @param {WitnessMap} witness_map
|
|
141
|
+
* @returns {WitnessMap}
|
|
159
142
|
*/
|
|
160
|
-
export function
|
|
143
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
161
144
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
145
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
146
|
+
*
|
|
147
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
148
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
149
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
150
|
+
* @param {Uint8Array} program
|
|
151
|
+
* @param {WitnessMap} solved_witness
|
|
152
|
+
* @returns {WitnessMap}
|
|
164
153
|
*/
|
|
165
|
-
export function
|
|
154
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
155
|
+
/**
|
|
156
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
157
|
+
*
|
|
158
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
159
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
160
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
161
|
+
* @param {Uint8Array} program
|
|
162
|
+
* @param {WitnessMap} solved_witness
|
|
163
|
+
* @returns {WitnessMap}
|
|
164
|
+
*/
|
|
165
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
166
166
|
|
|
167
167
|
// Map from witness index to hex string value of witness.
|
|
168
168
|
export type WitnessMap = Map<number, string>;
|
|
@@ -179,17 +179,6 @@ export type SolvedAndReturnWitness = {
|
|
|
179
179
|
|
|
180
180
|
|
|
181
181
|
|
|
182
|
-
export type RawAssertionPayload = {
|
|
183
|
-
selector: string;
|
|
184
|
-
data: string[];
|
|
185
|
-
};
|
|
186
|
-
export type ExecutionError = Error & {
|
|
187
|
-
callStack?: string[];
|
|
188
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
182
|
/**
|
|
194
183
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
195
184
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -218,6 +207,17 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
218
207
|
|
|
219
208
|
|
|
220
209
|
|
|
210
|
+
export type RawAssertionPayload = {
|
|
211
|
+
selector: string;
|
|
212
|
+
data: string[];
|
|
213
|
+
};
|
|
214
|
+
export type ExecutionError = Error & {
|
|
215
|
+
callStack?: string[];
|
|
216
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
221
|
export type StackItem = {
|
|
222
222
|
index: number;
|
|
223
223
|
witness: WitnessMap;
|
|
@@ -236,13 +236,8 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
236
236
|
|
|
237
237
|
export interface InitOutput {
|
|
238
238
|
readonly memory: WebAssembly.Memory;
|
|
239
|
-
readonly
|
|
240
|
-
readonly
|
|
241
|
-
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
242
|
-
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
243
|
-
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
244
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
245
|
-
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
239
|
+
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
240
|
+
readonly buildInfo: () => number;
|
|
246
241
|
readonly and: (a: number, b: number) => number;
|
|
247
242
|
readonly xor: (a: number, b: number) => number;
|
|
248
243
|
readonly sha256: (a: number, b: number, c: number) => void;
|
|
@@ -250,6 +245,10 @@ export interface InitOutput {
|
|
|
250
245
|
readonly keccak256: (a: number, b: number, c: number) => void;
|
|
251
246
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
252
247
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
248
|
+
readonly compressWitness: (a: number, b: number) => void;
|
|
249
|
+
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
250
|
+
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
251
|
+
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
253
252
|
readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
|
|
254
253
|
readonly createBlackBoxSolver: () => number;
|
|
255
254
|
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -257,17 +256,20 @@ export interface InitOutput {
|
|
|
257
256
|
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
258
257
|
readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
|
|
259
258
|
readonly executeProgramWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
260
|
-
readonly
|
|
261
|
-
readonly
|
|
259
|
+
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
260
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
261
|
+
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
262
|
+
readonly __wbg_trap_free: (a: number) => void;
|
|
263
|
+
readonly trap___wbg_wasmer_trap: () => void;
|
|
262
264
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
263
265
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
264
266
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
265
|
-
readonly
|
|
267
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5258430255de068: (a: number, b: number, c: number) => void;
|
|
266
268
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
267
269
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
268
|
-
readonly wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
269
270
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
270
|
-
readonly
|
|
271
|
+
readonly wasm_bindgen__convert__closures__invoke3_mut__h1e7d8ac96c74bd35: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
272
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h188e918906ff9a40: (a: number, b: number, c: number, d: number) => void;
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|