@noir-lang/acvm_js 0.30.0-dbb6cf0.nightly → 0.30.0-e89f364.nightly
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 +78 -78
- package/nodejs/acvm_js.js +209 -209
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +13 -13
- package/package.json +1 -1
- package/web/acvm_js.d.ts +91 -91
- package/web/acvm_js.js +203 -203
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +13 -13
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,19 +1,72 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
5
5
|
*
|
|
6
|
-
* @param {Uint8Array}
|
|
7
|
-
* @
|
|
6
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
7
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
8
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
9
|
+
* @param {Uint8Array} circuit
|
|
10
|
+
* @param {WitnessMap} solved_witness
|
|
11
|
+
* @returns {WitnessMap}
|
|
8
12
|
*/
|
|
9
|
-
export function
|
|
13
|
+
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
10
14
|
/**
|
|
11
|
-
*
|
|
15
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
12
16
|
*
|
|
13
|
-
* @param {Uint8Array}
|
|
14
|
-
* @
|
|
17
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
18
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
19
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
20
|
+
* @param {Uint8Array} circuit
|
|
21
|
+
* @param {WitnessMap} solved_witness
|
|
22
|
+
* @returns {WitnessMap}
|
|
15
23
|
*/
|
|
16
|
-
export function
|
|
24
|
+
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
25
|
+
/**
|
|
26
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
27
|
+
*
|
|
28
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
29
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
30
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
31
|
+
* @param {Uint8Array} circuit
|
|
32
|
+
* @param {WitnessMap} witness_map
|
|
33
|
+
* @returns {WitnessMap}
|
|
34
|
+
*/
|
|
35
|
+
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
36
|
+
/**
|
|
37
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
38
|
+
*
|
|
39
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
40
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
41
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
42
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
43
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
44
|
+
*/
|
|
45
|
+
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
46
|
+
/**
|
|
47
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
48
|
+
*
|
|
49
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
50
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
51
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
52
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
53
|
+
*/
|
|
54
|
+
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
55
|
+
/**
|
|
56
|
+
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
57
|
+
*/
|
|
58
|
+
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
59
|
+
/**
|
|
60
|
+
* Sets the package's logging level.
|
|
61
|
+
*
|
|
62
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
63
|
+
*/
|
|
64
|
+
export function initLogLevel(level: LogLevel): void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
67
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
68
|
+
*/
|
|
69
|
+
export function buildInfo(): BuildInfo;
|
|
17
70
|
/**
|
|
18
71
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
19
72
|
* @param {Uint8Array} hashed_msg
|
|
@@ -66,72 +119,19 @@ export function xor(lhs: string, rhs: string): string;
|
|
|
66
119
|
*/
|
|
67
120
|
export function and(lhs: string, rhs: string): string;
|
|
68
121
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
71
|
-
*/
|
|
72
|
-
export function buildInfo(): BuildInfo;
|
|
73
|
-
/**
|
|
74
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
75
|
-
*
|
|
76
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
77
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
78
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
79
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
80
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
81
|
-
*/
|
|
82
|
-
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
83
|
-
/**
|
|
84
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
85
|
-
*
|
|
86
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
87
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
88
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
89
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
90
|
-
*/
|
|
91
|
-
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
92
|
-
/**
|
|
93
|
-
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
94
|
-
*/
|
|
95
|
-
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
96
|
-
/**
|
|
97
|
-
* Sets the package's logging level.
|
|
98
|
-
*
|
|
99
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
100
|
-
*/
|
|
101
|
-
export function initLogLevel(level: LogLevel): void;
|
|
102
|
-
/**
|
|
103
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
104
|
-
*
|
|
105
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
106
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
107
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
108
|
-
* @param {Uint8Array} circuit
|
|
109
|
-
* @param {WitnessMap} solved_witness
|
|
110
|
-
* @returns {WitnessMap}
|
|
111
|
-
*/
|
|
112
|
-
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
113
|
-
/**
|
|
114
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
122
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
115
123
|
*
|
|
116
|
-
* @param {Uint8Array}
|
|
117
|
-
* @
|
|
118
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
119
|
-
* @param {Uint8Array} circuit
|
|
120
|
-
* @param {WitnessMap} solved_witness
|
|
121
|
-
* @returns {WitnessMap}
|
|
124
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
125
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
122
126
|
*/
|
|
123
|
-
export function
|
|
127
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
124
128
|
/**
|
|
125
|
-
*
|
|
129
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
126
130
|
*
|
|
127
|
-
* @param {Uint8Array}
|
|
128
|
-
* @
|
|
129
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
130
|
-
* @param {Uint8Array} circuit
|
|
131
|
-
* @param {WitnessMap} witness_map
|
|
132
|
-
* @returns {WitnessMap}
|
|
131
|
+
* @param {Uint8Array} compressed_witness - A witness map.
|
|
132
|
+
* @returns {WitnessMap} A compressed witness map
|
|
133
133
|
*/
|
|
134
|
-
export function
|
|
134
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
135
135
|
|
|
136
136
|
export type ForeignCallInput = string[]
|
|
137
137
|
export type ForeignCallOutput = string | string[]
|
|
@@ -147,6 +147,15 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
|
|
150
|
+
export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
// Map from witness index to hex string value of witness.
|
|
155
|
+
export type WitnessMap = Map<number, string>;
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
150
159
|
/**
|
|
151
160
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
152
161
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -161,20 +170,11 @@ export type BuildInfo = {
|
|
|
161
170
|
|
|
162
171
|
|
|
163
172
|
|
|
164
|
-
export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
173
|
export type ExecutionError = Error & {
|
|
169
174
|
callStack?: string[];
|
|
170
175
|
};
|
|
171
176
|
|
|
172
177
|
|
|
173
|
-
|
|
174
|
-
// Map from witness index to hex string value of witness.
|
|
175
|
-
export type WitnessMap = Map<number, string>;
|
|
176
|
-
|
|
177
|
-
|
|
178
178
|
/**
|
|
179
179
|
* A struct representing a Trap
|
|
180
180
|
*/
|
|
@@ -195,8 +195,15 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
195
195
|
|
|
196
196
|
export interface InitOutput {
|
|
197
197
|
readonly memory: WebAssembly.Memory;
|
|
198
|
-
readonly
|
|
199
|
-
readonly
|
|
198
|
+
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
199
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
200
|
+
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
201
|
+
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
202
|
+
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
203
|
+
readonly createBlackBoxSolver: () => number;
|
|
204
|
+
readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
|
|
205
|
+
readonly initLogLevel: (a: number) => void;
|
|
206
|
+
readonly buildInfo: () => number;
|
|
200
207
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
201
208
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
202
209
|
readonly keccak256: (a: number, b: number, c: number) => void;
|
|
@@ -204,25 +211,18 @@ export interface InitOutput {
|
|
|
204
211
|
readonly sha256: (a: number, b: number, c: number) => void;
|
|
205
212
|
readonly xor: (a: number, b: number) => number;
|
|
206
213
|
readonly and: (a: number, b: number) => number;
|
|
207
|
-
readonly
|
|
208
|
-
readonly
|
|
209
|
-
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
210
|
-
readonly createBlackBoxSolver: () => number;
|
|
211
|
-
readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
|
|
212
|
-
readonly initLogLevel: (a: number) => void;
|
|
213
|
-
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
214
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
215
|
-
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
214
|
+
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
215
|
+
readonly compressWitness: (a: number, b: number) => void;
|
|
216
216
|
readonly __wbg_trap_free: (a: number) => void;
|
|
217
217
|
readonly trap___wbgd_downcast_token: () => number;
|
|
218
218
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
219
219
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
220
220
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
221
|
-
readonly
|
|
221
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h52952476ed423c11: (a: number, b: number, c: number) => void;
|
|
222
222
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
223
223
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
224
224
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
225
|
-
readonly
|
|
225
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h59b9f7ecd67d6688: (a: number, b: number, c: number, d: number) => void;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|