@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.
@@ -1,67 +1,16 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
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 {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}
6
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
52
7
  */
53
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
8
+ export function initLogLevel(filter: string): void;
54
9
  /**
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}
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 getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
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
- * Sets the package's logging level.
134
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
157
135
  *
158
- * @param {LogLevel} level - The maximum level of logging to be emitted.
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 initLogLevel(filter: string): void;
143
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
161
144
  /**
162
- * Returns the `BuildInfo` object containing information about how the installed package was built.
163
- * @returns {BuildInfo} - Information on how the installed package was built.
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 buildInfo(): BuildInfo;
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;