@aztec/noir-acvm_js 0.0.1-commit.7d4e6cd → 0.0.1-commit.8afd444
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 +93 -93
- package/nodejs/acvm_js.js +139 -139
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +15 -15
- package/package.json +3 -3
- package/web/acvm_js.d.ts +108 -108
- package/web/acvm_js.js +139 -139
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +15 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/noir-acvm_js",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.8afd444",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"@web/test-runner-playwright": "^0.11.1",
|
|
44
44
|
"chai": "^6.2.2",
|
|
45
45
|
"eslint": "^9.39.2",
|
|
46
|
-
"eslint-plugin-prettier": "^5.5.
|
|
46
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
47
47
|
"mocha": "^11.7.5",
|
|
48
|
-
"prettier": "3.
|
|
48
|
+
"prettier": "3.8.1",
|
|
49
49
|
"ts-node": "^10.9.2",
|
|
50
50
|
"typescript": "^5.8.3"
|
|
51
51
|
}
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,11 +1,63 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
5
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
|
+
*/
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
5
10
|
*
|
|
6
|
-
* @param {
|
|
11
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
12
|
+
* @returns {Uint8Array} A compressed witness map
|
|
7
13
|
*/
|
|
8
|
-
export function
|
|
14
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
17
|
+
* This should be used to only fetch the witness map for the main function.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
20
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
21
|
+
*/
|
|
22
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
23
|
+
/**
|
|
24
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
25
|
+
*
|
|
26
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
27
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
28
|
+
*/
|
|
29
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
34
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
35
|
+
*/
|
|
36
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
37
|
+
/**
|
|
38
|
+
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
39
|
+
*/
|
|
40
|
+
export function and(lhs: string, rhs: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
43
|
+
*/
|
|
44
|
+
export function xor(lhs: string, rhs: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Sha256 compression function
|
|
47
|
+
*/
|
|
48
|
+
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
49
|
+
/**
|
|
50
|
+
* Calculates the Blake2s256 hash of the input bytes
|
|
51
|
+
*/
|
|
52
|
+
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
53
|
+
/**
|
|
54
|
+
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
55
|
+
*/
|
|
56
|
+
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
59
|
+
*/
|
|
60
|
+
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
9
61
|
/**
|
|
10
62
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
11
63
|
*
|
|
@@ -34,6 +86,12 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
34
86
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
35
87
|
*/
|
|
36
88
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
89
|
+
/**
|
|
90
|
+
* Sets the package's logging level.
|
|
91
|
+
*
|
|
92
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
93
|
+
*/
|
|
94
|
+
export function initLogLevel(filter: string): void;
|
|
37
95
|
/**
|
|
38
96
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
97
|
*
|
|
@@ -58,90 +116,26 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
58
116
|
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
59
117
|
*/
|
|
60
118
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
61
|
-
/**
|
|
62
|
-
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
63
|
-
*/
|
|
64
|
-
export function and(lhs: string, rhs: string): string;
|
|
65
|
-
/**
|
|
66
|
-
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
67
|
-
*/
|
|
68
|
-
export function xor(lhs: string, rhs: string): string;
|
|
69
|
-
/**
|
|
70
|
-
* Sha256 compression function
|
|
71
|
-
*/
|
|
72
|
-
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
73
|
-
/**
|
|
74
|
-
* Calculates the Blake2s256 hash of the input bytes
|
|
75
|
-
*/
|
|
76
|
-
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
77
|
-
/**
|
|
78
|
-
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
79
|
-
*/
|
|
80
|
-
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
83
|
-
*/
|
|
84
|
-
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
87
|
-
*
|
|
88
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
89
|
-
* @returns {Uint8Array} A compressed witness map
|
|
90
|
-
*/
|
|
91
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
92
|
-
/**
|
|
93
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
94
|
-
* This should be used to only fetch the witness map for the main function.
|
|
95
|
-
*
|
|
96
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
97
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
98
|
-
*/
|
|
99
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
100
|
-
/**
|
|
101
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
102
|
-
*
|
|
103
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
104
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
105
|
-
*/
|
|
106
|
-
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
107
|
-
/**
|
|
108
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
109
|
-
*
|
|
110
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
111
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
112
|
-
*/
|
|
113
|
-
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
114
|
-
/**
|
|
115
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
116
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
117
|
-
*/
|
|
118
|
-
export function buildInfo(): BuildInfo;
|
|
119
119
|
|
|
120
|
-
export type
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export type ExecutionError = Error & {
|
|
126
|
-
callStack?: string[];
|
|
127
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
128
|
-
acirFunctionId?: number;
|
|
129
|
-
brilligFunctionId?: number;
|
|
130
|
-
};
|
|
120
|
+
export type StackItem = {
|
|
121
|
+
index: number;
|
|
122
|
+
witness: WitnessMap;
|
|
123
|
+
}
|
|
131
124
|
|
|
125
|
+
export type WitnessStack = Array<StackItem>;
|
|
132
126
|
|
|
133
127
|
|
|
134
|
-
// Map from witness index to hex string value of witness.
|
|
135
|
-
export type WitnessMap = Map<number, string>;
|
|
136
128
|
|
|
137
129
|
/**
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
131
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
132
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
133
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
141
134
|
*/
|
|
142
|
-
export type
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
export type BuildInfo = {
|
|
136
|
+
gitHash: string;
|
|
137
|
+
version: string;
|
|
138
|
+
dirty: string;
|
|
145
139
|
}
|
|
146
140
|
|
|
147
141
|
|
|
@@ -160,25 +154,31 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
160
154
|
|
|
161
155
|
|
|
162
156
|
|
|
163
|
-
export type
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
157
|
+
export type RawAssertionPayload = {
|
|
158
|
+
selector: string;
|
|
159
|
+
data: string[];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export type ExecutionError = Error & {
|
|
163
|
+
callStack?: string[];
|
|
164
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
165
|
+
acirFunctionId?: number;
|
|
166
|
+
brilligFunctionId?: number;
|
|
167
|
+
};
|
|
167
168
|
|
|
168
|
-
export type WitnessStack = Array<StackItem>;
|
|
169
169
|
|
|
170
170
|
|
|
171
|
+
// Map from witness index to hex string value of witness.
|
|
172
|
+
export type WitnessMap = Map<number, string>;
|
|
171
173
|
|
|
172
174
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
175
|
+
* An execution result containing two witnesses.
|
|
176
|
+
* 1. The full solved witness of the execution.
|
|
177
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
177
178
|
*/
|
|
178
|
-
export type
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
dirty: string;
|
|
179
|
+
export type SolvedAndReturnWitness = {
|
|
180
|
+
solvedWitness: WitnessMap;
|
|
181
|
+
returnWitness: WitnessMap;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
|
|
@@ -187,24 +187,24 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
187
187
|
|
|
188
188
|
export interface InitOutput {
|
|
189
189
|
readonly memory: WebAssembly.Memory;
|
|
190
|
-
readonly
|
|
191
|
-
readonly
|
|
192
|
-
readonly
|
|
193
|
-
readonly
|
|
194
|
-
readonly
|
|
195
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
196
|
-
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
190
|
+
readonly buildInfo: () => any;
|
|
191
|
+
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
192
|
+
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
193
|
+
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
194
|
+
readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
197
195
|
readonly and: (a: any, b: any) => any;
|
|
198
196
|
readonly xor: (a: any, b: any) => any;
|
|
199
197
|
readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
200
198
|
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
201
199
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
202
200
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
203
|
-
readonly
|
|
204
|
-
readonly
|
|
205
|
-
readonly
|
|
206
|
-
readonly
|
|
207
|
-
readonly
|
|
201
|
+
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
202
|
+
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
203
|
+
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
204
|
+
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
205
|
+
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
206
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
207
|
+
readonly getPublicWitness: (a: number, b: number, c: any) => [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 closure448_externref_shim: (a: number, b: number, c: any) => void;
|
|
217
|
+
readonly closure933_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
218
|
+
readonly closure937_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
219
219
|
readonly __wbindgen_start: () => void;
|
|
220
220
|
}
|
|
221
221
|
|