@noir-lang/acvm_js 0.38.0 → 0.39.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.
- package/nodejs/acvm_js.d.ts +50 -65
- package/nodejs/acvm_js.js +232 -200
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +7 -7
- package/package.json +11 -6
- package/web/acvm_js.d.ts +57 -72
- package/web/acvm_js.js +221 -193
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +7 -7
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,45 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
5
|
-
*
|
|
6
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
7
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
8
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
9
|
-
* @param {Uint8Array} circuit
|
|
10
|
-
* @param {WitnessMap} solved_witness
|
|
11
|
-
* @returns {WitnessMap}
|
|
12
|
-
*/
|
|
13
|
-
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
14
|
-
/**
|
|
15
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
16
|
-
*
|
|
17
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
18
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
19
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
20
|
-
* @param {Uint8Array} circuit
|
|
21
|
-
* @param {WitnessMap} solved_witness
|
|
22
|
-
* @returns {WitnessMap}
|
|
23
|
-
*/
|
|
24
|
-
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
25
|
-
/**
|
|
26
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
27
|
-
*
|
|
28
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
29
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
30
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
31
|
-
* @param {Uint8Array} circuit
|
|
32
|
-
* @param {WitnessMap} witness_map
|
|
33
|
-
* @returns {WitnessMap}
|
|
34
|
-
*/
|
|
35
|
-
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
36
|
-
/**
|
|
37
|
-
* Sets the package's logging level.
|
|
38
|
-
*
|
|
39
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
40
|
-
*/
|
|
41
|
-
export function initLogLevel(level: LogLevel): void;
|
|
42
|
-
/**
|
|
43
4
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
44
5
|
*
|
|
45
6
|
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
@@ -72,7 +33,6 @@ export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
|
72
33
|
*/
|
|
73
34
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
74
35
|
/**
|
|
75
|
-
* Calculates the Blake2s256 hash of the input bytes and represents these as a single field element.
|
|
76
36
|
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
77
37
|
* @param {Uint8Array} hashed_msg
|
|
78
38
|
* @param {Uint8Array} public_key_x_bytes
|
|
@@ -114,6 +74,12 @@ export function xor(lhs: string, rhs: string): string;
|
|
|
114
74
|
*/
|
|
115
75
|
export function and(lhs: string, rhs: string): string;
|
|
116
76
|
/**
|
|
77
|
+
* Sets the package's logging level.
|
|
78
|
+
*
|
|
79
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
80
|
+
*/
|
|
81
|
+
export function initLogLevel(filter: string): void;
|
|
82
|
+
/**
|
|
117
83
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
118
84
|
*
|
|
119
85
|
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
@@ -132,6 +98,50 @@ export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
|
132
98
|
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
133
99
|
*/
|
|
134
100
|
export function buildInfo(): BuildInfo;
|
|
101
|
+
/**
|
|
102
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
103
|
+
*
|
|
104
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
105
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
106
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
107
|
+
* @param {Uint8Array} circuit
|
|
108
|
+
* @param {WitnessMap} solved_witness
|
|
109
|
+
* @returns {WitnessMap}
|
|
110
|
+
*/
|
|
111
|
+
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
112
|
+
/**
|
|
113
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
114
|
+
*
|
|
115
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
116
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
117
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
118
|
+
* @param {Uint8Array} circuit
|
|
119
|
+
* @param {WitnessMap} solved_witness
|
|
120
|
+
* @returns {WitnessMap}
|
|
121
|
+
*/
|
|
122
|
+
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
123
|
+
/**
|
|
124
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
125
|
+
*
|
|
126
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
127
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
128
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
129
|
+
* @param {Uint8Array} circuit
|
|
130
|
+
* @param {WitnessMap} witness_map
|
|
131
|
+
* @returns {WitnessMap}
|
|
132
|
+
*/
|
|
133
|
+
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
134
|
+
|
|
135
|
+
// Map from witness index to hex string value of witness.
|
|
136
|
+
export type WitnessMap = Map<number, string>;
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
export type ExecutionError = Error & {
|
|
141
|
+
callStack?: string[];
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
|
|
135
145
|
|
|
136
146
|
export type ForeignCallInput = string[]
|
|
137
147
|
export type ForeignCallOutput = string | string[]
|
|
@@ -147,21 +157,6 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
147
157
|
|
|
148
158
|
|
|
149
159
|
|
|
150
|
-
export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
// Map from witness index to hex string value of witness.
|
|
155
|
-
export type WitnessMap = Map<number, string>;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
export type ExecutionError = Error & {
|
|
160
|
-
callStack?: string[];
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
160
|
/**
|
|
166
161
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
167
162
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -175,16 +170,6 @@ export type BuildInfo = {
|
|
|
175
170
|
}
|
|
176
171
|
|
|
177
172
|
|
|
178
|
-
/**
|
|
179
|
-
* A struct representing a Trap
|
|
180
|
-
*/
|
|
181
|
-
export class Trap {
|
|
182
|
-
free(): void;
|
|
183
|
-
/**
|
|
184
|
-
* @returns {Symbol}
|
|
185
|
-
*/
|
|
186
|
-
static __wbgd_downcast_token(): Symbol;
|
|
187
|
-
}
|
|
188
173
|
/**
|
|
189
174
|
*/
|
|
190
175
|
export class WasmBlackBoxFunctionSolver {
|
|
@@ -195,10 +180,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
195
180
|
|
|
196
181
|
export interface InitOutput {
|
|
197
182
|
readonly memory: WebAssembly.Memory;
|
|
198
|
-
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
199
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
200
|
-
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
201
|
-
readonly initLogLevel: (a: number) => void;
|
|
202
183
|
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
203
184
|
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
204
185
|
readonly createBlackBoxSolver: () => number;
|
|
@@ -210,19 +191,23 @@ export interface InitOutput {
|
|
|
210
191
|
readonly sha256: (a: number, b: number, c: number) => void;
|
|
211
192
|
readonly xor: (a: number, b: number) => number;
|
|
212
193
|
readonly and: (a: number, b: number) => number;
|
|
194
|
+
readonly initLogLevel: (a: number, b: number) => void;
|
|
213
195
|
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
214
196
|
readonly compressWitness: (a: number, b: number) => void;
|
|
215
197
|
readonly buildInfo: () => number;
|
|
198
|
+
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
199
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
200
|
+
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
216
201
|
readonly __wbg_trap_free: (a: number) => void;
|
|
217
|
-
readonly
|
|
202
|
+
readonly trap___wbg_wasmer_trap: () => void;
|
|
218
203
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
219
204
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
220
205
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
221
|
-
readonly
|
|
206
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0c6c8312617d6ad4: (a: number, b: number, c: number) => void;
|
|
222
207
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
223
208
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
224
209
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
225
|
-
readonly
|
|
210
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__hc5e8ba855f687f9d: (a: number, b: number, c: number, d: number) => void;
|
|
226
211
|
}
|
|
227
212
|
|
|
228
213
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|