@noir-lang/acvm_js 0.40.0-a7cc16b.nightly → 0.40.0-b60279b.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,10 +1,75 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Returns the `BuildInfo` object containing information about how the installed package was built.
5
- * @returns {BuildInfo} - Information on how the installed package was built.
4
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
5
+ *
6
+ * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
7
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
8
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
9
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
10
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
6
11
  */
7
- export function buildInfo(): BuildInfo;
12
+ export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
13
+ /**
14
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
15
+ *
16
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
17
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
18
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
19
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
20
+ */
21
+ export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
22
+ /**
23
+ * @returns {Promise<WasmBlackBoxFunctionSolver>}
24
+ */
25
+ export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
26
+ /**
27
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
28
+ *
29
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
30
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
31
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
32
+ * @param {Uint8Array} circuit
33
+ * @param {WitnessMap} solved_witness
34
+ * @returns {WitnessMap}
35
+ */
36
+ export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
37
+ /**
38
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
39
+ *
40
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
41
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
42
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
43
+ * @param {Uint8Array} circuit
44
+ * @param {WitnessMap} solved_witness
45
+ * @returns {WitnessMap}
46
+ */
47
+ export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
48
+ /**
49
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
50
+ *
51
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
52
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
53
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
54
+ * @param {Uint8Array} circuit
55
+ * @param {WitnessMap} witness_map
56
+ * @returns {WitnessMap}
57
+ */
58
+ export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
59
+ /**
60
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
61
+ *
62
+ * @param {Uint8Array} compressed_witness - A compressed witness.
63
+ * @returns {WitnessMap} The decompressed witness map.
64
+ */
65
+ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
66
+ /**
67
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
68
+ *
69
+ * @param {Uint8Array} compressed_witness - A witness map.
70
+ * @returns {WitnessMap} A compressed witness map
71
+ */
72
+ export function compressWitness(witness_map: WitnessMap): Uint8Array;
8
73
  /**
9
74
  * Verifies a ECDSA signature over the secp256r1 curve.
10
75
  * @param {Uint8Array} hashed_msg
@@ -56,101 +121,16 @@ export function xor(lhs: string, rhs: string): string;
56
121
  */
57
122
  export function and(lhs: string, rhs: string): string;
58
123
  /**
59
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
60
- *
61
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
62
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
63
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
64
- * @param {Uint8Array} circuit
65
- * @param {WitnessMap} solved_witness
66
- * @returns {WitnessMap}
67
- */
68
- export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
69
- /**
70
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
71
- *
72
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
73
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
74
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
75
- * @param {Uint8Array} circuit
76
- * @param {WitnessMap} solved_witness
77
- * @returns {WitnessMap}
78
- */
79
- export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
80
- /**
81
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
82
- *
83
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
84
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
85
- * @returns {WitnessMap} A witness map containing the circuit's return values.
86
- * @param {Uint8Array} circuit
87
- * @param {WitnessMap} witness_map
88
- * @returns {WitnessMap}
89
- */
90
- export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
91
- /**
92
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
93
- *
94
- * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
95
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
96
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
97
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
98
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
99
- */
100
- export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
101
- /**
102
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
103
- *
104
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
105
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
106
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
107
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
108
- */
109
- export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
110
- /**
111
- * @returns {Promise<WasmBlackBoxFunctionSolver>}
112
- */
113
- export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
114
- /**
115
124
  * Sets the package's logging level.
116
125
  *
117
126
  * @param {LogLevel} level - The maximum level of logging to be emitted.
118
127
  */
119
128
  export function initLogLevel(filter: string): void;
120
129
  /**
121
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
122
- *
123
- * @param {Uint8Array} compressed_witness - A compressed witness.
124
- * @returns {WitnessMap} The decompressed witness map.
125
- */
126
- export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
127
- /**
128
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
129
- *
130
- * @param {Uint8Array} compressed_witness - A witness map.
131
- * @returns {WitnessMap} A compressed witness map
130
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
131
+ * @returns {BuildInfo} - Information on how the installed package was built.
132
132
  */
133
- export function compressWitness(witness_map: WitnessMap): Uint8Array;
134
-
135
- /**
136
- * @typedef {Object} BuildInfo - Information about how the installed package was built
137
- * @property {string} gitHash - The hash of the git commit from which the package was built.
138
- * @property {string} version - The version of the package at the built git commit.
139
- * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
140
- */
141
- export type BuildInfo = {
142
- gitHash: string;
143
- version: string;
144
- dirty: string;
145
- }
146
-
147
-
148
-
149
- export type ExecutionError = Error & {
150
- callStack?: string[];
151
- };
152
-
153
-
133
+ export function buildInfo(): BuildInfo;
154
134
 
155
135
  export type ForeignCallInput = string[]
156
136
  export type ForeignCallOutput = string | string[]
@@ -170,6 +150,26 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
170
150
  export type WitnessMap = Map<number, string>;
171
151
 
172
152
 
153
+
154
+ export type ExecutionError = Error & {
155
+ callStack?: string[];
156
+ };
157
+
158
+
159
+
160
+ /**
161
+ * @typedef {Object} BuildInfo - Information about how the installed package was built
162
+ * @property {string} gitHash - The hash of the git commit from which the package was built.
163
+ * @property {string} version - The version of the package at the built git commit.
164
+ * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
165
+ */
166
+ export type BuildInfo = {
167
+ gitHash: string;
168
+ version: string;
169
+ dirty: string;
170
+ }
171
+
172
+
173
173
  /**
174
174
  */
175
175
  export class WasmBlackBoxFunctionSolver {