@noir-lang/acvm_js 0.30.0 → 0.31.0-ff96ba4.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,8 +1,14 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function decompressWitness(a: number, b: number, c: number): void;
5
- export function compressWitness(a: number, b: number): void;
4
+ export function getPublicWitness(a: number, b: number, c: number, d: number): void;
5
+ export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
6
+ export function getReturnWitness(a: number, b: number, c: number, d: number): void;
7
+ export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
8
+ export function executeCircuit(a: number, b: number, c: number, d: number): number;
9
+ export function createBlackBoxSolver(): number;
10
+ export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
11
+ export function initLogLevel(a: number): void;
6
12
  export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
7
13
  export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
8
14
  export function keccak256(a: number, b: number, c: number): void;
@@ -10,22 +16,16 @@ export function blake2s256(a: number, b: number, c: number): void;
10
16
  export function sha256(a: number, b: number, c: number): void;
11
17
  export function xor(a: number, b: number): number;
12
18
  export function and(a: number, b: number): number;
19
+ export function decompressWitness(a: number, b: number, c: number): void;
20
+ export function compressWitness(a: number, b: number): void;
13
21
  export function buildInfo(): number;
14
- export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
15
- export function executeCircuit(a: number, b: number, c: number, d: number): number;
16
- export function createBlackBoxSolver(): number;
17
- export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
18
- export function initLogLevel(a: number): void;
19
- export function getPublicWitness(a: number, b: number, c: number, d: number): void;
20
- export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
21
- export function getReturnWitness(a: number, b: number, c: number, d: number): void;
22
22
  export function __wbg_trap_free(a: number): void;
23
23
  export function trap___wbgd_downcast_token(): number;
24
24
  export function __wbindgen_malloc(a: number): number;
25
25
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
26
26
  export const __wbindgen_export_2: WebAssembly.Table;
27
- export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb1f60a5b015b6c5(a: number, b: number, c: number): void;
27
+ export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3d2354449e918783(a: number, b: number, c: number): void;
28
28
  export function __wbindgen_add_to_stack_pointer(a: number): number;
29
29
  export function __wbindgen_free(a: number, b: number): void;
30
30
  export function __wbindgen_exn_store(a: number): void;
31
- export function wasm_bindgen__convert__closures__invoke2_mut__h72933b4dbc34aade(a: number, b: number, c: number, d: number): void;
31
+ export function wasm_bindgen__convert__closures__invoke2_mut__ha676a05262f43687(a: number, b: number, c: number, d: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noir-lang/acvm_js",
3
- "version": "0.30.0",
3
+ "version": "0.31.0-ff96ba4.nightly",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/noir-lang/acvm.git"
package/web/acvm_js.d.ts CHANGED
@@ -1,19 +1,67 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
4
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
5
5
  *
6
- * @param {Uint8Array} compressed_witness - A compressed witness.
7
- * @returns {WitnessMap} The decompressed witness map.
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}
8
12
  */
9
- export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
13
+ export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
10
14
  /**
11
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
15
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
12
16
  *
13
- * @param {Uint8Array} compressed_witness - A witness map.
14
- * @returns {WitnessMap} A compressed witness map
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}
15
23
  */
16
- export function compressWitness(witness_map: WitnessMap): Uint8Array;
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
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
38
+ *
39
+ * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
40
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
41
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
42
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
43
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
44
+ */
45
+ export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
46
+ /**
47
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
48
+ *
49
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
50
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
51
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
52
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
53
+ */
54
+ export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
55
+ /**
56
+ * @returns {Promise<WasmBlackBoxFunctionSolver>}
57
+ */
58
+ export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
59
+ /**
60
+ * Sets the package's logging level.
61
+ *
62
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
63
+ */
64
+ export function initLogLevel(level: LogLevel): void;
17
65
  /**
18
66
  * Verifies a ECDSA signature over the secp256r1 curve.
19
67
  * @param {Uint8Array} hashed_msg
@@ -66,72 +114,24 @@ export function xor(lhs: string, rhs: string): string;
66
114
  */
67
115
  export function and(lhs: string, rhs: string): string;
68
116
  /**
69
- * Returns the `BuildInfo` object containing information about how the installed package was built.
70
- * @returns {BuildInfo} - Information on how the installed package was built.
71
- */
72
- export function buildInfo(): BuildInfo;
73
- /**
74
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
75
- *
76
- * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
77
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
78
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
79
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
80
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
81
- */
82
- export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
83
- /**
84
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
85
- *
86
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
87
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
88
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
89
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
90
- */
91
- export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
92
- /**
93
- * @returns {Promise<WasmBlackBoxFunctionSolver>}
94
- */
95
- export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
96
- /**
97
- * Sets the package's logging level.
98
- *
99
- * @param {LogLevel} level - The maximum level of logging to be emitted.
100
- */
101
- export function initLogLevel(level: LogLevel): void;
102
- /**
103
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
117
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
104
118
  *
105
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
106
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
107
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
108
- * @param {Uint8Array} circuit
109
- * @param {WitnessMap} solved_witness
110
- * @returns {WitnessMap}
119
+ * @param {Uint8Array} compressed_witness - A compressed witness.
120
+ * @returns {WitnessMap} The decompressed witness map.
111
121
  */
112
- export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
122
+ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
113
123
  /**
114
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
124
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
115
125
  *
116
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
117
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
118
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
119
- * @param {Uint8Array} circuit
120
- * @param {WitnessMap} solved_witness
121
- * @returns {WitnessMap}
126
+ * @param {Uint8Array} compressed_witness - A witness map.
127
+ * @returns {WitnessMap} A compressed witness map
122
128
  */
123
- export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
129
+ export function compressWitness(witness_map: WitnessMap): Uint8Array;
124
130
  /**
125
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
126
- *
127
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
128
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
129
- * @returns {WitnessMap} A witness map containing the circuit's return values.
130
- * @param {Uint8Array} circuit
131
- * @param {WitnessMap} witness_map
132
- * @returns {WitnessMap}
131
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
132
+ * @returns {BuildInfo} - Information on how the installed package was built.
133
133
  */
134
- export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
134
+ export function buildInfo(): BuildInfo;
135
135
 
136
136
  export type ForeignCallInput = string[]
137
137
  export type ForeignCallOutput = string | string[]
@@ -147,21 +147,12 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
147
147
 
148
148
 
149
149
 
150
- /**
151
- * @typedef {Object} BuildInfo - Information about how the installed package was built
152
- * @property {string} gitHash - The hash of the git commit from which the package was built.
153
- * @property {string} version - The version of the package at the built git commit.
154
- * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
155
- */
156
- export type BuildInfo = {
157
- gitHash: string;
158
- version: string;
159
- dirty: string;
160
- }
150
+ export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
161
151
 
162
152
 
163
153
 
164
- export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
154
+ // Map from witness index to hex string value of witness.
155
+ export type WitnessMap = Map<number, string>;
165
156
 
166
157
 
167
158
 
@@ -171,8 +162,17 @@ export type ExecutionError = Error & {
171
162
 
172
163
 
173
164
 
174
- // Map from witness index to hex string value of witness.
175
- export type WitnessMap = Map<number, string>;
165
+ /**
166
+ * @typedef {Object} BuildInfo - Information about how the installed package was built
167
+ * @property {string} gitHash - The hash of the git commit from which the package was built.
168
+ * @property {string} version - The version of the package at the built git commit.
169
+ * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
170
+ */
171
+ export type BuildInfo = {
172
+ gitHash: string;
173
+ version: string;
174
+ dirty: string;
175
+ }
176
176
 
177
177
 
178
178
  /**
@@ -195,8 +195,14 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
195
195
 
196
196
  export interface InitOutput {
197
197
  readonly memory: WebAssembly.Memory;
198
- readonly decompressWitness: (a: number, b: number, c: number) => void;
199
- readonly compressWitness: (a: number, b: number) => void;
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 executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
202
+ readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
203
+ readonly createBlackBoxSolver: () => number;
204
+ readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
205
+ readonly initLogLevel: (a: number) => void;
200
206
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
201
207
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
202
208
  readonly keccak256: (a: number, b: number, c: number) => void;
@@ -204,25 +210,19 @@ export interface InitOutput {
204
210
  readonly sha256: (a: number, b: number, c: number) => void;
205
211
  readonly xor: (a: number, b: number) => number;
206
212
  readonly and: (a: number, b: number) => number;
213
+ readonly decompressWitness: (a: number, b: number, c: number) => void;
214
+ readonly compressWitness: (a: number, b: number) => void;
207
215
  readonly buildInfo: () => number;
208
- readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
209
- readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
210
- readonly createBlackBoxSolver: () => number;
211
- readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
212
- readonly initLogLevel: (a: number) => void;
213
- readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
214
- readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
215
- readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
216
216
  readonly __wbg_trap_free: (a: number) => void;
217
217
  readonly trap___wbgd_downcast_token: () => number;
218
218
  readonly __wbindgen_malloc: (a: number) => number;
219
219
  readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
220
220
  readonly __wbindgen_export_2: WebAssembly.Table;
221
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb1f60a5b015b6c5: (a: number, b: number, c: number) => void;
221
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3d2354449e918783: (a: number, b: number, c: number) => void;
222
222
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
223
223
  readonly __wbindgen_free: (a: number, b: number) => void;
224
224
  readonly __wbindgen_exn_store: (a: number) => void;
225
- readonly wasm_bindgen__convert__closures__invoke2_mut__h72933b4dbc34aade: (a: number, b: number, c: number, d: number) => void;
225
+ readonly wasm_bindgen__convert__closures__invoke2_mut__ha676a05262f43687: (a: number, b: number, c: number, d: number) => void;
226
226
  }
227
227
 
228
228
  export type SyncInitInput = BufferSource | WebAssembly.Module;