@noir-lang/acvm_js 1.0.0-beta.15-1fce7ca.nightly → 1.0.0-beta.15-d2c71c4.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 +66 -66
- package/nodejs/acvm_js.js +192 -191
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +14 -14
- package/package.json +1 -1
- package/web/acvm_js.d.ts +80 -80
- package/web/acvm_js.js +190 -189
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +14 -14
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,35 +1,62 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
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
|
|
5
8
|
*/
|
|
6
|
-
export function
|
|
9
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
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.
|
|
9
16
|
*/
|
|
10
|
-
export function
|
|
17
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
11
18
|
/**
|
|
12
|
-
*
|
|
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
|
|
13
23
|
*/
|
|
14
|
-
export function
|
|
24
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
15
25
|
/**
|
|
16
|
-
*
|
|
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.
|
|
17
30
|
*/
|
|
18
|
-
export function
|
|
31
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
19
32
|
/**
|
|
20
|
-
*
|
|
33
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
34
|
+
*
|
|
35
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
36
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
37
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
38
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
21
39
|
*/
|
|
22
|
-
export function
|
|
40
|
+
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
23
41
|
/**
|
|
24
|
-
*
|
|
42
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
43
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
44
|
+
*
|
|
45
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
46
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
47
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
48
|
+
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
|
|
25
49
|
*/
|
|
26
|
-
export function
|
|
50
|
+
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
27
51
|
/**
|
|
28
|
-
*
|
|
52
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
29
53
|
*
|
|
30
|
-
* @param {
|
|
54
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
55
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
56
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
57
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
31
58
|
*/
|
|
32
|
-
export function
|
|
59
|
+
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
33
60
|
/**
|
|
34
61
|
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
35
62
|
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
@@ -60,71 +87,35 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
60
87
|
*/
|
|
61
88
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
62
89
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
66
|
-
* @returns {Uint8Array} A compressed witness map
|
|
90
|
+
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
67
91
|
*/
|
|
68
|
-
export function
|
|
92
|
+
export function and(lhs: string, rhs: string): string;
|
|
69
93
|
/**
|
|
70
|
-
*
|
|
71
|
-
* This should be used to only fetch the witness map for the main function.
|
|
72
|
-
*
|
|
73
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
74
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
94
|
+
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
75
95
|
*/
|
|
76
|
-
export function
|
|
96
|
+
export function xor(lhs: string, rhs: string): string;
|
|
77
97
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
81
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
98
|
+
* Sha256 compression function
|
|
82
99
|
*/
|
|
83
|
-
export function
|
|
100
|
+
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
84
101
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
88
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
102
|
+
* Calculates the Blake2s256 hash of the input bytes
|
|
89
103
|
*/
|
|
90
|
-
export function
|
|
104
|
+
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
91
105
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
95
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
96
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
97
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
106
|
+
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
98
107
|
*/
|
|
99
|
-
export function
|
|
108
|
+
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
100
109
|
/**
|
|
101
|
-
*
|
|
102
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
103
|
-
*
|
|
104
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
105
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
106
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
107
|
-
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
|
|
110
|
+
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
108
111
|
*/
|
|
109
|
-
export function
|
|
112
|
+
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
110
113
|
/**
|
|
111
|
-
*
|
|
114
|
+
* Sets the package's logging level.
|
|
112
115
|
*
|
|
113
|
-
* @param {
|
|
114
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
115
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
116
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
116
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
117
117
|
*/
|
|
118
|
-
export function
|
|
119
|
-
|
|
120
|
-
export type StackItem = {
|
|
121
|
-
index: number;
|
|
122
|
-
witness: WitnessMap;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export type WitnessStack = Array<StackItem>;
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
export function initLogLevel(filter: string): void;
|
|
128
119
|
|
|
129
120
|
/**
|
|
130
121
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
@@ -183,21 +174,19 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
183
174
|
|
|
184
175
|
|
|
185
176
|
|
|
177
|
+
export type StackItem = {
|
|
178
|
+
index: number;
|
|
179
|
+
witness: WitnessMap;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type WitnessStack = Array<StackItem>;
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
186
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
187
187
|
|
|
188
188
|
export interface InitOutput {
|
|
189
189
|
readonly memory: WebAssembly.Memory;
|
|
190
|
-
readonly and: (a: any, b: any) => any;
|
|
191
|
-
readonly xor: (a: any, b: any) => any;
|
|
192
|
-
readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
193
|
-
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
194
|
-
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
195
|
-
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
196
|
-
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
197
|
-
readonly buildInfo: () => any;
|
|
198
|
-
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
199
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
200
|
-
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
201
190
|
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
202
191
|
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
203
192
|
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
@@ -205,6 +194,17 @@ export interface InitOutput {
|
|
|
205
194
|
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
206
195
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
207
196
|
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
197
|
+
readonly buildInfo: () => any;
|
|
198
|
+
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
199
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
200
|
+
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
201
|
+
readonly and: (a: any, b: any) => any;
|
|
202
|
+
readonly xor: (a: any, b: any) => any;
|
|
203
|
+
readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
204
|
+
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
205
|
+
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
206
|
+
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
207
|
+
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
208
208
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
209
209
|
readonly __externref_table_alloc: () => number;
|
|
210
210
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -213,9 +213,9 @@ export interface InitOutput {
|
|
|
213
213
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
214
214
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
215
215
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
218
|
-
readonly
|
|
216
|
+
readonly closure577_externref_shim: (a: number, b: number, c: any) => void;
|
|
217
|
+
readonly closure1172_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
218
|
+
readonly closure1176_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
219
219
|
readonly __wbindgen_start: () => void;
|
|
220
220
|
}
|
|
221
221
|
|