@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/nodejs/acvm_js.d.ts +74 -74
- package/nodejs/acvm_js.js +203 -203
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +12 -12
- package/package.json +1 -1
- package/web/acvm_js.d.ts +86 -86
- package/web/acvm_js.js +197 -197
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +12 -12
package/nodejs/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
|
-
*
|
|
113
|
-
*
|
|
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
|
|
120
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
116
121
|
/**
|
|
117
|
-
*
|
|
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}
|
|
120
|
-
* @
|
|
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
|
|
128
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
127
129
|
/**
|
|
128
|
-
*
|
|
130
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
129
131
|
*
|
|
130
|
-
* @param {
|
|
131
|
-
* @
|
|
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
|
|
135
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
138
136
|
/**
|
|
139
|
-
*
|
|
137
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
140
138
|
*
|
|
141
|
-
* @param {Uint8Array}
|
|
142
|
-
* @
|
|
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
|
|
149
|
-
|
|
150
|
-
export type ForeignCallInput = string[]
|
|
151
|
-
export type ForeignCallOutput = string | string[]
|
|
152
|
-
|
|
142
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
153
143
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* @param {
|
|
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
|
|
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>;
|
|
@@ -211,3 +197,17 @@ export type StackItem = {
|
|
|
211
197
|
export type WitnessStack = Array<StackItem>;
|
|
212
198
|
|
|
213
199
|
|
|
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
|
+
|