@noir-lang/acvm_js 0.46.0-ff7bb72.nightly → 0.47.0-318314d.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.
@@ -1,6 +1,17 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
+ * Sets the package's logging level.
5
+ *
6
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
7
+ */
8
+ export function initLogLevel(filter: string): void;
9
+ /**
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.
12
+ */
13
+ export function buildInfo(): BuildInfo;
14
+ /**
4
15
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
5
16
  *
6
17
  * @param {WitnessMap} witness_map - A witness map.
@@ -30,73 +41,6 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
30
41
  */
31
42
  export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
32
43
  /**
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.
45
- *
46
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
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}
52
- */
53
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
54
- /**
55
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
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}
63
- */
64
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
65
- /**
66
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
67
- *
68
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
69
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
70
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
71
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
72
- */
73
- export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
74
- /**
75
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
76
- * This method also extracts the public return values from the solved witness into its own return witness.
77
- *
78
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
79
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
80
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
81
- * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
82
- */
83
- export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
84
- /**
85
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
86
- *
87
- * @param {Uint8Array} program - A serialized representation of an ACIR program
88
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
89
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
90
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
91
- */
92
- export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
93
- /**
94
- * Sets the package's logging level.
95
- *
96
- * @param {LogLevel} level - The maximum level of logging to be emitted.
97
- */
98
- export function initLogLevel(filter: string): void;
99
- /**
100
44
  * Performs a bitwise AND operation between `lhs` and `rhs`
101
45
  * @param {string} lhs
102
46
  * @param {string} rhs
@@ -147,19 +91,87 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
147
91
  */
148
92
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
149
93
  /**
150
- * Returns the `BuildInfo` object containing information about how the installed package was built.
151
- * @returns {BuildInfo} - Information on how the installed package was built.
94
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
95
+ *
96
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
97
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
98
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
99
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
152
100
  */
153
- export function buildInfo(): BuildInfo;
101
+ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
102
+ /**
103
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
104
+ * This method also extracts the public return values from the solved witness into its own return witness.
105
+ *
106
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
107
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
108
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
109
+ * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
110
+ */
111
+ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
112
+ /**
113
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
114
+ *
115
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
116
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
117
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
118
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
119
+ */
120
+ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
121
+ /**
122
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
123
+ *
124
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
125
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
126
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
127
+ * @param {Uint8Array} program
128
+ * @param {WitnessMap} witness_map
129
+ * @returns {WitnessMap}
130
+ */
131
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
132
+ /**
133
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
134
+ *
135
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
136
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
137
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
138
+ * @param {Uint8Array} program
139
+ * @param {WitnessMap} solved_witness
140
+ * @returns {WitnessMap}
141
+ */
142
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
143
+ /**
144
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
145
+ *
146
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
147
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
148
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
149
+ * @param {Uint8Array} program
150
+ * @param {WitnessMap} solved_witness
151
+ * @returns {WitnessMap}
152
+ */
153
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
154
154
 
155
- export type RawAssertionPayload = {
156
- selector: string;
157
- data: string[];
158
- };
159
- export type ExecutionError = Error & {
160
- callStack?: string[];
161
- rawAssertionPayload?: RawAssertionPayload;
162
- };
155
+ /**
156
+ * @typedef {Object} BuildInfo - Information about how the installed package was built
157
+ * @property {string} gitHash - The hash of the git commit from which the package was built.
158
+ * @property {string} version - The version of the package at the built git commit.
159
+ * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
160
+ */
161
+ export type BuildInfo = {
162
+ gitHash: string;
163
+ version: string;
164
+ dirty: string;
165
+ }
166
+
167
+
168
+
169
+ export type StackItem = {
170
+ index: number;
171
+ witness: WitnessMap;
172
+ }
173
+
174
+ export type WitnessStack = Array<StackItem>;
163
175
 
164
176
 
165
177
 
@@ -177,6 +189,17 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
177
189
 
178
190
 
179
191
 
192
+ export type RawAssertionPayload = {
193
+ selector: string;
194
+ data: string[];
195
+ };
196
+ export type ExecutionError = Error & {
197
+ callStack?: string[];
198
+ rawAssertionPayload?: RawAssertionPayload;
199
+ };
200
+
201
+
202
+
180
203
  // Map from witness index to hex string value of witness.
181
204
  export type WitnessMap = Map<number, string>;
182
205
 
@@ -191,26 +214,3 @@ export type SolvedAndReturnWitness = {
191
214
  }
192
215
 
193
216
 
194
-
195
- export type StackItem = {
196
- index: number;
197
- witness: WitnessMap;
198
- }
199
-
200
- export type WitnessStack = Array<StackItem>;
201
-
202
-
203
-
204
- /**
205
- * @typedef {Object} BuildInfo - Information about how the installed package was built
206
- * @property {string} gitHash - The hash of the git commit from which the package was built.
207
- * @property {string} version - The version of the package at the built git commit.
208
- * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
209
- */
210
- export type BuildInfo = {
211
- gitHash: string;
212
- version: string;
213
- dirty: string;
214
- }
215
-
216
-