@noir-lang/acvm_js 0.30.0 → 0.31.0-ff96ba4.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 +81 -81
- package/nodejs/acvm_js.js +238 -238
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +12 -12
- package/package.json +1 -1
- package/web/acvm_js.d.ts +93 -93
- package/web/acvm_js.js +229 -229
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +12 -12
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,19 +1,67 @@
|
|
|
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;
|
|
17
65
|
/**
|
|
18
66
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
19
67
|
* @param {Uint8Array} hashed_msg
|
|
@@ -66,72 +114,24 @@ export function xor(lhs: string, rhs: string): string;
|
|
|
66
114
|
*/
|
|
67
115
|
export function and(lhs: string, rhs: string): string;
|
|
68
116
|
/**
|
|
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.
|
|
117
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
104
118
|
*
|
|
105
|
-
* @param {Uint8Array}
|
|
106
|
-
* @
|
|
107
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
108
|
-
* @param {Uint8Array} circuit
|
|
109
|
-
* @param {WitnessMap} solved_witness
|
|
110
|
-
* @returns {WitnessMap}
|
|
119
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
120
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
111
121
|
*/
|
|
112
|
-
export function
|
|
122
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
113
123
|
/**
|
|
114
|
-
*
|
|
124
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
115
125
|
*
|
|
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}
|
|
126
|
+
* @param {Uint8Array} compressed_witness - A witness map.
|
|
127
|
+
* @returns {WitnessMap} A compressed witness map
|
|
122
128
|
*/
|
|
123
|
-
export function
|
|
129
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
124
130
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
128
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
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
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
132
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
133
133
|
*/
|
|
134
|
-
export function
|
|
134
|
+
export function buildInfo(): BuildInfo;
|
|
135
135
|
|
|
136
136
|
export type ForeignCallInput = string[]
|
|
137
137
|
export type ForeignCallOutput = string | string[]
|
|
@@ -147,21 +147,12 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
152
|
-
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
153
|
-
* @property {string} version - The version of the package at the built git commit.
|
|
154
|
-
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
155
|
-
*/
|
|
156
|
-
export type BuildInfo = {
|
|
157
|
-
gitHash: string;
|
|
158
|
-
version: string;
|
|
159
|
-
dirty: string;
|
|
160
|
-
}
|
|
150
|
+
export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
|
|
161
151
|
|
|
162
152
|
|
|
163
153
|
|
|
164
|
-
|
|
154
|
+
// Map from witness index to hex string value of witness.
|
|
155
|
+
export type WitnessMap = Map<number, string>;
|
|
165
156
|
|
|
166
157
|
|
|
167
158
|
|
|
@@ -171,8 +162,17 @@ export type ExecutionError = Error & {
|
|
|
171
162
|
|
|
172
163
|
|
|
173
164
|
|
|
174
|
-
|
|
175
|
-
|
|
165
|
+
/**
|
|
166
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
167
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
168
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
169
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
170
|
+
*/
|
|
171
|
+
export type BuildInfo = {
|
|
172
|
+
gitHash: string;
|
|
173
|
+
version: string;
|
|
174
|
+
dirty: string;
|
|
175
|
+
}
|
|
176
176
|
|
|
177
177
|
|
|
178
178
|
/**
|