@noir-lang/acvm_js 0.45.0 → 0.46.0-7936262.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.
- package/nodejs/acvm_js.d.ts +83 -78
- package/nodejs/acvm_js.js +232 -615
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +12 -14
- package/package.json +1 -1
- package/web/acvm_js.d.ts +95 -92
- package/web/acvm_js.js +227 -548
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +12 -14
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function compressWitness(a: number, b: number): void;
|
|
5
|
+
export function decompressWitness(a: number, b: number, c: number): void;
|
|
6
|
+
export function compressWitnessStack(a: number, b: number): void;
|
|
7
|
+
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
8
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
9
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
10
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
4
11
|
export function and(a: number, b: number): number;
|
|
5
12
|
export function xor(a: number, b: number): number;
|
|
6
13
|
export function sha256(a: number, b: number, c: number): void;
|
|
@@ -8,15 +15,6 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
8
15
|
export function keccak256(a: number, b: number, c: number): void;
|
|
9
16
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
10
17
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
11
|
-
export function buildInfo(): number;
|
|
12
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
13
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
14
|
-
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
15
|
-
export function initLogLevel(a: number, b: number, c: number): void;
|
|
16
|
-
export function compressWitness(a: number, b: number): void;
|
|
17
|
-
export function decompressWitness(a: number, b: number, c: number): void;
|
|
18
|
-
export function compressWitnessStack(a: number, b: number): void;
|
|
19
|
-
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
20
18
|
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
21
19
|
export function createBlackBoxSolver(): number;
|
|
22
20
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
@@ -24,14 +22,14 @@ export function executeCircuitWithReturnWitness(a: number, b: number, c: number,
|
|
|
24
22
|
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
25
23
|
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
26
24
|
export function executeProgramWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
27
|
-
export function
|
|
28
|
-
export function
|
|
25
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
26
|
+
export function buildInfo(): number;
|
|
29
27
|
export function __wbindgen_malloc(a: number): number;
|
|
30
28
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
31
29
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
32
|
-
export function
|
|
30
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380(a: number, b: number, c: number): void;
|
|
33
31
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
34
32
|
export function __wbindgen_free(a: number, b: number): void;
|
|
33
|
+
export function wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(a: number, b: number, c: number, d: number, e: number): void;
|
|
35
34
|
export function __wbindgen_exn_store(a: number): void;
|
|
36
|
-
export function
|
|
37
|
-
export function wasm_bindgen__convert__closures__invoke2_mut__h188e918906ff9a40(a: number, b: number, c: number, d: number): void;
|
|
35
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7(a: number, b: number, c: number, d: number): void;
|
package/package.json
CHANGED
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,60 +1,34 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param {
|
|
7
|
-
* @returns {
|
|
8
|
-
*/
|
|
9
|
-
export function and(lhs: string, rhs: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
12
|
-
* @param {string} lhs
|
|
13
|
-
* @param {string} rhs
|
|
14
|
-
* @returns {string}
|
|
15
|
-
*/
|
|
16
|
-
export function xor(lhs: string, rhs: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Calculates the SHA256 hash of the input bytes
|
|
19
|
-
* @param {Uint8Array} inputs
|
|
20
|
-
* @returns {Uint8Array}
|
|
21
|
-
*/
|
|
22
|
-
export function sha256(inputs: Uint8Array): Uint8Array;
|
|
23
|
-
/**
|
|
24
|
-
* Calculates the Blake2s256 hash of the input bytes
|
|
25
|
-
* @param {Uint8Array} inputs
|
|
26
|
-
* @returns {Uint8Array}
|
|
27
|
-
*/
|
|
28
|
-
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
29
|
-
/**
|
|
30
|
-
* Calculates the Keccak256 hash of the input bytes
|
|
31
|
-
* @param {Uint8Array} inputs
|
|
32
|
-
* @returns {Uint8Array}
|
|
4
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
5
|
+
*
|
|
6
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
7
|
+
* @returns {Uint8Array} A compressed witness map
|
|
33
8
|
*/
|
|
34
|
-
export function
|
|
9
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
35
10
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* @param {Uint8Array}
|
|
40
|
-
* @
|
|
41
|
-
* @returns {boolean}
|
|
11
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
12
|
+
* This should be used to only fetch the witness map for the main function.
|
|
13
|
+
*
|
|
14
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
15
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
42
16
|
*/
|
|
43
|
-
export function
|
|
17
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
44
18
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* @param {
|
|
48
|
-
* @
|
|
49
|
-
* @param {Uint8Array} signature
|
|
50
|
-
* @returns {boolean}
|
|
19
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
20
|
+
*
|
|
21
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
22
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
51
23
|
*/
|
|
52
|
-
export function
|
|
24
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
53
25
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
26
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
27
|
+
*
|
|
28
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
29
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
56
30
|
*/
|
|
57
|
-
export function
|
|
31
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
58
32
|
/**
|
|
59
33
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
60
34
|
*
|
|
@@ -89,40 +63,55 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
89
63
|
*/
|
|
90
64
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
91
65
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* @param {
|
|
66
|
+
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
67
|
+
* @param {string} lhs
|
|
68
|
+
* @param {string} rhs
|
|
69
|
+
* @returns {string}
|
|
95
70
|
*/
|
|
96
|
-
export function
|
|
71
|
+
export function and(lhs: string, rhs: string): string;
|
|
97
72
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* @param {
|
|
101
|
-
* @returns {
|
|
73
|
+
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
74
|
+
* @param {string} lhs
|
|
75
|
+
* @param {string} rhs
|
|
76
|
+
* @returns {string}
|
|
102
77
|
*/
|
|
103
|
-
export function
|
|
78
|
+
export function xor(lhs: string, rhs: string): string;
|
|
104
79
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
109
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
80
|
+
* Calculates the SHA256 hash of the input bytes
|
|
81
|
+
* @param {Uint8Array} inputs
|
|
82
|
+
* @returns {Uint8Array}
|
|
110
83
|
*/
|
|
111
|
-
export function
|
|
84
|
+
export function sha256(inputs: Uint8Array): Uint8Array;
|
|
112
85
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* @
|
|
116
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
86
|
+
* Calculates the Blake2s256 hash of the input bytes
|
|
87
|
+
* @param {Uint8Array} inputs
|
|
88
|
+
* @returns {Uint8Array}
|
|
117
89
|
*/
|
|
118
|
-
export function
|
|
90
|
+
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
119
91
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* @
|
|
123
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
92
|
+
* Calculates the Keccak256 hash of the input bytes
|
|
93
|
+
* @param {Uint8Array} inputs
|
|
94
|
+
* @returns {Uint8Array}
|
|
124
95
|
*/
|
|
125
|
-
export function
|
|
96
|
+
export function keccak256(inputs: Uint8Array): Uint8Array;
|
|
97
|
+
/**
|
|
98
|
+
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
99
|
+
* @param {Uint8Array} hashed_msg
|
|
100
|
+
* @param {Uint8Array} public_key_x_bytes
|
|
101
|
+
* @param {Uint8Array} public_key_y_bytes
|
|
102
|
+
* @param {Uint8Array} signature
|
|
103
|
+
* @returns {boolean}
|
|
104
|
+
*/
|
|
105
|
+
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
108
|
+
* @param {Uint8Array} hashed_msg
|
|
109
|
+
* @param {Uint8Array} public_key_x_bytes
|
|
110
|
+
* @param {Uint8Array} public_key_y_bytes
|
|
111
|
+
* @param {Uint8Array} signature
|
|
112
|
+
* @returns {boolean}
|
|
113
|
+
*/
|
|
114
|
+
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
126
115
|
/**
|
|
127
116
|
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
128
117
|
*/
|
|
@@ -163,12 +152,17 @@ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap,
|
|
|
163
152
|
/**
|
|
164
153
|
*/
|
|
165
154
|
export function executeProgramWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_executor: ForeignCallHandler): Promise<WitnessStack>;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Sets the package's logging level.
|
|
157
|
+
*
|
|
158
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
159
|
+
*/
|
|
160
|
+
export function initLogLevel(filter: string): void;
|
|
161
|
+
/**
|
|
162
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
163
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
164
|
+
*/
|
|
165
|
+
export function buildInfo(): BuildInfo;
|
|
172
166
|
|
|
173
167
|
// Map from witness index to hex string value of witness.
|
|
174
168
|
export type WitnessMap = Map<number, string>;
|
|
@@ -185,6 +179,17 @@ export type SolvedAndReturnWitness = {
|
|
|
185
179
|
|
|
186
180
|
|
|
187
181
|
|
|
182
|
+
export type RawAssertionPayload = {
|
|
183
|
+
selector: string;
|
|
184
|
+
data: string[];
|
|
185
|
+
};
|
|
186
|
+
export type ExecutionError = Error & {
|
|
187
|
+
callStack?: string[];
|
|
188
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
188
193
|
/**
|
|
189
194
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
190
195
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -231,6 +236,13 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
231
236
|
|
|
232
237
|
export interface InitOutput {
|
|
233
238
|
readonly memory: WebAssembly.Memory;
|
|
239
|
+
readonly compressWitness: (a: number, b: number) => void;
|
|
240
|
+
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
241
|
+
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
242
|
+
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
243
|
+
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
244
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
245
|
+
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
234
246
|
readonly and: (a: number, b: number) => number;
|
|
235
247
|
readonly xor: (a: number, b: number) => number;
|
|
236
248
|
readonly sha256: (a: number, b: number, c: number) => void;
|
|
@@ -238,15 +250,6 @@ export interface InitOutput {
|
|
|
238
250
|
readonly keccak256: (a: number, b: number, c: number) => void;
|
|
239
251
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
240
252
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
241
|
-
readonly buildInfo: () => number;
|
|
242
|
-
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
243
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
244
|
-
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
245
|
-
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
246
|
-
readonly compressWitness: (a: number, b: number) => void;
|
|
247
|
-
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
248
|
-
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
249
|
-
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
250
253
|
readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
|
|
251
254
|
readonly createBlackBoxSolver: () => number;
|
|
252
255
|
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -254,17 +257,17 @@ export interface InitOutput {
|
|
|
254
257
|
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
255
258
|
readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
|
|
256
259
|
readonly executeProgramWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
257
|
-
readonly
|
|
258
|
-
readonly
|
|
260
|
+
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
261
|
+
readonly buildInfo: () => number;
|
|
259
262
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
260
263
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
261
264
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
262
|
-
readonly
|
|
265
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380: (a: number, b: number, c: number) => void;
|
|
263
266
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
264
267
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
268
|
+
readonly wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
265
269
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
266
|
-
readonly
|
|
267
|
-
readonly wasm_bindgen__convert__closures__invoke2_mut__h188e918906ff9a40: (a: number, b: number, c: number, d: number) => void;
|
|
270
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7: (a: number, b: number, c: number, d: number) => void;
|
|
268
271
|
}
|
|
269
272
|
|
|
270
273
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|