@noir-lang/acvm_js 0.27.0 → 0.28.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.
Binary file
@@ -1,24 +1,31 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function buildInfo(): number;
5
4
  export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
6
5
  export function executeCircuit(a: number, b: number, c: number, d: number): number;
7
6
  export function createBlackBoxSolver(): number;
8
7
  export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
9
8
  export function decompressWitness(a: number, b: number, c: number): void;
10
9
  export function compressWitness(a: number, b: number): void;
10
+ 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 ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
12
+ export function keccak256(a: number, b: number, c: number): void;
13
+ export function blake2s256(a: number, b: number, c: number): void;
14
+ export function sha256(a: number, b: number, c: number): void;
15
+ export function xor(a: number, b: number): number;
16
+ export function and(a: number, b: number): number;
17
+ export function buildInfo(): number;
11
18
  export function initLogLevel(a: number): void;
12
19
  export function getPublicWitness(a: number, b: number, c: number, d: number): void;
13
20
  export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
14
21
  export function getReturnWitness(a: number, b: number, c: number, d: number): void;
15
22
  export function __wbg_trap_free(a: number): void;
16
23
  export function trap___wbgd_downcast_token(): number;
17
- export function __wbindgen_malloc(a: number, b: number): number;
18
- export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
24
+ export function __wbindgen_malloc(a: number): number;
25
+ export function __wbindgen_realloc(a: number, b: number, c: number): number;
19
26
  export const __wbindgen_export_2: WebAssembly.Table;
20
- export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7be0e81f38bcb593(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__h1dfec0dba43a4c9e(a: number, b: number, c: number): void;
21
28
  export function __wbindgen_add_to_stack_pointer(a: number): number;
22
- export function __wbindgen_free(a: number, b: number, c: number): void;
29
+ export function __wbindgen_free(a: number, b: number): void;
23
30
  export function __wbindgen_exn_store(a: number): void;
24
- export function wasm_bindgen__convert__closures__invoke2_mut__h2cc2a3675130eda0(a: number, b: number, c: number, d: number): void;
31
+ export function wasm_bindgen__convert__closures__invoke2_mut__h43234701b229d587(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.27.0",
3
+ "version": "0.28.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/noir-lang/acvm.git"
@@ -20,5 +20,27 @@
20
20
  "web",
21
21
  "package.json"
22
22
  ],
23
- "sideEffects": false
24
- }
23
+ "sideEffects": false,
24
+ "packageManager": "yarn@3.5.1",
25
+ "scripts": {
26
+ "build": "bash ./build.sh",
27
+ "test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
28
+ "test:browser": "web-test-runner",
29
+ "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
30
+ "which": "which yarn",
31
+ "clean": "chmod u+w web nodejs || true && rm -rf web nodejs"
32
+ },
33
+ "devDependencies": {
34
+ "@esm-bundle/chai": "^4.3.4-fix.0",
35
+ "@web/dev-server-esbuild": "^0.3.6",
36
+ "@web/test-runner": "^0.15.3",
37
+ "@web/test-runner-playwright": "^0.10.0",
38
+ "chai": "^4.3.7",
39
+ "eslint": "^8.50.0",
40
+ "eslint-plugin-prettier": "^5.0.0",
41
+ "mocha": "^10.2.0",
42
+ "prettier": "3.0.3",
43
+ "ts-node": "^10.9.1",
44
+ "typescript": "^5.0.4"
45
+ }
46
+ }
package/web/acvm_js.d.ts CHANGED
@@ -1,11 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
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
4
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
10
5
  *
11
6
  * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
@@ -43,6 +38,62 @@ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
43
38
  */
44
39
  export function compressWitness(witness_map: WitnessMap): Uint8Array;
45
40
  /**
41
+ * Verifies a ECDSA signature over the secp256r1 curve.
42
+ * @param {Uint8Array} hashed_msg
43
+ * @param {Uint8Array} public_key_x_bytes
44
+ * @param {Uint8Array} public_key_y_bytes
45
+ * @param {Uint8Array} signature
46
+ * @returns {boolean}
47
+ */
48
+ export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
49
+ /**
50
+ * Calculates the Blake2s256 hash of the input bytes and represents these as a single field element.
51
+ * Verifies a ECDSA signature over the secp256k1 curve.
52
+ * @param {Uint8Array} hashed_msg
53
+ * @param {Uint8Array} public_key_x_bytes
54
+ * @param {Uint8Array} public_key_y_bytes
55
+ * @param {Uint8Array} signature
56
+ * @returns {boolean}
57
+ */
58
+ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
59
+ /**
60
+ * Calculates the Keccak256 hash of the input bytes
61
+ * @param {Uint8Array} inputs
62
+ * @returns {Uint8Array}
63
+ */
64
+ export function keccak256(inputs: Uint8Array): Uint8Array;
65
+ /**
66
+ * Calculates the Blake2s256 hash of the input bytes
67
+ * @param {Uint8Array} inputs
68
+ * @returns {Uint8Array}
69
+ */
70
+ export function blake2s256(inputs: Uint8Array): Uint8Array;
71
+ /**
72
+ * Calculates the SHA256 hash of the input bytes
73
+ * @param {Uint8Array} inputs
74
+ * @returns {Uint8Array}
75
+ */
76
+ export function sha256(inputs: Uint8Array): Uint8Array;
77
+ /**
78
+ * Performs a bitwise XOR operation between `lhs` and `rhs`
79
+ * @param {string} lhs
80
+ * @param {string} rhs
81
+ * @returns {string}
82
+ */
83
+ export function xor(lhs: string, rhs: string): string;
84
+ /**
85
+ * Performs a bitwise AND operation between `lhs` and `rhs`
86
+ * @param {string} lhs
87
+ * @param {string} rhs
88
+ * @returns {string}
89
+ */
90
+ export function and(lhs: string, rhs: string): string;
91
+ /**
92
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
93
+ * @returns {BuildInfo} - Information on how the installed package was built.
94
+ */
95
+ export function buildInfo(): BuildInfo;
96
+ /**
46
97
  * Sets the package's logging level.
47
98
  *
48
99
  * @param {LogLevel} level - The maximum level of logging to be emitted.
@@ -110,13 +161,13 @@ export type BuildInfo = {
110
161
 
111
162
 
112
163
 
113
- export type ExecutionError = Error & {
114
- callStack?: string[];
115
- };
164
+ export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
116
165
 
117
166
 
118
167
 
119
- export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
168
+ export type ExecutionError = Error & {
169
+ callStack?: string[];
170
+ };
120
171
 
121
172
 
122
173
 
@@ -144,27 +195,34 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
144
195
 
145
196
  export interface InitOutput {
146
197
  readonly memory: WebAssembly.Memory;
147
- readonly buildInfo: () => number;
148
198
  readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
149
199
  readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
150
200
  readonly createBlackBoxSolver: () => number;
151
201
  readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
152
202
  readonly decompressWitness: (a: number, b: number, c: number) => void;
153
203
  readonly compressWitness: (a: number, b: number) => void;
204
+ readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: 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 keccak256: (a: number, b: number, c: number) => void;
207
+ readonly blake2s256: (a: number, b: number, c: number) => void;
208
+ readonly sha256: (a: number, b: number, c: number) => void;
209
+ readonly xor: (a: number, b: number) => number;
210
+ readonly and: (a: number, b: number) => number;
211
+ readonly buildInfo: () => number;
154
212
  readonly initLogLevel: (a: number) => void;
155
213
  readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
156
214
  readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
157
215
  readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
158
216
  readonly __wbg_trap_free: (a: number) => void;
159
217
  readonly trap___wbgd_downcast_token: () => number;
160
- readonly __wbindgen_malloc: (a: number, b: number) => number;
161
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
218
+ readonly __wbindgen_malloc: (a: number) => number;
219
+ readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
162
220
  readonly __wbindgen_export_2: WebAssembly.Table;
163
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7be0e81f38bcb593: (a: number, b: number, c: number) => void;
221
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1dfec0dba43a4c9e: (a: number, b: number, c: number) => void;
164
222
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
165
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
223
+ readonly __wbindgen_free: (a: number, b: number) => void;
166
224
  readonly __wbindgen_exn_store: (a: number) => void;
167
- readonly wasm_bindgen__convert__closures__invoke2_mut__h2cc2a3675130eda0: (a: number, b: number, c: number, d: number) => void;
225
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h43234701b229d587: (a: number, b: number, c: number, d: number) => void;
168
226
  }
169
227
 
170
228
  export type SyncInitInput = BufferSource | WebAssembly.Module;