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