@noir-lang/acvm_js 1.0.0-beta.2-c63cc73.nightly → 1.0.0-beta.3

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/web/acvm_js.d.ts CHANGED
@@ -1,41 +1,6 @@
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
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
11
- *
12
- * @param {WitnessMap} witness_map - A witness map.
13
- * @returns {Uint8Array} A compressed witness map
14
- */
15
- export function compressWitness(witness_map: WitnessMap): Uint8Array;
16
- /**
17
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
18
- * This should be used to only fetch the witness map for the main function.
19
- *
20
- * @param {Uint8Array} compressed_witness - A compressed witness.
21
- * @returns {WitnessMap} The decompressed witness map.
22
- */
23
- export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
24
- /**
25
- * Compresses a `WitnessStack` into the binary format outputted by Nargo.
26
- *
27
- * @param {WitnessStack} witness_stack - A witness stack.
28
- * @returns {Uint8Array} A compressed witness stack
29
- */
30
- export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
31
- /**
32
- * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
33
- *
34
- * @param {Uint8Array} compressed_witness - A compressed witness.
35
- * @returns {WitnessStack} The decompressed witness stack.
36
- */
37
- export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
38
- /**
39
4
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
40
5
  *
41
6
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
@@ -64,6 +29,44 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
64
29
  */
65
30
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
66
31
  /**
32
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
33
+ * @returns {BuildInfo} - Information on how the installed package was built.
34
+ */
35
+ export function buildInfo(): BuildInfo;
36
+ /**
37
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
38
+ *
39
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
40
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
41
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
42
+ * @param {Uint8Array} program
43
+ * @param {WitnessMap} witness_map
44
+ * @returns {WitnessMap}
45
+ */
46
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
47
+ /**
48
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
49
+ *
50
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
51
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
52
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
53
+ * @param {Uint8Array} program
54
+ * @param {WitnessMap} solved_witness
55
+ * @returns {WitnessMap}
56
+ */
57
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
58
+ /**
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} program
65
+ * @param {WitnessMap} solved_witness
66
+ * @returns {WitnessMap}
67
+ */
68
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
69
+ /**
67
70
  * Performs a bitwise AND operation between `lhs` and `rhs`
68
71
  * @param {string} lhs
69
72
  * @param {string} rhs
@@ -109,57 +112,40 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
109
112
  */
110
113
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
111
114
  /**
112
- * Returns the `BuildInfo` object containing information about how the installed package was built.
113
- * @returns {BuildInfo} - Information on how the installed package was built.
115
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
116
+ *
117
+ * @param {WitnessMap} witness_map - A witness map.
118
+ * @returns {Uint8Array} A compressed witness map
114
119
  */
115
- export function buildInfo(): BuildInfo;
120
+ export function compressWitness(witness_map: WitnessMap): Uint8Array;
116
121
  /**
117
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
122
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
123
+ * This should be used to only fetch the witness map for the main function.
118
124
  *
119
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
120
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
121
- * @returns {WitnessMap} A witness map containing the circuit's return values.
122
- * @param {Uint8Array} program
123
- * @param {WitnessMap} witness_map
124
- * @returns {WitnessMap}
125
+ * @param {Uint8Array} compressed_witness - A compressed witness.
126
+ * @returns {WitnessMap} The decompressed witness map.
125
127
  */
126
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
128
+ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
127
129
  /**
128
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
130
+ * Compresses a `WitnessStack` into the binary format outputted by Nargo.
129
131
  *
130
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
131
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
132
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
133
- * @param {Uint8Array} program
134
- * @param {WitnessMap} solved_witness
135
- * @returns {WitnessMap}
132
+ * @param {WitnessStack} witness_stack - A witness stack.
133
+ * @returns {Uint8Array} A compressed witness stack
136
134
  */
137
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
135
+ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
138
136
  /**
139
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
137
+ * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
140
138
  *
141
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
142
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
143
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
144
- * @param {Uint8Array} program
145
- * @param {WitnessMap} solved_witness
146
- * @returns {WitnessMap}
139
+ * @param {Uint8Array} compressed_witness - A compressed witness.
140
+ * @returns {WitnessStack} The decompressed witness stack.
147
141
  */
148
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
149
-
150
- export type ForeignCallInput = string[]
151
- export type ForeignCallOutput = string | string[]
152
-
142
+ export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
153
143
  /**
154
- * A callback which performs an foreign call and returns the response.
155
- * @callback ForeignCallHandler
156
- * @param {string} name - The identifier for the type of foreign call being performed.
157
- * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
158
- * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
144
+ * Sets the package's logging level.
145
+ *
146
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
159
147
  */
160
- export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
161
-
162
-
148
+ export function initLogLevel(filter: string): void;
163
149
 
164
150
  // Map from witness index to hex string value of witness.
165
151
  export type WitnessMap = Map<number, string>;
@@ -212,37 +198,51 @@ export type WitnessStack = Array<StackItem>;
212
198
 
213
199
 
214
200
 
201
+ export type ForeignCallInput = string[]
202
+ export type ForeignCallOutput = string | string[]
203
+
204
+ /**
205
+ * A callback which performs an foreign call and returns the response.
206
+ * @callback ForeignCallHandler
207
+ * @param {string} name - The identifier for the type of foreign call being performed.
208
+ * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
209
+ * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
210
+ */
211
+ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
212
+
213
+
214
+
215
215
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
216
216
 
217
217
  export interface InitOutput {
218
218
  readonly memory: WebAssembly.Memory;
219
- readonly initLogLevel: (a: number, b: number, c: number) => void;
220
- readonly compressWitness: (a: number, b: number) => void;
221
- readonly decompressWitness: (a: number, b: number, c: number) => void;
222
- readonly compressWitnessStack: (a: number, b: number) => void;
223
- readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
224
219
  readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
225
220
  readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number;
226
221
  readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
222
+ readonly buildInfo: () => number;
223
+ readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
224
+ readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
225
+ readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
227
226
  readonly and: (a: number, b: number) => number;
228
227
  readonly xor: (a: number, b: number) => number;
229
228
  readonly sha256_compression: (a: number, b: number, c: number, d: number, e: number) => void;
230
229
  readonly blake2s256: (a: number, b: number, c: number) => void;
231
230
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
232
231
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
233
- readonly buildInfo: () => number;
234
- readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
235
- readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
236
- readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
232
+ readonly compressWitness: (a: number, b: number) => void;
233
+ readonly decompressWitness: (a: number, b: number, c: number) => void;
234
+ readonly compressWitnessStack: (a: number, b: number) => void;
235
+ readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
236
+ readonly initLogLevel: (a: number, b: number, c: number) => void;
237
237
  readonly __wbindgen_malloc: (a: number) => number;
238
238
  readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
239
239
  readonly __wbindgen_export_2: WebAssembly.Table;
240
- readonly wasm_bindgen__convert__closures__invoke1_mut__hec5660d9489c77a2: (a: number, b: number, c: number) => void;
240
+ readonly wasm_bindgen__convert__closures__invoke1_mut__h0d2f2cab014f8c52: (a: number, b: number, c: number) => void;
241
241
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
242
242
  readonly __wbindgen_free: (a: number, b: number) => void;
243
- readonly wasm_bindgen__convert__closures__invoke3_mut__h083a66e5b0ae3ce9: (a: number, b: number, c: number, d: number, e: number) => void;
243
+ readonly wasm_bindgen__convert__closures__invoke3_mut__h2e8a0e541cb0c3bc: (a: number, b: number, c: number, d: number, e: number) => void;
244
244
  readonly __wbindgen_exn_store: (a: number) => void;
245
- readonly wasm_bindgen__convert__closures__invoke2_mut__h7636f3796134b93b: (a: number, b: number, c: number, d: number) => void;
245
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h56728cbaf4bbea81: (a: number, b: number, c: number, d: number) => void;
246
246
  }
247
247
 
248
248
  export type SyncInitInput = BufferSource | WebAssembly.Module;