@aztec/bb.js 3.0.0-nightly.20251026 → 3.0.0-nightly.20251030-2

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.
Files changed (147) hide show
  1. package/README.md +1 -1
  2. package/dest/browser/barretenberg/backend.js +13 -13
  3. package/dest/browser/barretenberg/index.d.ts +1 -1
  4. package/dest/browser/barretenberg/index.d.ts.map +1 -1
  5. package/dest/browser/barretenberg/index.js +2 -2
  6. package/dest/browser/barretenberg_wasm/barretenberg_wasm_main/heap_allocator.js +1 -1
  7. package/dest/browser/barretenberg_wasm/fetch_code/browser/barretenberg-threads.js +1 -1
  8. package/dest/browser/barretenberg_wasm/fetch_code/browser/barretenberg.js +1 -1
  9. package/dest/browser/bb_backends/wasm.d.ts +2 -9
  10. package/dest/browser/bb_backends/wasm.d.ts.map +1 -1
  11. package/dest/browser/bb_backends/wasm.js +3 -10
  12. package/dest/browser/bbapi_exception.d.ts +7 -0
  13. package/dest/browser/bbapi_exception.d.ts.map +1 -0
  14. package/dest/browser/bbapi_exception.js +14 -0
  15. package/dest/browser/cbind/generate.js +93 -1
  16. package/dest/browser/cbind/generated/api_types.d.ts +623 -377
  17. package/dest/browser/cbind/generated/api_types.d.ts.map +1 -1
  18. package/dest/browser/cbind/generated/api_types.js +778 -452
  19. package/dest/browser/cbind/generated/async.d.ts +15 -10
  20. package/dest/browser/cbind/generated/async.d.ts.map +1 -1
  21. package/dest/browser/cbind/generated/async.js +304 -96
  22. package/dest/browser/cbind/generated/curve_constants.d.ts +45 -0
  23. package/dest/browser/cbind/generated/curve_constants.d.ts.map +1 -0
  24. package/dest/browser/cbind/generated/curve_constants.js +45 -0
  25. package/dest/browser/cbind/generated/sync.d.ts +15 -10
  26. package/dest/browser/cbind/generated/sync.d.ts.map +1 -1
  27. package/dest/browser/cbind/generated/sync.js +299 -96
  28. package/dest/browser/cbind/schema_compiler.d.ts.map +1 -1
  29. package/dest/browser/cbind/schema_compiler.js +24 -4
  30. package/dest/browser/index.d.ts +3 -1
  31. package/dest/browser/index.d.ts.map +1 -1
  32. package/dest/browser/index.js +4 -2
  33. package/dest/browser/serialize/index.d.ts +0 -1
  34. package/dest/browser/serialize/index.d.ts.map +1 -1
  35. package/dest/browser/serialize/index.js +1 -2
  36. package/dest/browser/types/fields.d.ts +6 -26
  37. package/dest/browser/types/fields.d.ts.map +1 -1
  38. package/dest/browser/types/fields.js +15 -56
  39. package/dest/browser/types/point.d.ts +8 -6
  40. package/dest/browser/types/point.d.ts.map +1 -1
  41. package/dest/browser/types/point.js +12 -15
  42. package/dest/node/barretenberg/backend.js +13 -13
  43. package/dest/node/barretenberg/index.d.ts +1 -1
  44. package/dest/node/barretenberg/index.d.ts.map +1 -1
  45. package/dest/node/barretenberg/index.js +2 -2
  46. package/dest/node/barretenberg/poseidon.bench.test.js +3 -2
  47. package/dest/node/barretenberg_wasm/barretenberg-threads.wasm.gz +0 -0
  48. package/dest/node/barretenberg_wasm/barretenberg_wasm_main/heap_allocator.js +1 -1
  49. package/dest/node/bb_backends/wasm.d.ts +2 -9
  50. package/dest/node/bb_backends/wasm.d.ts.map +1 -1
  51. package/dest/node/bb_backends/wasm.js +3 -10
  52. package/dest/node/bbapi_exception.d.ts +7 -0
  53. package/dest/node/bbapi_exception.d.ts.map +1 -0
  54. package/dest/node/bbapi_exception.js +14 -0
  55. package/dest/node/cbind/generate.js +93 -1
  56. package/dest/node/cbind/generated/api_types.d.ts +623 -377
  57. package/dest/node/cbind/generated/api_types.d.ts.map +1 -1
  58. package/dest/node/cbind/generated/api_types.js +778 -452
  59. package/dest/node/cbind/generated/async.d.ts +15 -10
  60. package/dest/node/cbind/generated/async.d.ts.map +1 -1
  61. package/dest/node/cbind/generated/async.js +304 -96
  62. package/dest/node/cbind/generated/curve_constants.d.ts +45 -0
  63. package/dest/node/cbind/generated/curve_constants.d.ts.map +1 -0
  64. package/dest/node/cbind/generated/curve_constants.js +45 -0
  65. package/dest/node/cbind/generated/sync.d.ts +15 -10
  66. package/dest/node/cbind/generated/sync.d.ts.map +1 -1
  67. package/dest/node/cbind/generated/sync.js +299 -96
  68. package/dest/node/cbind/schema_compiler.d.ts.map +1 -1
  69. package/dest/node/cbind/schema_compiler.js +24 -4
  70. package/dest/node/index.d.ts +3 -1
  71. package/dest/node/index.d.ts.map +1 -1
  72. package/dest/node/index.js +4 -2
  73. package/dest/node/serialize/index.d.ts +0 -1
  74. package/dest/node/serialize/index.d.ts.map +1 -1
  75. package/dest/node/serialize/index.js +1 -2
  76. package/dest/node/types/fields.d.ts +6 -26
  77. package/dest/node/types/fields.d.ts.map +1 -1
  78. package/dest/node/types/fields.js +15 -56
  79. package/dest/node/types/point.d.ts +8 -6
  80. package/dest/node/types/point.d.ts.map +1 -1
  81. package/dest/node/types/point.js +12 -15
  82. package/dest/node-cjs/barretenberg/backend.js +12 -12
  83. package/dest/node-cjs/barretenberg/index.d.ts +1 -1
  84. package/dest/node-cjs/barretenberg/index.d.ts.map +1 -1
  85. package/dest/node-cjs/barretenberg/index.js +2 -2
  86. package/dest/node-cjs/barretenberg/poseidon.bench.test.js +5 -4
  87. package/dest/node-cjs/barretenberg_wasm/barretenberg-threads.wasm.gz +0 -0
  88. package/dest/node-cjs/barretenberg_wasm/barretenberg_wasm_main/heap_allocator.js +1 -1
  89. package/dest/node-cjs/bb_backends/wasm.d.ts +2 -9
  90. package/dest/node-cjs/bb_backends/wasm.d.ts.map +1 -1
  91. package/dest/node-cjs/bb_backends/wasm.js +3 -10
  92. package/dest/node-cjs/bbapi_exception.d.ts +7 -0
  93. package/dest/node-cjs/bbapi_exception.d.ts.map +1 -0
  94. package/dest/node-cjs/bbapi_exception.js +18 -0
  95. package/dest/node-cjs/cbind/generate.js +93 -1
  96. package/dest/node-cjs/cbind/generated/api_types.d.ts +623 -377
  97. package/dest/node-cjs/cbind/generated/api_types.d.ts.map +1 -1
  98. package/dest/node-cjs/cbind/generated/api_types.js +848 -492
  99. package/dest/node-cjs/cbind/generated/async.d.ts +15 -10
  100. package/dest/node-cjs/cbind/generated/async.d.ts.map +1 -1
  101. package/dest/node-cjs/cbind/generated/async.js +303 -95
  102. package/dest/node-cjs/cbind/generated/curve_constants.d.ts +45 -0
  103. package/dest/node-cjs/cbind/generated/curve_constants.d.ts.map +1 -0
  104. package/dest/node-cjs/cbind/generated/curve_constants.js +48 -0
  105. package/dest/node-cjs/cbind/generated/sync.d.ts +15 -10
  106. package/dest/node-cjs/cbind/generated/sync.d.ts.map +1 -1
  107. package/dest/node-cjs/cbind/generated/sync.js +298 -95
  108. package/dest/node-cjs/cbind/schema_compiler.d.ts.map +1 -1
  109. package/dest/node-cjs/cbind/schema_compiler.js +24 -4
  110. package/dest/node-cjs/index.d.ts +3 -1
  111. package/dest/node-cjs/index.d.ts.map +1 -1
  112. package/dest/node-cjs/index.js +23 -8
  113. package/dest/node-cjs/serialize/index.d.ts +0 -1
  114. package/dest/node-cjs/serialize/index.d.ts.map +1 -1
  115. package/dest/node-cjs/serialize/index.js +1 -2
  116. package/dest/node-cjs/types/fields.d.ts +6 -26
  117. package/dest/node-cjs/types/fields.d.ts.map +1 -1
  118. package/dest/node-cjs/types/fields.js +15 -57
  119. package/dest/node-cjs/types/point.d.ts +8 -6
  120. package/dest/node-cjs/types/point.d.ts.map +1 -1
  121. package/dest/node-cjs/types/point.js +13 -16
  122. package/package.json +4 -3
  123. package/src/barretenberg/backend.ts +12 -12
  124. package/src/barretenberg/index.ts +1 -1
  125. package/src/barretenberg/poseidon.bench.test.ts +2 -1
  126. package/src/barretenberg_wasm/barretenberg_wasm_main/heap_allocator.ts +4 -4
  127. package/src/bb_backends/wasm.ts +2 -9
  128. package/src/bbapi_exception.ts +13 -0
  129. package/src/cbind/generate.ts +99 -0
  130. package/src/cbind/schema_compiler.ts +25 -3
  131. package/src/index.ts +28 -1
  132. package/src/serialize/index.ts +0 -1
  133. package/src/types/fields.ts +14 -63
  134. package/src/types/point.ts +13 -19
  135. package/dest/browser/serialize/buffer_reader.d.ts +0 -28
  136. package/dest/browser/serialize/buffer_reader.d.ts.map +0 -1
  137. package/dest/browser/serialize/buffer_reader.js +0 -66
  138. package/dest/node/serialize/buffer_reader.d.ts +0 -28
  139. package/dest/node/serialize/buffer_reader.d.ts.map +0 -1
  140. package/dest/node/serialize/buffer_reader.js +0 -66
  141. package/dest/node-cjs/serialize/buffer_reader.d.ts +0 -28
  142. package/dest/node-cjs/serialize/buffer_reader.d.ts.map +0 -1
  143. package/dest/node-cjs/serialize/buffer_reader.js +0 -70
  144. package/src/cbind/generated/api_types.ts +0 -3757
  145. package/src/cbind/generated/async.ts +0 -504
  146. package/src/cbind/generated/sync.ts +0 -455
  147. package/src/serialize/buffer_reader.ts +0 -85
@@ -1,3757 +0,0 @@
1
- // AUTOGENERATED FILE - DO NOT EDIT
2
-
3
-
4
- // Type aliases
5
- export type Fq = Uint8Array;
6
- export type Fr = Uint8Array;
7
- export type Secp256k1Fr = Uint8Array;
8
- export type Secp256r1Fr = Uint8Array;
9
- export type Uint256T = Uint8Array;
10
-
11
- // Public interfaces (exported)
12
- export interface AesDecrypt {
13
- ciphertext: Uint8Array;
14
- iv: Uint8Array;
15
- key: Uint8Array;
16
- length: number;
17
- }
18
-
19
- interface MsgpackAesDecrypt {
20
- ciphertext: Uint8Array;
21
- iv: Uint8Array;
22
- key: Uint8Array;
23
- length: number;
24
- }
25
-
26
- export interface AesDecryptResponse {
27
- plaintext: Uint8Array;
28
- }
29
-
30
- interface MsgpackAesDecryptResponse {
31
- plaintext: Uint8Array;
32
- }
33
-
34
- export interface AesEncrypt {
35
- plaintext: Uint8Array;
36
- iv: Uint8Array;
37
- key: Uint8Array;
38
- length: number;
39
- }
40
-
41
- interface MsgpackAesEncrypt {
42
- plaintext: Uint8Array;
43
- iv: Uint8Array;
44
- key: Uint8Array;
45
- length: number;
46
- }
47
-
48
- export interface AesEncryptResponse {
49
- ciphertext: Uint8Array;
50
- }
51
-
52
- interface MsgpackAesEncryptResponse {
53
- ciphertext: Uint8Array;
54
- }
55
-
56
- export interface AffineElement {
57
- x: Fr;
58
- y: Fr;
59
- }
60
-
61
- interface MsgpackAffineElement {
62
- x: Uint8Array;
63
- y: Uint8Array;
64
- }
65
-
66
- export interface Blake2s {
67
- data: Uint8Array;
68
- }
69
-
70
- interface MsgpackBlake2s {
71
- data: Uint8Array;
72
- }
73
-
74
- export interface Blake2sResponse {
75
- hash: Uint8Array;
76
- }
77
-
78
- interface MsgpackBlake2sResponse {
79
- hash: Uint8Array;
80
- }
81
-
82
- export interface Blake2sToField {
83
- data: Uint8Array;
84
- }
85
-
86
- interface MsgpackBlake2sToField {
87
- data: Uint8Array;
88
- }
89
-
90
- export interface Blake2sToFieldResponse {
91
- field: Fr;
92
- }
93
-
94
- interface MsgpackBlake2sToFieldResponse {
95
- field: Uint8Array;
96
- }
97
-
98
- export interface Bn254FrSqrt {
99
- input: Fr;
100
- }
101
-
102
- interface MsgpackBn254FrSqrt {
103
- input: Uint8Array;
104
- }
105
-
106
- export interface Bn254FrSqrtResponse {
107
- isSquareRoot: boolean;
108
- value: Fr;
109
- }
110
-
111
- interface MsgpackBn254FrSqrtResponse {
112
- is_square_root: boolean;
113
- value: Uint8Array;
114
- }
115
-
116
- export interface CircuitComputeVk {
117
- circuit: CircuitInputNoVK;
118
- settings: ProofSystemSettings;
119
- }
120
-
121
- interface MsgpackCircuitComputeVk {
122
- circuit: MsgpackCircuitInputNoVK;
123
- settings: MsgpackProofSystemSettings;
124
- }
125
-
126
- export interface CircuitComputeVkResponse {
127
- bytes: Uint8Array;
128
- fields: Uint256T[];
129
- hash: Uint8Array;
130
- }
131
-
132
- interface MsgpackCircuitComputeVkResponse {
133
- bytes: Uint8Array;
134
- fields: Uint8Array[];
135
- hash: Uint8Array;
136
- }
137
-
138
- export interface CircuitInfoResponse {
139
- numGates: number;
140
- numGatesDyadic: number;
141
- numAcirOpcodes: number;
142
- gatesPerOpcode: number[];
143
- }
144
-
145
- interface MsgpackCircuitInfoResponse {
146
- num_gates: number;
147
- num_gates_dyadic: number;
148
- num_acir_opcodes: number;
149
- gates_per_opcode: number[];
150
- }
151
-
152
- export interface CircuitInput {
153
- name: string;
154
- bytecode: Uint8Array;
155
- verificationKey: Uint8Array;
156
- }
157
-
158
- interface MsgpackCircuitInput {
159
- name: string;
160
- bytecode: Uint8Array;
161
- verification_key: Uint8Array;
162
- }
163
-
164
- export interface CircuitInputNoVK {
165
- name: string;
166
- bytecode: Uint8Array;
167
- }
168
-
169
- interface MsgpackCircuitInputNoVK {
170
- name: string;
171
- bytecode: Uint8Array;
172
- }
173
-
174
- export interface CircuitProve {
175
- circuit: CircuitInput;
176
- witness: Uint8Array;
177
- settings: ProofSystemSettings;
178
- }
179
-
180
- interface MsgpackCircuitProve {
181
- circuit: MsgpackCircuitInput;
182
- witness: Uint8Array;
183
- settings: MsgpackProofSystemSettings;
184
- }
185
-
186
- export interface CircuitProveResponse {
187
- publicInputs: Uint256T[];
188
- proof: Uint256T[];
189
- vk: CircuitComputeVkResponse;
190
- }
191
-
192
- interface MsgpackCircuitProveResponse {
193
- public_inputs: Uint8Array[];
194
- proof: Uint8Array[];
195
- vk: MsgpackCircuitComputeVkResponse;
196
- }
197
-
198
- export interface CircuitStats {
199
- circuit: CircuitInput;
200
- includeGatesPerOpcode: boolean;
201
- settings: ProofSystemSettings;
202
- }
203
-
204
- interface MsgpackCircuitStats {
205
- circuit: MsgpackCircuitInput;
206
- include_gates_per_opcode: boolean;
207
- settings: MsgpackProofSystemSettings;
208
- }
209
-
210
- export interface CircuitVerify {
211
- verificationKey: Uint8Array;
212
- publicInputs: Uint256T[];
213
- proof: Uint256T[];
214
- settings: ProofSystemSettings;
215
- }
216
-
217
- interface MsgpackCircuitVerify {
218
- verification_key: Uint8Array;
219
- public_inputs: Uint8Array[];
220
- proof: Uint8Array[];
221
- settings: MsgpackProofSystemSettings;
222
- }
223
-
224
- export interface CircuitVerifyResponse {
225
- verified: boolean;
226
- }
227
-
228
- interface MsgpackCircuitVerifyResponse {
229
- verified: boolean;
230
- }
231
-
232
- export interface CircuitWriteSolidityVerifier {
233
- verificationKey: Uint8Array;
234
- settings: ProofSystemSettings;
235
- }
236
-
237
- interface MsgpackCircuitWriteSolidityVerifier {
238
- verification_key: Uint8Array;
239
- settings: MsgpackProofSystemSettings;
240
- }
241
-
242
- export interface CircuitWriteSolidityVerifierResponse {
243
- solidityCode: string;
244
- }
245
-
246
- interface MsgpackCircuitWriteSolidityVerifierResponse {
247
- solidity_code: string;
248
- }
249
-
250
- export interface ClientIvcAccumulate {
251
- witness: Uint8Array;
252
- }
253
-
254
- interface MsgpackClientIvcAccumulate {
255
- witness: Uint8Array;
256
- }
257
-
258
- export interface ClientIvcAccumulateResponse {
259
- }
260
-
261
- interface MsgpackClientIvcAccumulateResponse {
262
- }
263
-
264
- export interface ClientIvcCheckPrecomputedVk {
265
- circuit: CircuitInput;
266
- }
267
-
268
- interface MsgpackClientIvcCheckPrecomputedVk {
269
- circuit: MsgpackCircuitInput;
270
- }
271
-
272
- export interface ClientIvcCheckPrecomputedVkResponse {
273
- valid: boolean;
274
- actualVk: Uint8Array;
275
- }
276
-
277
- interface MsgpackClientIvcCheckPrecomputedVkResponse {
278
- valid: boolean;
279
- actual_vk: Uint8Array;
280
- }
281
-
282
- export interface ClientIvcComputeIvcVk {
283
- circuit: CircuitInputNoVK;
284
- }
285
-
286
- interface MsgpackClientIvcComputeIvcVk {
287
- circuit: MsgpackCircuitInputNoVK;
288
- }
289
-
290
- export interface ClientIvcComputeIvcVkResponse {
291
- bytes: Uint8Array;
292
- }
293
-
294
- interface MsgpackClientIvcComputeIvcVkResponse {
295
- bytes: Uint8Array;
296
- }
297
-
298
- export interface ClientIvcComputeStandaloneVk {
299
- circuit: CircuitInputNoVK;
300
- }
301
-
302
- interface MsgpackClientIvcComputeStandaloneVk {
303
- circuit: MsgpackCircuitInputNoVK;
304
- }
305
-
306
- export interface ClientIvcComputeStandaloneVkResponse {
307
- bytes: Uint8Array;
308
- fields: Fr[];
309
- }
310
-
311
- interface MsgpackClientIvcComputeStandaloneVkResponse {
312
- bytes: Uint8Array;
313
- fields: Uint8Array[];
314
- }
315
-
316
- export interface ClientIvcLoad {
317
- circuit: CircuitInput;
318
- }
319
-
320
- interface MsgpackClientIvcLoad {
321
- circuit: MsgpackCircuitInput;
322
- }
323
-
324
- export interface ClientIvcLoadResponse {
325
- }
326
-
327
- interface MsgpackClientIvcLoadResponse {
328
- }
329
-
330
- export interface ClientIVCProof {
331
- megaProof: Fr[];
332
- goblinProof: GoblinProof;
333
- }
334
-
335
- interface MsgpackClientIVCProof {
336
- mega_proof: Uint8Array[];
337
- goblin_proof: MsgpackGoblinProof;
338
- }
339
-
340
- export interface ClientIvcProve {
341
- }
342
-
343
- interface MsgpackClientIvcProve {
344
- }
345
-
346
- export interface ClientIvcProveResponse {
347
- proof: ClientIVCProof;
348
- }
349
-
350
- interface MsgpackClientIvcProveResponse {
351
- proof: MsgpackClientIVCProof;
352
- }
353
-
354
- export interface ClientIvcStart {
355
- numCircuits: number;
356
- }
357
-
358
- interface MsgpackClientIvcStart {
359
- num_circuits: number;
360
- }
361
-
362
- export interface ClientIvcStartResponse {
363
- }
364
-
365
- interface MsgpackClientIvcStartResponse {
366
- }
367
-
368
- export interface ClientIvcStats {
369
- circuit: CircuitInputNoVK;
370
- includeGatesPerOpcode: boolean;
371
- }
372
-
373
- interface MsgpackClientIvcStats {
374
- circuit: MsgpackCircuitInputNoVK;
375
- include_gates_per_opcode: boolean;
376
- }
377
-
378
- export interface ClientIvcStatsResponse {
379
- acirOpcodes: number;
380
- circuitSize: number;
381
- gatesPerOpcode: number[];
382
- }
383
-
384
- interface MsgpackClientIvcStatsResponse {
385
- acir_opcodes: number;
386
- circuit_size: number;
387
- gates_per_opcode: number[];
388
- }
389
-
390
- export interface ClientIvcVerify {
391
- proof: ClientIVCProof;
392
- vk: Uint8Array;
393
- }
394
-
395
- interface MsgpackClientIvcVerify {
396
- proof: MsgpackClientIVCProof;
397
- vk: Uint8Array;
398
- }
399
-
400
- export interface ClientIvcVerifyResponse {
401
- valid: boolean;
402
- }
403
-
404
- interface MsgpackClientIvcVerifyResponse {
405
- valid: boolean;
406
- }
407
-
408
- export interface ECCVMProof {
409
- preIpaProof: Fr[];
410
- ipaProof: Fr[];
411
- }
412
-
413
- interface MsgpackECCVMProof {
414
- pre_ipa_proof: Uint8Array[];
415
- ipa_proof: Uint8Array[];
416
- }
417
-
418
- export interface EcdsaSecp256k1ComputePublicKey {
419
- privateKey: Secp256k1Fr;
420
- }
421
-
422
- interface MsgpackEcdsaSecp256k1ComputePublicKey {
423
- private_key: Uint8Array;
424
- }
425
-
426
- export interface EcdsaSecp256k1ComputePublicKeyResponse {
427
- publicKey: AffineElement;
428
- }
429
-
430
- interface MsgpackEcdsaSecp256k1ComputePublicKeyResponse {
431
- public_key: MsgpackAffineElement;
432
- }
433
-
434
- export interface EcdsaSecp256k1ConstructSignature {
435
- message: Uint8Array;
436
- privateKey: Secp256k1Fr;
437
- }
438
-
439
- interface MsgpackEcdsaSecp256k1ConstructSignature {
440
- message: Uint8Array;
441
- private_key: Uint8Array;
442
- }
443
-
444
- export interface EcdsaSecp256k1ConstructSignatureResponse {
445
- r: Uint8Array;
446
- s: Uint8Array;
447
- v: number;
448
- }
449
-
450
- interface MsgpackEcdsaSecp256k1ConstructSignatureResponse {
451
- r: Uint8Array;
452
- s: Uint8Array;
453
- v: number;
454
- }
455
-
456
- export interface EcdsaSecp256k1RecoverPublicKey {
457
- message: Uint8Array;
458
- r: Uint8Array;
459
- s: Uint8Array;
460
- v: number;
461
- }
462
-
463
- interface MsgpackEcdsaSecp256k1RecoverPublicKey {
464
- message: Uint8Array;
465
- r: Uint8Array;
466
- s: Uint8Array;
467
- v: number;
468
- }
469
-
470
- export interface EcdsaSecp256k1RecoverPublicKeyResponse {
471
- publicKey: AffineElement;
472
- }
473
-
474
- interface MsgpackEcdsaSecp256k1RecoverPublicKeyResponse {
475
- public_key: MsgpackAffineElement;
476
- }
477
-
478
- export interface EcdsaSecp256k1VerifySignature {
479
- message: Uint8Array;
480
- publicKey: AffineElement;
481
- r: Uint8Array;
482
- s: Uint8Array;
483
- v: number;
484
- }
485
-
486
- interface MsgpackEcdsaSecp256k1VerifySignature {
487
- message: Uint8Array;
488
- public_key: MsgpackAffineElement;
489
- r: Uint8Array;
490
- s: Uint8Array;
491
- v: number;
492
- }
493
-
494
- export interface EcdsaSecp256k1VerifySignatureResponse {
495
- verified: boolean;
496
- }
497
-
498
- interface MsgpackEcdsaSecp256k1VerifySignatureResponse {
499
- verified: boolean;
500
- }
501
-
502
- export interface EcdsaSecp256r1ComputePublicKey {
503
- privateKey: Secp256r1Fr;
504
- }
505
-
506
- interface MsgpackEcdsaSecp256r1ComputePublicKey {
507
- private_key: Uint8Array;
508
- }
509
-
510
- export interface EcdsaSecp256r1ComputePublicKeyResponse {
511
- publicKey: AffineElement;
512
- }
513
-
514
- interface MsgpackEcdsaSecp256r1ComputePublicKeyResponse {
515
- public_key: MsgpackAffineElement;
516
- }
517
-
518
- export interface EcdsaSecp256r1ConstructSignature {
519
- message: Uint8Array;
520
- privateKey: Secp256r1Fr;
521
- }
522
-
523
- interface MsgpackEcdsaSecp256r1ConstructSignature {
524
- message: Uint8Array;
525
- private_key: Uint8Array;
526
- }
527
-
528
- export interface EcdsaSecp256r1ConstructSignatureResponse {
529
- r: Uint8Array;
530
- s: Uint8Array;
531
- v: number;
532
- }
533
-
534
- interface MsgpackEcdsaSecp256r1ConstructSignatureResponse {
535
- r: Uint8Array;
536
- s: Uint8Array;
537
- v: number;
538
- }
539
-
540
- export interface EcdsaSecp256r1RecoverPublicKey {
541
- message: Uint8Array;
542
- r: Uint8Array;
543
- s: Uint8Array;
544
- v: number;
545
- }
546
-
547
- interface MsgpackEcdsaSecp256r1RecoverPublicKey {
548
- message: Uint8Array;
549
- r: Uint8Array;
550
- s: Uint8Array;
551
- v: number;
552
- }
553
-
554
- export interface EcdsaSecp256r1RecoverPublicKeyResponse {
555
- publicKey: AffineElement;
556
- }
557
-
558
- interface MsgpackEcdsaSecp256r1RecoverPublicKeyResponse {
559
- public_key: MsgpackAffineElement;
560
- }
561
-
562
- export interface EcdsaSecp256r1VerifySignature {
563
- message: Uint8Array;
564
- publicKey: AffineElement;
565
- r: Uint8Array;
566
- s: Uint8Array;
567
- v: number;
568
- }
569
-
570
- interface MsgpackEcdsaSecp256r1VerifySignature {
571
- message: Uint8Array;
572
- public_key: MsgpackAffineElement;
573
- r: Uint8Array;
574
- s: Uint8Array;
575
- v: number;
576
- }
577
-
578
- export interface EcdsaSecp256r1VerifySignatureResponse {
579
- verified: boolean;
580
- }
581
-
582
- interface MsgpackEcdsaSecp256r1VerifySignatureResponse {
583
- verified: boolean;
584
- }
585
-
586
- export interface GoblinProof {
587
- mergeProof: Fr[];
588
- eccvmProof: ECCVMProof;
589
- translatorProof: Fr[];
590
- }
591
-
592
- interface MsgpackGoblinProof {
593
- merge_proof: Uint8Array[];
594
- eccvm_proof: MsgpackECCVMProof;
595
- translator_proof: Uint8Array[];
596
- }
597
-
598
- export interface GrumpkinAdd {
599
- pointA: AffineElement;
600
- pointB: AffineElement;
601
- }
602
-
603
- interface MsgpackGrumpkinAdd {
604
- point_a: MsgpackAffineElement;
605
- point_b: MsgpackAffineElement;
606
- }
607
-
608
- export interface GrumpkinAddResponse {
609
- point: AffineElement;
610
- }
611
-
612
- interface MsgpackGrumpkinAddResponse {
613
- point: MsgpackAffineElement;
614
- }
615
-
616
- export interface GrumpkinBatchMul {
617
- points: AffineElement[];
618
- scalar: Fq;
619
- }
620
-
621
- interface MsgpackGrumpkinBatchMul {
622
- points: MsgpackAffineElement[];
623
- scalar: Uint8Array;
624
- }
625
-
626
- export interface GrumpkinBatchMulResponse {
627
- points: AffineElement[];
628
- }
629
-
630
- interface MsgpackGrumpkinBatchMulResponse {
631
- points: MsgpackAffineElement[];
632
- }
633
-
634
- export interface GrumpkinGetRandomFr {
635
- dummy: number;
636
- }
637
-
638
- interface MsgpackGrumpkinGetRandomFr {
639
- dummy: number;
640
- }
641
-
642
- export interface GrumpkinGetRandomFrResponse {
643
- value: Fr;
644
- }
645
-
646
- interface MsgpackGrumpkinGetRandomFrResponse {
647
- value: Uint8Array;
648
- }
649
-
650
- export interface GrumpkinMul {
651
- point: AffineElement;
652
- scalar: Fq;
653
- }
654
-
655
- interface MsgpackGrumpkinMul {
656
- point: MsgpackAffineElement;
657
- scalar: Uint8Array;
658
- }
659
-
660
- export interface GrumpkinMulResponse {
661
- point: AffineElement;
662
- }
663
-
664
- interface MsgpackGrumpkinMulResponse {
665
- point: MsgpackAffineElement;
666
- }
667
-
668
- export interface GrumpkinReduce512 {
669
- input: Uint8Array;
670
- }
671
-
672
- interface MsgpackGrumpkinReduce512 {
673
- input: Uint8Array;
674
- }
675
-
676
- export interface GrumpkinReduce512Response {
677
- value: Fr;
678
- }
679
-
680
- interface MsgpackGrumpkinReduce512Response {
681
- value: Uint8Array;
682
- }
683
-
684
- export interface MegaVkAsFields {
685
- verificationKey: Uint8Array;
686
- }
687
-
688
- interface MsgpackMegaVkAsFields {
689
- verification_key: Uint8Array;
690
- }
691
-
692
- export interface MegaVkAsFieldsResponse {
693
- fields: Fr[];
694
- }
695
-
696
- interface MsgpackMegaVkAsFieldsResponse {
697
- fields: Uint8Array[];
698
- }
699
-
700
- export interface PedersenCommit {
701
- inputs: Fr[];
702
- hashIndex: number;
703
- }
704
-
705
- interface MsgpackPedersenCommit {
706
- inputs: Uint8Array[];
707
- hash_index: number;
708
- }
709
-
710
- export interface PedersenCommitResponse {
711
- point: AffineElement;
712
- }
713
-
714
- interface MsgpackPedersenCommitResponse {
715
- point: MsgpackAffineElement;
716
- }
717
-
718
- export interface PedersenHash {
719
- inputs: Fr[];
720
- hashIndex: number;
721
- }
722
-
723
- interface MsgpackPedersenHash {
724
- inputs: Uint8Array[];
725
- hash_index: number;
726
- }
727
-
728
- export interface PedersenHashBuffer {
729
- input: Uint8Array;
730
- hashIndex: number;
731
- }
732
-
733
- interface MsgpackPedersenHashBuffer {
734
- input: Uint8Array;
735
- hash_index: number;
736
- }
737
-
738
- export interface PedersenHashBufferResponse {
739
- hash: Fr;
740
- }
741
-
742
- interface MsgpackPedersenHashBufferResponse {
743
- hash: Uint8Array;
744
- }
745
-
746
- export interface PedersenHashResponse {
747
- hash: Fr;
748
- }
749
-
750
- interface MsgpackPedersenHashResponse {
751
- hash: Uint8Array;
752
- }
753
-
754
- export interface Poseidon2Hash {
755
- inputs: Fr[];
756
- }
757
-
758
- interface MsgpackPoseidon2Hash {
759
- inputs: Uint8Array[];
760
- }
761
-
762
- export interface Poseidon2HashAccumulate {
763
- inputs: Fr[];
764
- }
765
-
766
- interface MsgpackPoseidon2HashAccumulate {
767
- inputs: Uint8Array[];
768
- }
769
-
770
- export interface Poseidon2HashAccumulateResponse {
771
- hash: Fr;
772
- }
773
-
774
- interface MsgpackPoseidon2HashAccumulateResponse {
775
- hash: Uint8Array;
776
- }
777
-
778
- export interface Poseidon2HashResponse {
779
- hash: Fr;
780
- }
781
-
782
- interface MsgpackPoseidon2HashResponse {
783
- hash: Uint8Array;
784
- }
785
-
786
- export interface Poseidon2Permutation {
787
- inputs: Fr[];
788
- }
789
-
790
- interface MsgpackPoseidon2Permutation {
791
- inputs: Uint8Array[];
792
- }
793
-
794
- export interface Poseidon2PermutationResponse {
795
- outputs: Fr[];
796
- }
797
-
798
- interface MsgpackPoseidon2PermutationResponse {
799
- outputs: Uint8Array[];
800
- }
801
-
802
- export interface ProofSystemSettings {
803
- ipaAccumulation: boolean;
804
- oracleHashType: string;
805
- disableZk: boolean;
806
- optimizedSolidityVerifier: boolean;
807
- }
808
-
809
- interface MsgpackProofSystemSettings {
810
- ipa_accumulation: boolean;
811
- oracle_hash_type: string;
812
- disable_zk: boolean;
813
- optimized_solidity_verifier: boolean;
814
- }
815
-
816
- export interface SchnorrComputePublicKey {
817
- privateKey: Fq;
818
- }
819
-
820
- interface MsgpackSchnorrComputePublicKey {
821
- private_key: Uint8Array;
822
- }
823
-
824
- export interface SchnorrComputePublicKeyResponse {
825
- publicKey: AffineElement;
826
- }
827
-
828
- interface MsgpackSchnorrComputePublicKeyResponse {
829
- public_key: MsgpackAffineElement;
830
- }
831
-
832
- export interface SchnorrConstructSignature {
833
- message: Uint8Array;
834
- privateKey: Fq;
835
- }
836
-
837
- interface MsgpackSchnorrConstructSignature {
838
- message: Uint8Array;
839
- private_key: Uint8Array;
840
- }
841
-
842
- export interface SchnorrConstructSignatureResponse {
843
- s: Uint8Array;
844
- e: Uint8Array;
845
- }
846
-
847
- interface MsgpackSchnorrConstructSignatureResponse {
848
- s: Uint8Array;
849
- e: Uint8Array;
850
- }
851
-
852
- export interface SchnorrVerifySignature {
853
- message: Uint8Array;
854
- publicKey: AffineElement;
855
- s: Uint8Array;
856
- e: Uint8Array;
857
- }
858
-
859
- interface MsgpackSchnorrVerifySignature {
860
- message: Uint8Array;
861
- public_key: MsgpackAffineElement;
862
- s: Uint8Array;
863
- e: Uint8Array;
864
- }
865
-
866
- export interface SchnorrVerifySignatureResponse {
867
- verified: boolean;
868
- }
869
-
870
- interface MsgpackSchnorrVerifySignatureResponse {
871
- verified: boolean;
872
- }
873
-
874
- export interface Secp256k1GetRandomFr {
875
- dummy: number;
876
- }
877
-
878
- interface MsgpackSecp256k1GetRandomFr {
879
- dummy: number;
880
- }
881
-
882
- export interface Secp256k1GetRandomFrResponse {
883
- value: Secp256k1Fr;
884
- }
885
-
886
- interface MsgpackSecp256k1GetRandomFrResponse {
887
- value: Uint8Array;
888
- }
889
-
890
- export interface Secp256k1Mul {
891
- point: AffineElement;
892
- scalar: Secp256k1Fr;
893
- }
894
-
895
- interface MsgpackSecp256k1Mul {
896
- point: MsgpackAffineElement;
897
- scalar: Uint8Array;
898
- }
899
-
900
- export interface Secp256k1MulResponse {
901
- point: AffineElement;
902
- }
903
-
904
- interface MsgpackSecp256k1MulResponse {
905
- point: MsgpackAffineElement;
906
- }
907
-
908
- export interface Secp256k1Reduce512 {
909
- input: Uint8Array;
910
- }
911
-
912
- interface MsgpackSecp256k1Reduce512 {
913
- input: Uint8Array;
914
- }
915
-
916
- export interface Secp256k1Reduce512Response {
917
- value: Secp256k1Fr;
918
- }
919
-
920
- interface MsgpackSecp256k1Reduce512Response {
921
- value: Uint8Array;
922
- }
923
-
924
- export interface Shutdown {
925
- }
926
-
927
- interface MsgpackShutdown {
928
- }
929
-
930
- export interface ShutdownResponse {
931
- }
932
-
933
- interface MsgpackShutdownResponse {
934
- }
935
-
936
- export interface SrsInitGrumpkinSrs {
937
- pointsBuf: Uint8Array;
938
- numPoints: number;
939
- }
940
-
941
- interface MsgpackSrsInitGrumpkinSrs {
942
- points_buf: Uint8Array;
943
- num_points: number;
944
- }
945
-
946
- export interface SrsInitGrumpkinSrsResponse {
947
- dummy: number;
948
- }
949
-
950
- interface MsgpackSrsInitGrumpkinSrsResponse {
951
- dummy: number;
952
- }
953
-
954
- export interface SrsInitSrs {
955
- pointsBuf: Uint8Array;
956
- numPoints: number;
957
- g2Point: Uint8Array;
958
- }
959
-
960
- interface MsgpackSrsInitSrs {
961
- points_buf: Uint8Array;
962
- num_points: number;
963
- g2_point: Uint8Array;
964
- }
965
-
966
- export interface SrsInitSrsResponse {
967
- dummy: number;
968
- }
969
-
970
- interface MsgpackSrsInitSrsResponse {
971
- dummy: number;
972
- }
973
-
974
- export interface VkAsFields {
975
- verificationKey: Uint8Array;
976
- }
977
-
978
- interface MsgpackVkAsFields {
979
- verification_key: Uint8Array;
980
- }
981
-
982
- export interface VkAsFieldsResponse {
983
- fields: Fr[];
984
- }
985
-
986
- interface MsgpackVkAsFieldsResponse {
987
- fields: Uint8Array[];
988
- }
989
-
990
- // Private Msgpack interfaces (not exported)
991
- export interface AesDecrypt {
992
- ciphertext: Uint8Array;
993
- iv: Uint8Array;
994
- key: Uint8Array;
995
- length: number;
996
- }
997
-
998
- interface MsgpackAesDecrypt {
999
- ciphertext: Uint8Array;
1000
- iv: Uint8Array;
1001
- key: Uint8Array;
1002
- length: number;
1003
- }
1004
-
1005
- export interface AesDecryptResponse {
1006
- plaintext: Uint8Array;
1007
- }
1008
-
1009
- interface MsgpackAesDecryptResponse {
1010
- plaintext: Uint8Array;
1011
- }
1012
-
1013
- export interface AesEncrypt {
1014
- plaintext: Uint8Array;
1015
- iv: Uint8Array;
1016
- key: Uint8Array;
1017
- length: number;
1018
- }
1019
-
1020
- interface MsgpackAesEncrypt {
1021
- plaintext: Uint8Array;
1022
- iv: Uint8Array;
1023
- key: Uint8Array;
1024
- length: number;
1025
- }
1026
-
1027
- export interface AesEncryptResponse {
1028
- ciphertext: Uint8Array;
1029
- }
1030
-
1031
- interface MsgpackAesEncryptResponse {
1032
- ciphertext: Uint8Array;
1033
- }
1034
-
1035
- export interface AffineElement {
1036
- x: Fr;
1037
- y: Fr;
1038
- }
1039
-
1040
- interface MsgpackAffineElement {
1041
- x: Uint8Array;
1042
- y: Uint8Array;
1043
- }
1044
-
1045
- export interface Blake2s {
1046
- data: Uint8Array;
1047
- }
1048
-
1049
- interface MsgpackBlake2s {
1050
- data: Uint8Array;
1051
- }
1052
-
1053
- export interface Blake2sResponse {
1054
- hash: Uint8Array;
1055
- }
1056
-
1057
- interface MsgpackBlake2sResponse {
1058
- hash: Uint8Array;
1059
- }
1060
-
1061
- export interface Blake2sToField {
1062
- data: Uint8Array;
1063
- }
1064
-
1065
- interface MsgpackBlake2sToField {
1066
- data: Uint8Array;
1067
- }
1068
-
1069
- export interface Blake2sToFieldResponse {
1070
- field: Fr;
1071
- }
1072
-
1073
- interface MsgpackBlake2sToFieldResponse {
1074
- field: Uint8Array;
1075
- }
1076
-
1077
- export interface Bn254FrSqrt {
1078
- input: Fr;
1079
- }
1080
-
1081
- interface MsgpackBn254FrSqrt {
1082
- input: Uint8Array;
1083
- }
1084
-
1085
- export interface Bn254FrSqrtResponse {
1086
- isSquareRoot: boolean;
1087
- value: Fr;
1088
- }
1089
-
1090
- interface MsgpackBn254FrSqrtResponse {
1091
- is_square_root: boolean;
1092
- value: Uint8Array;
1093
- }
1094
-
1095
- export interface CircuitComputeVk {
1096
- circuit: CircuitInputNoVK;
1097
- settings: ProofSystemSettings;
1098
- }
1099
-
1100
- interface MsgpackCircuitComputeVk {
1101
- circuit: MsgpackCircuitInputNoVK;
1102
- settings: MsgpackProofSystemSettings;
1103
- }
1104
-
1105
- export interface CircuitComputeVkResponse {
1106
- bytes: Uint8Array;
1107
- fields: Uint256T[];
1108
- hash: Uint8Array;
1109
- }
1110
-
1111
- interface MsgpackCircuitComputeVkResponse {
1112
- bytes: Uint8Array;
1113
- fields: Uint8Array[];
1114
- hash: Uint8Array;
1115
- }
1116
-
1117
- export interface CircuitInfoResponse {
1118
- numGates: number;
1119
- numGatesDyadic: number;
1120
- numAcirOpcodes: number;
1121
- gatesPerOpcode: number[];
1122
- }
1123
-
1124
- interface MsgpackCircuitInfoResponse {
1125
- num_gates: number;
1126
- num_gates_dyadic: number;
1127
- num_acir_opcodes: number;
1128
- gates_per_opcode: number[];
1129
- }
1130
-
1131
- export interface CircuitInput {
1132
- name: string;
1133
- bytecode: Uint8Array;
1134
- verificationKey: Uint8Array;
1135
- }
1136
-
1137
- interface MsgpackCircuitInput {
1138
- name: string;
1139
- bytecode: Uint8Array;
1140
- verification_key: Uint8Array;
1141
- }
1142
-
1143
- export interface CircuitInputNoVK {
1144
- name: string;
1145
- bytecode: Uint8Array;
1146
- }
1147
-
1148
- interface MsgpackCircuitInputNoVK {
1149
- name: string;
1150
- bytecode: Uint8Array;
1151
- }
1152
-
1153
- export interface CircuitProve {
1154
- circuit: CircuitInput;
1155
- witness: Uint8Array;
1156
- settings: ProofSystemSettings;
1157
- }
1158
-
1159
- interface MsgpackCircuitProve {
1160
- circuit: MsgpackCircuitInput;
1161
- witness: Uint8Array;
1162
- settings: MsgpackProofSystemSettings;
1163
- }
1164
-
1165
- export interface CircuitProveResponse {
1166
- publicInputs: Uint256T[];
1167
- proof: Uint256T[];
1168
- vk: CircuitComputeVkResponse;
1169
- }
1170
-
1171
- interface MsgpackCircuitProveResponse {
1172
- public_inputs: Uint8Array[];
1173
- proof: Uint8Array[];
1174
- vk: MsgpackCircuitComputeVkResponse;
1175
- }
1176
-
1177
- export interface CircuitStats {
1178
- circuit: CircuitInput;
1179
- includeGatesPerOpcode: boolean;
1180
- settings: ProofSystemSettings;
1181
- }
1182
-
1183
- interface MsgpackCircuitStats {
1184
- circuit: MsgpackCircuitInput;
1185
- include_gates_per_opcode: boolean;
1186
- settings: MsgpackProofSystemSettings;
1187
- }
1188
-
1189
- export interface CircuitVerify {
1190
- verificationKey: Uint8Array;
1191
- publicInputs: Uint256T[];
1192
- proof: Uint256T[];
1193
- settings: ProofSystemSettings;
1194
- }
1195
-
1196
- interface MsgpackCircuitVerify {
1197
- verification_key: Uint8Array;
1198
- public_inputs: Uint8Array[];
1199
- proof: Uint8Array[];
1200
- settings: MsgpackProofSystemSettings;
1201
- }
1202
-
1203
- export interface CircuitVerifyResponse {
1204
- verified: boolean;
1205
- }
1206
-
1207
- interface MsgpackCircuitVerifyResponse {
1208
- verified: boolean;
1209
- }
1210
-
1211
- export interface CircuitWriteSolidityVerifier {
1212
- verificationKey: Uint8Array;
1213
- settings: ProofSystemSettings;
1214
- }
1215
-
1216
- interface MsgpackCircuitWriteSolidityVerifier {
1217
- verification_key: Uint8Array;
1218
- settings: MsgpackProofSystemSettings;
1219
- }
1220
-
1221
- export interface CircuitWriteSolidityVerifierResponse {
1222
- solidityCode: string;
1223
- }
1224
-
1225
- interface MsgpackCircuitWriteSolidityVerifierResponse {
1226
- solidity_code: string;
1227
- }
1228
-
1229
- export interface ClientIvcAccumulate {
1230
- witness: Uint8Array;
1231
- }
1232
-
1233
- interface MsgpackClientIvcAccumulate {
1234
- witness: Uint8Array;
1235
- }
1236
-
1237
- export interface ClientIvcAccumulateResponse {
1238
- }
1239
-
1240
- interface MsgpackClientIvcAccumulateResponse {
1241
- }
1242
-
1243
- export interface ClientIvcCheckPrecomputedVk {
1244
- circuit: CircuitInput;
1245
- }
1246
-
1247
- interface MsgpackClientIvcCheckPrecomputedVk {
1248
- circuit: MsgpackCircuitInput;
1249
- }
1250
-
1251
- export interface ClientIvcCheckPrecomputedVkResponse {
1252
- valid: boolean;
1253
- actualVk: Uint8Array;
1254
- }
1255
-
1256
- interface MsgpackClientIvcCheckPrecomputedVkResponse {
1257
- valid: boolean;
1258
- actual_vk: Uint8Array;
1259
- }
1260
-
1261
- export interface ClientIvcComputeIvcVk {
1262
- circuit: CircuitInputNoVK;
1263
- }
1264
-
1265
- interface MsgpackClientIvcComputeIvcVk {
1266
- circuit: MsgpackCircuitInputNoVK;
1267
- }
1268
-
1269
- export interface ClientIvcComputeIvcVkResponse {
1270
- bytes: Uint8Array;
1271
- }
1272
-
1273
- interface MsgpackClientIvcComputeIvcVkResponse {
1274
- bytes: Uint8Array;
1275
- }
1276
-
1277
- export interface ClientIvcComputeStandaloneVk {
1278
- circuit: CircuitInputNoVK;
1279
- }
1280
-
1281
- interface MsgpackClientIvcComputeStandaloneVk {
1282
- circuit: MsgpackCircuitInputNoVK;
1283
- }
1284
-
1285
- export interface ClientIvcComputeStandaloneVkResponse {
1286
- bytes: Uint8Array;
1287
- fields: Fr[];
1288
- }
1289
-
1290
- interface MsgpackClientIvcComputeStandaloneVkResponse {
1291
- bytes: Uint8Array;
1292
- fields: Uint8Array[];
1293
- }
1294
-
1295
- export interface ClientIvcLoad {
1296
- circuit: CircuitInput;
1297
- }
1298
-
1299
- interface MsgpackClientIvcLoad {
1300
- circuit: MsgpackCircuitInput;
1301
- }
1302
-
1303
- export interface ClientIvcLoadResponse {
1304
- }
1305
-
1306
- interface MsgpackClientIvcLoadResponse {
1307
- }
1308
-
1309
- export interface ClientIVCProof {
1310
- megaProof: Fr[];
1311
- goblinProof: GoblinProof;
1312
- }
1313
-
1314
- interface MsgpackClientIVCProof {
1315
- mega_proof: Uint8Array[];
1316
- goblin_proof: MsgpackGoblinProof;
1317
- }
1318
-
1319
- export interface ClientIvcProve {
1320
- }
1321
-
1322
- interface MsgpackClientIvcProve {
1323
- }
1324
-
1325
- export interface ClientIvcProveResponse {
1326
- proof: ClientIVCProof;
1327
- }
1328
-
1329
- interface MsgpackClientIvcProveResponse {
1330
- proof: MsgpackClientIVCProof;
1331
- }
1332
-
1333
- export interface ClientIvcStart {
1334
- numCircuits: number;
1335
- }
1336
-
1337
- interface MsgpackClientIvcStart {
1338
- num_circuits: number;
1339
- }
1340
-
1341
- export interface ClientIvcStartResponse {
1342
- }
1343
-
1344
- interface MsgpackClientIvcStartResponse {
1345
- }
1346
-
1347
- export interface ClientIvcStats {
1348
- circuit: CircuitInputNoVK;
1349
- includeGatesPerOpcode: boolean;
1350
- }
1351
-
1352
- interface MsgpackClientIvcStats {
1353
- circuit: MsgpackCircuitInputNoVK;
1354
- include_gates_per_opcode: boolean;
1355
- }
1356
-
1357
- export interface ClientIvcStatsResponse {
1358
- acirOpcodes: number;
1359
- circuitSize: number;
1360
- gatesPerOpcode: number[];
1361
- }
1362
-
1363
- interface MsgpackClientIvcStatsResponse {
1364
- acir_opcodes: number;
1365
- circuit_size: number;
1366
- gates_per_opcode: number[];
1367
- }
1368
-
1369
- export interface ClientIvcVerify {
1370
- proof: ClientIVCProof;
1371
- vk: Uint8Array;
1372
- }
1373
-
1374
- interface MsgpackClientIvcVerify {
1375
- proof: MsgpackClientIVCProof;
1376
- vk: Uint8Array;
1377
- }
1378
-
1379
- export interface ClientIvcVerifyResponse {
1380
- valid: boolean;
1381
- }
1382
-
1383
- interface MsgpackClientIvcVerifyResponse {
1384
- valid: boolean;
1385
- }
1386
-
1387
- export interface ECCVMProof {
1388
- preIpaProof: Fr[];
1389
- ipaProof: Fr[];
1390
- }
1391
-
1392
- interface MsgpackECCVMProof {
1393
- pre_ipa_proof: Uint8Array[];
1394
- ipa_proof: Uint8Array[];
1395
- }
1396
-
1397
- export interface EcdsaSecp256k1ComputePublicKey {
1398
- privateKey: Secp256k1Fr;
1399
- }
1400
-
1401
- interface MsgpackEcdsaSecp256k1ComputePublicKey {
1402
- private_key: Uint8Array;
1403
- }
1404
-
1405
- export interface EcdsaSecp256k1ComputePublicKeyResponse {
1406
- publicKey: AffineElement;
1407
- }
1408
-
1409
- interface MsgpackEcdsaSecp256k1ComputePublicKeyResponse {
1410
- public_key: MsgpackAffineElement;
1411
- }
1412
-
1413
- export interface EcdsaSecp256k1ConstructSignature {
1414
- message: Uint8Array;
1415
- privateKey: Secp256k1Fr;
1416
- }
1417
-
1418
- interface MsgpackEcdsaSecp256k1ConstructSignature {
1419
- message: Uint8Array;
1420
- private_key: Uint8Array;
1421
- }
1422
-
1423
- export interface EcdsaSecp256k1ConstructSignatureResponse {
1424
- r: Uint8Array;
1425
- s: Uint8Array;
1426
- v: number;
1427
- }
1428
-
1429
- interface MsgpackEcdsaSecp256k1ConstructSignatureResponse {
1430
- r: Uint8Array;
1431
- s: Uint8Array;
1432
- v: number;
1433
- }
1434
-
1435
- export interface EcdsaSecp256k1RecoverPublicKey {
1436
- message: Uint8Array;
1437
- r: Uint8Array;
1438
- s: Uint8Array;
1439
- v: number;
1440
- }
1441
-
1442
- interface MsgpackEcdsaSecp256k1RecoverPublicKey {
1443
- message: Uint8Array;
1444
- r: Uint8Array;
1445
- s: Uint8Array;
1446
- v: number;
1447
- }
1448
-
1449
- export interface EcdsaSecp256k1RecoverPublicKeyResponse {
1450
- publicKey: AffineElement;
1451
- }
1452
-
1453
- interface MsgpackEcdsaSecp256k1RecoverPublicKeyResponse {
1454
- public_key: MsgpackAffineElement;
1455
- }
1456
-
1457
- export interface EcdsaSecp256k1VerifySignature {
1458
- message: Uint8Array;
1459
- publicKey: AffineElement;
1460
- r: Uint8Array;
1461
- s: Uint8Array;
1462
- v: number;
1463
- }
1464
-
1465
- interface MsgpackEcdsaSecp256k1VerifySignature {
1466
- message: Uint8Array;
1467
- public_key: MsgpackAffineElement;
1468
- r: Uint8Array;
1469
- s: Uint8Array;
1470
- v: number;
1471
- }
1472
-
1473
- export interface EcdsaSecp256k1VerifySignatureResponse {
1474
- verified: boolean;
1475
- }
1476
-
1477
- interface MsgpackEcdsaSecp256k1VerifySignatureResponse {
1478
- verified: boolean;
1479
- }
1480
-
1481
- export interface EcdsaSecp256r1ComputePublicKey {
1482
- privateKey: Secp256r1Fr;
1483
- }
1484
-
1485
- interface MsgpackEcdsaSecp256r1ComputePublicKey {
1486
- private_key: Uint8Array;
1487
- }
1488
-
1489
- export interface EcdsaSecp256r1ComputePublicKeyResponse {
1490
- publicKey: AffineElement;
1491
- }
1492
-
1493
- interface MsgpackEcdsaSecp256r1ComputePublicKeyResponse {
1494
- public_key: MsgpackAffineElement;
1495
- }
1496
-
1497
- export interface EcdsaSecp256r1ConstructSignature {
1498
- message: Uint8Array;
1499
- privateKey: Secp256r1Fr;
1500
- }
1501
-
1502
- interface MsgpackEcdsaSecp256r1ConstructSignature {
1503
- message: Uint8Array;
1504
- private_key: Uint8Array;
1505
- }
1506
-
1507
- export interface EcdsaSecp256r1ConstructSignatureResponse {
1508
- r: Uint8Array;
1509
- s: Uint8Array;
1510
- v: number;
1511
- }
1512
-
1513
- interface MsgpackEcdsaSecp256r1ConstructSignatureResponse {
1514
- r: Uint8Array;
1515
- s: Uint8Array;
1516
- v: number;
1517
- }
1518
-
1519
- export interface EcdsaSecp256r1RecoverPublicKey {
1520
- message: Uint8Array;
1521
- r: Uint8Array;
1522
- s: Uint8Array;
1523
- v: number;
1524
- }
1525
-
1526
- interface MsgpackEcdsaSecp256r1RecoverPublicKey {
1527
- message: Uint8Array;
1528
- r: Uint8Array;
1529
- s: Uint8Array;
1530
- v: number;
1531
- }
1532
-
1533
- export interface EcdsaSecp256r1RecoverPublicKeyResponse {
1534
- publicKey: AffineElement;
1535
- }
1536
-
1537
- interface MsgpackEcdsaSecp256r1RecoverPublicKeyResponse {
1538
- public_key: MsgpackAffineElement;
1539
- }
1540
-
1541
- export interface EcdsaSecp256r1VerifySignature {
1542
- message: Uint8Array;
1543
- publicKey: AffineElement;
1544
- r: Uint8Array;
1545
- s: Uint8Array;
1546
- v: number;
1547
- }
1548
-
1549
- interface MsgpackEcdsaSecp256r1VerifySignature {
1550
- message: Uint8Array;
1551
- public_key: MsgpackAffineElement;
1552
- r: Uint8Array;
1553
- s: Uint8Array;
1554
- v: number;
1555
- }
1556
-
1557
- export interface EcdsaSecp256r1VerifySignatureResponse {
1558
- verified: boolean;
1559
- }
1560
-
1561
- interface MsgpackEcdsaSecp256r1VerifySignatureResponse {
1562
- verified: boolean;
1563
- }
1564
-
1565
- export interface GoblinProof {
1566
- mergeProof: Fr[];
1567
- eccvmProof: ECCVMProof;
1568
- translatorProof: Fr[];
1569
- }
1570
-
1571
- interface MsgpackGoblinProof {
1572
- merge_proof: Uint8Array[];
1573
- eccvm_proof: MsgpackECCVMProof;
1574
- translator_proof: Uint8Array[];
1575
- }
1576
-
1577
- export interface GrumpkinAdd {
1578
- pointA: AffineElement;
1579
- pointB: AffineElement;
1580
- }
1581
-
1582
- interface MsgpackGrumpkinAdd {
1583
- point_a: MsgpackAffineElement;
1584
- point_b: MsgpackAffineElement;
1585
- }
1586
-
1587
- export interface GrumpkinAddResponse {
1588
- point: AffineElement;
1589
- }
1590
-
1591
- interface MsgpackGrumpkinAddResponse {
1592
- point: MsgpackAffineElement;
1593
- }
1594
-
1595
- export interface GrumpkinBatchMul {
1596
- points: AffineElement[];
1597
- scalar: Fq;
1598
- }
1599
-
1600
- interface MsgpackGrumpkinBatchMul {
1601
- points: MsgpackAffineElement[];
1602
- scalar: Uint8Array;
1603
- }
1604
-
1605
- export interface GrumpkinBatchMulResponse {
1606
- points: AffineElement[];
1607
- }
1608
-
1609
- interface MsgpackGrumpkinBatchMulResponse {
1610
- points: MsgpackAffineElement[];
1611
- }
1612
-
1613
- export interface GrumpkinGetRandomFr {
1614
- dummy: number;
1615
- }
1616
-
1617
- interface MsgpackGrumpkinGetRandomFr {
1618
- dummy: number;
1619
- }
1620
-
1621
- export interface GrumpkinGetRandomFrResponse {
1622
- value: Fr;
1623
- }
1624
-
1625
- interface MsgpackGrumpkinGetRandomFrResponse {
1626
- value: Uint8Array;
1627
- }
1628
-
1629
- export interface GrumpkinMul {
1630
- point: AffineElement;
1631
- scalar: Fq;
1632
- }
1633
-
1634
- interface MsgpackGrumpkinMul {
1635
- point: MsgpackAffineElement;
1636
- scalar: Uint8Array;
1637
- }
1638
-
1639
- export interface GrumpkinMulResponse {
1640
- point: AffineElement;
1641
- }
1642
-
1643
- interface MsgpackGrumpkinMulResponse {
1644
- point: MsgpackAffineElement;
1645
- }
1646
-
1647
- export interface GrumpkinReduce512 {
1648
- input: Uint8Array;
1649
- }
1650
-
1651
- interface MsgpackGrumpkinReduce512 {
1652
- input: Uint8Array;
1653
- }
1654
-
1655
- export interface GrumpkinReduce512Response {
1656
- value: Fr;
1657
- }
1658
-
1659
- interface MsgpackGrumpkinReduce512Response {
1660
- value: Uint8Array;
1661
- }
1662
-
1663
- export interface MegaVkAsFields {
1664
- verificationKey: Uint8Array;
1665
- }
1666
-
1667
- interface MsgpackMegaVkAsFields {
1668
- verification_key: Uint8Array;
1669
- }
1670
-
1671
- export interface MegaVkAsFieldsResponse {
1672
- fields: Fr[];
1673
- }
1674
-
1675
- interface MsgpackMegaVkAsFieldsResponse {
1676
- fields: Uint8Array[];
1677
- }
1678
-
1679
- export interface PedersenCommit {
1680
- inputs: Fr[];
1681
- hashIndex: number;
1682
- }
1683
-
1684
- interface MsgpackPedersenCommit {
1685
- inputs: Uint8Array[];
1686
- hash_index: number;
1687
- }
1688
-
1689
- export interface PedersenCommitResponse {
1690
- point: AffineElement;
1691
- }
1692
-
1693
- interface MsgpackPedersenCommitResponse {
1694
- point: MsgpackAffineElement;
1695
- }
1696
-
1697
- export interface PedersenHash {
1698
- inputs: Fr[];
1699
- hashIndex: number;
1700
- }
1701
-
1702
- interface MsgpackPedersenHash {
1703
- inputs: Uint8Array[];
1704
- hash_index: number;
1705
- }
1706
-
1707
- export interface PedersenHashBuffer {
1708
- input: Uint8Array;
1709
- hashIndex: number;
1710
- }
1711
-
1712
- interface MsgpackPedersenHashBuffer {
1713
- input: Uint8Array;
1714
- hash_index: number;
1715
- }
1716
-
1717
- export interface PedersenHashBufferResponse {
1718
- hash: Fr;
1719
- }
1720
-
1721
- interface MsgpackPedersenHashBufferResponse {
1722
- hash: Uint8Array;
1723
- }
1724
-
1725
- export interface PedersenHashResponse {
1726
- hash: Fr;
1727
- }
1728
-
1729
- interface MsgpackPedersenHashResponse {
1730
- hash: Uint8Array;
1731
- }
1732
-
1733
- export interface Poseidon2Hash {
1734
- inputs: Fr[];
1735
- }
1736
-
1737
- interface MsgpackPoseidon2Hash {
1738
- inputs: Uint8Array[];
1739
- }
1740
-
1741
- export interface Poseidon2HashAccumulate {
1742
- inputs: Fr[];
1743
- }
1744
-
1745
- interface MsgpackPoseidon2HashAccumulate {
1746
- inputs: Uint8Array[];
1747
- }
1748
-
1749
- export interface Poseidon2HashAccumulateResponse {
1750
- hash: Fr;
1751
- }
1752
-
1753
- interface MsgpackPoseidon2HashAccumulateResponse {
1754
- hash: Uint8Array;
1755
- }
1756
-
1757
- export interface Poseidon2HashResponse {
1758
- hash: Fr;
1759
- }
1760
-
1761
- interface MsgpackPoseidon2HashResponse {
1762
- hash: Uint8Array;
1763
- }
1764
-
1765
- export interface Poseidon2Permutation {
1766
- inputs: Fr[];
1767
- }
1768
-
1769
- interface MsgpackPoseidon2Permutation {
1770
- inputs: Uint8Array[];
1771
- }
1772
-
1773
- export interface Poseidon2PermutationResponse {
1774
- outputs: Fr[];
1775
- }
1776
-
1777
- interface MsgpackPoseidon2PermutationResponse {
1778
- outputs: Uint8Array[];
1779
- }
1780
-
1781
- export interface ProofSystemSettings {
1782
- ipaAccumulation: boolean;
1783
- oracleHashType: string;
1784
- disableZk: boolean;
1785
- optimizedSolidityVerifier: boolean;
1786
- }
1787
-
1788
- interface MsgpackProofSystemSettings {
1789
- ipa_accumulation: boolean;
1790
- oracle_hash_type: string;
1791
- disable_zk: boolean;
1792
- optimized_solidity_verifier: boolean;
1793
- }
1794
-
1795
- export interface SchnorrComputePublicKey {
1796
- privateKey: Fq;
1797
- }
1798
-
1799
- interface MsgpackSchnorrComputePublicKey {
1800
- private_key: Uint8Array;
1801
- }
1802
-
1803
- export interface SchnorrComputePublicKeyResponse {
1804
- publicKey: AffineElement;
1805
- }
1806
-
1807
- interface MsgpackSchnorrComputePublicKeyResponse {
1808
- public_key: MsgpackAffineElement;
1809
- }
1810
-
1811
- export interface SchnorrConstructSignature {
1812
- message: Uint8Array;
1813
- privateKey: Fq;
1814
- }
1815
-
1816
- interface MsgpackSchnorrConstructSignature {
1817
- message: Uint8Array;
1818
- private_key: Uint8Array;
1819
- }
1820
-
1821
- export interface SchnorrConstructSignatureResponse {
1822
- s: Uint8Array;
1823
- e: Uint8Array;
1824
- }
1825
-
1826
- interface MsgpackSchnorrConstructSignatureResponse {
1827
- s: Uint8Array;
1828
- e: Uint8Array;
1829
- }
1830
-
1831
- export interface SchnorrVerifySignature {
1832
- message: Uint8Array;
1833
- publicKey: AffineElement;
1834
- s: Uint8Array;
1835
- e: Uint8Array;
1836
- }
1837
-
1838
- interface MsgpackSchnorrVerifySignature {
1839
- message: Uint8Array;
1840
- public_key: MsgpackAffineElement;
1841
- s: Uint8Array;
1842
- e: Uint8Array;
1843
- }
1844
-
1845
- export interface SchnorrVerifySignatureResponse {
1846
- verified: boolean;
1847
- }
1848
-
1849
- interface MsgpackSchnorrVerifySignatureResponse {
1850
- verified: boolean;
1851
- }
1852
-
1853
- export interface Secp256k1GetRandomFr {
1854
- dummy: number;
1855
- }
1856
-
1857
- interface MsgpackSecp256k1GetRandomFr {
1858
- dummy: number;
1859
- }
1860
-
1861
- export interface Secp256k1GetRandomFrResponse {
1862
- value: Secp256k1Fr;
1863
- }
1864
-
1865
- interface MsgpackSecp256k1GetRandomFrResponse {
1866
- value: Uint8Array;
1867
- }
1868
-
1869
- export interface Secp256k1Mul {
1870
- point: AffineElement;
1871
- scalar: Secp256k1Fr;
1872
- }
1873
-
1874
- interface MsgpackSecp256k1Mul {
1875
- point: MsgpackAffineElement;
1876
- scalar: Uint8Array;
1877
- }
1878
-
1879
- export interface Secp256k1MulResponse {
1880
- point: AffineElement;
1881
- }
1882
-
1883
- interface MsgpackSecp256k1MulResponse {
1884
- point: MsgpackAffineElement;
1885
- }
1886
-
1887
- export interface Secp256k1Reduce512 {
1888
- input: Uint8Array;
1889
- }
1890
-
1891
- interface MsgpackSecp256k1Reduce512 {
1892
- input: Uint8Array;
1893
- }
1894
-
1895
- export interface Secp256k1Reduce512Response {
1896
- value: Secp256k1Fr;
1897
- }
1898
-
1899
- interface MsgpackSecp256k1Reduce512Response {
1900
- value: Uint8Array;
1901
- }
1902
-
1903
- export interface Shutdown {
1904
- }
1905
-
1906
- interface MsgpackShutdown {
1907
- }
1908
-
1909
- export interface ShutdownResponse {
1910
- }
1911
-
1912
- interface MsgpackShutdownResponse {
1913
- }
1914
-
1915
- export interface SrsInitGrumpkinSrs {
1916
- pointsBuf: Uint8Array;
1917
- numPoints: number;
1918
- }
1919
-
1920
- interface MsgpackSrsInitGrumpkinSrs {
1921
- points_buf: Uint8Array;
1922
- num_points: number;
1923
- }
1924
-
1925
- export interface SrsInitGrumpkinSrsResponse {
1926
- dummy: number;
1927
- }
1928
-
1929
- interface MsgpackSrsInitGrumpkinSrsResponse {
1930
- dummy: number;
1931
- }
1932
-
1933
- export interface SrsInitSrs {
1934
- pointsBuf: Uint8Array;
1935
- numPoints: number;
1936
- g2Point: Uint8Array;
1937
- }
1938
-
1939
- interface MsgpackSrsInitSrs {
1940
- points_buf: Uint8Array;
1941
- num_points: number;
1942
- g2_point: Uint8Array;
1943
- }
1944
-
1945
- export interface SrsInitSrsResponse {
1946
- dummy: number;
1947
- }
1948
-
1949
- interface MsgpackSrsInitSrsResponse {
1950
- dummy: number;
1951
- }
1952
-
1953
- export interface VkAsFields {
1954
- verificationKey: Uint8Array;
1955
- }
1956
-
1957
- interface MsgpackVkAsFields {
1958
- verification_key: Uint8Array;
1959
- }
1960
-
1961
- export interface VkAsFieldsResponse {
1962
- fields: Fr[];
1963
- }
1964
-
1965
- interface MsgpackVkAsFieldsResponse {
1966
- fields: Uint8Array[];
1967
- }
1968
-
1969
- // Conversion functions (exported)
1970
- export function toAesDecrypt(o: MsgpackAesDecrypt): AesDecrypt {
1971
- if (o.ciphertext === undefined) { throw new Error("Expected ciphertext in AesDecrypt deserialization"); }
1972
- if (o.iv === undefined) { throw new Error("Expected iv in AesDecrypt deserialization"); }
1973
- if (o.key === undefined) { throw new Error("Expected key in AesDecrypt deserialization"); }
1974
- if (o.length === undefined) { throw new Error("Expected length in AesDecrypt deserialization"); };
1975
- return {
1976
- ciphertext: o.ciphertext,
1977
- iv: o.iv,
1978
- key: o.key,
1979
- length: o.length,
1980
- };
1981
- }
1982
-
1983
- export function fromAesDecrypt(o: AesDecrypt): MsgpackAesDecrypt {
1984
- if (o.ciphertext === undefined) { throw new Error("Expected ciphertext in AesDecrypt serialization"); }
1985
- if (o.iv === undefined) { throw new Error("Expected iv in AesDecrypt serialization"); }
1986
- if (o.key === undefined) { throw new Error("Expected key in AesDecrypt serialization"); }
1987
- if (o.length === undefined) { throw new Error("Expected length in AesDecrypt serialization"); };
1988
- return {
1989
- ciphertext: o.ciphertext,
1990
- iv: o.iv,
1991
- key: o.key,
1992
- length: o.length,
1993
- };
1994
- }
1995
-
1996
- export function toAesDecryptResponse(o: MsgpackAesDecryptResponse): AesDecryptResponse {
1997
- if (o.plaintext === undefined) { throw new Error("Expected plaintext in AesDecryptResponse deserialization"); };
1998
- return {
1999
- plaintext: o.plaintext,
2000
- };
2001
- }
2002
-
2003
- export function fromAesDecryptResponse(o: AesDecryptResponse): MsgpackAesDecryptResponse {
2004
- if (o.plaintext === undefined) { throw new Error("Expected plaintext in AesDecryptResponse serialization"); };
2005
- return {
2006
- plaintext: o.plaintext,
2007
- };
2008
- }
2009
-
2010
- export function toAesEncrypt(o: MsgpackAesEncrypt): AesEncrypt {
2011
- if (o.plaintext === undefined) { throw new Error("Expected plaintext in AesEncrypt deserialization"); }
2012
- if (o.iv === undefined) { throw new Error("Expected iv in AesEncrypt deserialization"); }
2013
- if (o.key === undefined) { throw new Error("Expected key in AesEncrypt deserialization"); }
2014
- if (o.length === undefined) { throw new Error("Expected length in AesEncrypt deserialization"); };
2015
- return {
2016
- plaintext: o.plaintext,
2017
- iv: o.iv,
2018
- key: o.key,
2019
- length: o.length,
2020
- };
2021
- }
2022
-
2023
- export function fromAesEncrypt(o: AesEncrypt): MsgpackAesEncrypt {
2024
- if (o.plaintext === undefined) { throw new Error("Expected plaintext in AesEncrypt serialization"); }
2025
- if (o.iv === undefined) { throw new Error("Expected iv in AesEncrypt serialization"); }
2026
- if (o.key === undefined) { throw new Error("Expected key in AesEncrypt serialization"); }
2027
- if (o.length === undefined) { throw new Error("Expected length in AesEncrypt serialization"); };
2028
- return {
2029
- plaintext: o.plaintext,
2030
- iv: o.iv,
2031
- key: o.key,
2032
- length: o.length,
2033
- };
2034
- }
2035
-
2036
- export function toAesEncryptResponse(o: MsgpackAesEncryptResponse): AesEncryptResponse {
2037
- if (o.ciphertext === undefined) { throw new Error("Expected ciphertext in AesEncryptResponse deserialization"); };
2038
- return {
2039
- ciphertext: o.ciphertext,
2040
- };
2041
- }
2042
-
2043
- export function fromAesEncryptResponse(o: AesEncryptResponse): MsgpackAesEncryptResponse {
2044
- if (o.ciphertext === undefined) { throw new Error("Expected ciphertext in AesEncryptResponse serialization"); };
2045
- return {
2046
- ciphertext: o.ciphertext,
2047
- };
2048
- }
2049
-
2050
- export function toAffineElement(o: MsgpackAffineElement): AffineElement {
2051
- if (o.x === undefined) { throw new Error("Expected x in AffineElement deserialization"); }
2052
- if (o.y === undefined) { throw new Error("Expected y in AffineElement deserialization"); };
2053
- return {
2054
- x: o.x,
2055
- y: o.y,
2056
- };
2057
- }
2058
-
2059
- export function fromAffineElement(o: AffineElement): MsgpackAffineElement {
2060
- if (o.x === undefined) { throw new Error("Expected x in AffineElement serialization"); }
2061
- if (o.y === undefined) { throw new Error("Expected y in AffineElement serialization"); };
2062
- return {
2063
- x: o.x,
2064
- y: o.y,
2065
- };
2066
- }
2067
-
2068
- export function toBlake2s(o: MsgpackBlake2s): Blake2s {
2069
- if (o.data === undefined) { throw new Error("Expected data in Blake2s deserialization"); };
2070
- return {
2071
- data: o.data,
2072
- };
2073
- }
2074
-
2075
- export function fromBlake2s(o: Blake2s): MsgpackBlake2s {
2076
- if (o.data === undefined) { throw new Error("Expected data in Blake2s serialization"); };
2077
- return {
2078
- data: o.data,
2079
- };
2080
- }
2081
-
2082
- export function toBlake2sResponse(o: MsgpackBlake2sResponse): Blake2sResponse {
2083
- if (o.hash === undefined) { throw new Error("Expected hash in Blake2sResponse deserialization"); };
2084
- return {
2085
- hash: o.hash,
2086
- };
2087
- }
2088
-
2089
- export function fromBlake2sResponse(o: Blake2sResponse): MsgpackBlake2sResponse {
2090
- if (o.hash === undefined) { throw new Error("Expected hash in Blake2sResponse serialization"); };
2091
- return {
2092
- hash: o.hash,
2093
- };
2094
- }
2095
-
2096
- export function toBlake2sToField(o: MsgpackBlake2sToField): Blake2sToField {
2097
- if (o.data === undefined) { throw new Error("Expected data in Blake2sToField deserialization"); };
2098
- return {
2099
- data: o.data,
2100
- };
2101
- }
2102
-
2103
- export function fromBlake2sToField(o: Blake2sToField): MsgpackBlake2sToField {
2104
- if (o.data === undefined) { throw new Error("Expected data in Blake2sToField serialization"); };
2105
- return {
2106
- data: o.data,
2107
- };
2108
- }
2109
-
2110
- export function toBlake2sToFieldResponse(o: MsgpackBlake2sToFieldResponse): Blake2sToFieldResponse {
2111
- if (o.field === undefined) { throw new Error("Expected field in Blake2sToFieldResponse deserialization"); };
2112
- return {
2113
- field: o.field,
2114
- };
2115
- }
2116
-
2117
- export function fromBlake2sToFieldResponse(o: Blake2sToFieldResponse): MsgpackBlake2sToFieldResponse {
2118
- if (o.field === undefined) { throw new Error("Expected field in Blake2sToFieldResponse serialization"); };
2119
- return {
2120
- field: o.field,
2121
- };
2122
- }
2123
-
2124
- export function toBn254FrSqrt(o: MsgpackBn254FrSqrt): Bn254FrSqrt {
2125
- if (o.input === undefined) { throw new Error("Expected input in Bn254FrSqrt deserialization"); };
2126
- return {
2127
- input: o.input,
2128
- };
2129
- }
2130
-
2131
- export function fromBn254FrSqrt(o: Bn254FrSqrt): MsgpackBn254FrSqrt {
2132
- if (o.input === undefined) { throw new Error("Expected input in Bn254FrSqrt serialization"); };
2133
- return {
2134
- input: o.input,
2135
- };
2136
- }
2137
-
2138
- export function toBn254FrSqrtResponse(o: MsgpackBn254FrSqrtResponse): Bn254FrSqrtResponse {
2139
- if (o.is_square_root === undefined) { throw new Error("Expected is_square_root in Bn254FrSqrtResponse deserialization"); }
2140
- if (o.value === undefined) { throw new Error("Expected value in Bn254FrSqrtResponse deserialization"); };
2141
- return {
2142
- isSquareRoot: o.is_square_root,
2143
- value: o.value,
2144
- };
2145
- }
2146
-
2147
- export function fromBn254FrSqrtResponse(o: Bn254FrSqrtResponse): MsgpackBn254FrSqrtResponse {
2148
- if (o.isSquareRoot === undefined) { throw new Error("Expected isSquareRoot in Bn254FrSqrtResponse serialization"); }
2149
- if (o.value === undefined) { throw new Error("Expected value in Bn254FrSqrtResponse serialization"); };
2150
- return {
2151
- is_square_root: o.isSquareRoot,
2152
- value: o.value,
2153
- };
2154
- }
2155
-
2156
- export function toCircuitComputeVk(o: MsgpackCircuitComputeVk): CircuitComputeVk {
2157
- if (o.circuit === undefined) { throw new Error("Expected circuit in CircuitComputeVk deserialization"); }
2158
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitComputeVk deserialization"); };
2159
- return {
2160
- circuit: toCircuitInputNoVK(o.circuit),
2161
- settings: toProofSystemSettings(o.settings),
2162
- };
2163
- }
2164
-
2165
- export function fromCircuitComputeVk(o: CircuitComputeVk): MsgpackCircuitComputeVk {
2166
- if (o.circuit === undefined) { throw new Error("Expected circuit in CircuitComputeVk serialization"); }
2167
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitComputeVk serialization"); };
2168
- return {
2169
- circuit: fromCircuitInputNoVK(o.circuit),
2170
- settings: fromProofSystemSettings(o.settings),
2171
- };
2172
- }
2173
-
2174
- export function toCircuitComputeVkResponse(o: MsgpackCircuitComputeVkResponse): CircuitComputeVkResponse {
2175
- if (o.bytes === undefined) { throw new Error("Expected bytes in CircuitComputeVkResponse deserialization"); }
2176
- if (o.fields === undefined) { throw new Error("Expected fields in CircuitComputeVkResponse deserialization"); }
2177
- if (o.hash === undefined) { throw new Error("Expected hash in CircuitComputeVkResponse deserialization"); };
2178
- return {
2179
- bytes: o.bytes,
2180
- fields: o.fields.map((v: any) => v),
2181
- hash: o.hash,
2182
- };
2183
- }
2184
-
2185
- export function fromCircuitComputeVkResponse(o: CircuitComputeVkResponse): MsgpackCircuitComputeVkResponse {
2186
- if (o.bytes === undefined) { throw new Error("Expected bytes in CircuitComputeVkResponse serialization"); }
2187
- if (o.fields === undefined) { throw new Error("Expected fields in CircuitComputeVkResponse serialization"); }
2188
- if (o.hash === undefined) { throw new Error("Expected hash in CircuitComputeVkResponse serialization"); };
2189
- return {
2190
- bytes: o.bytes,
2191
- fields: o.fields.map((v: any) => v),
2192
- hash: o.hash,
2193
- };
2194
- }
2195
-
2196
- export function toCircuitInfoResponse(o: MsgpackCircuitInfoResponse): CircuitInfoResponse {
2197
- if (o.num_gates === undefined) { throw new Error("Expected num_gates in CircuitInfoResponse deserialization"); }
2198
- if (o.num_gates_dyadic === undefined) { throw new Error("Expected num_gates_dyadic in CircuitInfoResponse deserialization"); }
2199
- if (o.num_acir_opcodes === undefined) { throw new Error("Expected num_acir_opcodes in CircuitInfoResponse deserialization"); }
2200
- if (o.gates_per_opcode === undefined) { throw new Error("Expected gates_per_opcode in CircuitInfoResponse deserialization"); };
2201
- return {
2202
- numGates: o.num_gates,
2203
- numGatesDyadic: o.num_gates_dyadic,
2204
- numAcirOpcodes: o.num_acir_opcodes,
2205
- gatesPerOpcode: o.gates_per_opcode.map((v: any) => v),
2206
- };
2207
- }
2208
-
2209
- export function fromCircuitInfoResponse(o: CircuitInfoResponse): MsgpackCircuitInfoResponse {
2210
- if (o.numGates === undefined) { throw new Error("Expected numGates in CircuitInfoResponse serialization"); }
2211
- if (o.numGatesDyadic === undefined) { throw new Error("Expected numGatesDyadic in CircuitInfoResponse serialization"); }
2212
- if (o.numAcirOpcodes === undefined) { throw new Error("Expected numAcirOpcodes in CircuitInfoResponse serialization"); }
2213
- if (o.gatesPerOpcode === undefined) { throw new Error("Expected gatesPerOpcode in CircuitInfoResponse serialization"); };
2214
- return {
2215
- num_gates: o.numGates,
2216
- num_gates_dyadic: o.numGatesDyadic,
2217
- num_acir_opcodes: o.numAcirOpcodes,
2218
- gates_per_opcode: o.gatesPerOpcode.map((v: any) => v),
2219
- };
2220
- }
2221
-
2222
- export function toCircuitInput(o: MsgpackCircuitInput): CircuitInput {
2223
- if (o.name === undefined) { throw new Error("Expected name in CircuitInput deserialization"); }
2224
- if (o.bytecode === undefined) { throw new Error("Expected bytecode in CircuitInput deserialization"); }
2225
- if (o.verification_key === undefined) { throw new Error("Expected verification_key in CircuitInput deserialization"); };
2226
- return {
2227
- name: o.name,
2228
- bytecode: o.bytecode,
2229
- verificationKey: o.verification_key,
2230
- };
2231
- }
2232
-
2233
- export function fromCircuitInput(o: CircuitInput): MsgpackCircuitInput {
2234
- if (o.name === undefined) { throw new Error("Expected name in CircuitInput serialization"); }
2235
- if (o.bytecode === undefined) { throw new Error("Expected bytecode in CircuitInput serialization"); }
2236
- if (o.verificationKey === undefined) { throw new Error("Expected verificationKey in CircuitInput serialization"); };
2237
- return {
2238
- name: o.name,
2239
- bytecode: o.bytecode,
2240
- verification_key: o.verificationKey,
2241
- };
2242
- }
2243
-
2244
- export function toCircuitInputNoVK(o: MsgpackCircuitInputNoVK): CircuitInputNoVK {
2245
- if (o.name === undefined) { throw new Error("Expected name in CircuitInputNoVK deserialization"); }
2246
- if (o.bytecode === undefined) { throw new Error("Expected bytecode in CircuitInputNoVK deserialization"); };
2247
- return {
2248
- name: o.name,
2249
- bytecode: o.bytecode,
2250
- };
2251
- }
2252
-
2253
- export function fromCircuitInputNoVK(o: CircuitInputNoVK): MsgpackCircuitInputNoVK {
2254
- if (o.name === undefined) { throw new Error("Expected name in CircuitInputNoVK serialization"); }
2255
- if (o.bytecode === undefined) { throw new Error("Expected bytecode in CircuitInputNoVK serialization"); };
2256
- return {
2257
- name: o.name,
2258
- bytecode: o.bytecode,
2259
- };
2260
- }
2261
-
2262
- export function toCircuitProve(o: MsgpackCircuitProve): CircuitProve {
2263
- if (o.circuit === undefined) { throw new Error("Expected circuit in CircuitProve deserialization"); }
2264
- if (o.witness === undefined) { throw new Error("Expected witness in CircuitProve deserialization"); }
2265
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitProve deserialization"); };
2266
- return {
2267
- circuit: toCircuitInput(o.circuit),
2268
- witness: o.witness,
2269
- settings: toProofSystemSettings(o.settings),
2270
- };
2271
- }
2272
-
2273
- export function fromCircuitProve(o: CircuitProve): MsgpackCircuitProve {
2274
- if (o.circuit === undefined) { throw new Error("Expected circuit in CircuitProve serialization"); }
2275
- if (o.witness === undefined) { throw new Error("Expected witness in CircuitProve serialization"); }
2276
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitProve serialization"); };
2277
- return {
2278
- circuit: fromCircuitInput(o.circuit),
2279
- witness: o.witness,
2280
- settings: fromProofSystemSettings(o.settings),
2281
- };
2282
- }
2283
-
2284
- export function toCircuitProveResponse(o: MsgpackCircuitProveResponse): CircuitProveResponse {
2285
- if (o.public_inputs === undefined) { throw new Error("Expected public_inputs in CircuitProveResponse deserialization"); }
2286
- if (o.proof === undefined) { throw new Error("Expected proof in CircuitProveResponse deserialization"); }
2287
- if (o.vk === undefined) { throw new Error("Expected vk in CircuitProveResponse deserialization"); };
2288
- return {
2289
- publicInputs: o.public_inputs.map((v: any) => v),
2290
- proof: o.proof.map((v: any) => v),
2291
- vk: toCircuitComputeVkResponse(o.vk),
2292
- };
2293
- }
2294
-
2295
- export function fromCircuitProveResponse(o: CircuitProveResponse): MsgpackCircuitProveResponse {
2296
- if (o.publicInputs === undefined) { throw new Error("Expected publicInputs in CircuitProveResponse serialization"); }
2297
- if (o.proof === undefined) { throw new Error("Expected proof in CircuitProveResponse serialization"); }
2298
- if (o.vk === undefined) { throw new Error("Expected vk in CircuitProveResponse serialization"); };
2299
- return {
2300
- public_inputs: o.publicInputs.map((v: any) => v),
2301
- proof: o.proof.map((v: any) => v),
2302
- vk: fromCircuitComputeVkResponse(o.vk),
2303
- };
2304
- }
2305
-
2306
- export function toCircuitStats(o: MsgpackCircuitStats): CircuitStats {
2307
- if (o.circuit === undefined) { throw new Error("Expected circuit in CircuitStats deserialization"); }
2308
- if (o.include_gates_per_opcode === undefined) { throw new Error("Expected include_gates_per_opcode in CircuitStats deserialization"); }
2309
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitStats deserialization"); };
2310
- return {
2311
- circuit: toCircuitInput(o.circuit),
2312
- includeGatesPerOpcode: o.include_gates_per_opcode,
2313
- settings: toProofSystemSettings(o.settings),
2314
- };
2315
- }
2316
-
2317
- export function fromCircuitStats(o: CircuitStats): MsgpackCircuitStats {
2318
- if (o.circuit === undefined) { throw new Error("Expected circuit in CircuitStats serialization"); }
2319
- if (o.includeGatesPerOpcode === undefined) { throw new Error("Expected includeGatesPerOpcode in CircuitStats serialization"); }
2320
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitStats serialization"); };
2321
- return {
2322
- circuit: fromCircuitInput(o.circuit),
2323
- include_gates_per_opcode: o.includeGatesPerOpcode,
2324
- settings: fromProofSystemSettings(o.settings),
2325
- };
2326
- }
2327
-
2328
- export function toCircuitVerify(o: MsgpackCircuitVerify): CircuitVerify {
2329
- if (o.verification_key === undefined) { throw new Error("Expected verification_key in CircuitVerify deserialization"); }
2330
- if (o.public_inputs === undefined) { throw new Error("Expected public_inputs in CircuitVerify deserialization"); }
2331
- if (o.proof === undefined) { throw new Error("Expected proof in CircuitVerify deserialization"); }
2332
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitVerify deserialization"); };
2333
- return {
2334
- verificationKey: o.verification_key,
2335
- publicInputs: o.public_inputs.map((v: any) => v),
2336
- proof: o.proof.map((v: any) => v),
2337
- settings: toProofSystemSettings(o.settings),
2338
- };
2339
- }
2340
-
2341
- export function fromCircuitVerify(o: CircuitVerify): MsgpackCircuitVerify {
2342
- if (o.verificationKey === undefined) { throw new Error("Expected verificationKey in CircuitVerify serialization"); }
2343
- if (o.publicInputs === undefined) { throw new Error("Expected publicInputs in CircuitVerify serialization"); }
2344
- if (o.proof === undefined) { throw new Error("Expected proof in CircuitVerify serialization"); }
2345
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitVerify serialization"); };
2346
- return {
2347
- verification_key: o.verificationKey,
2348
- public_inputs: o.publicInputs.map((v: any) => v),
2349
- proof: o.proof.map((v: any) => v),
2350
- settings: fromProofSystemSettings(o.settings),
2351
- };
2352
- }
2353
-
2354
- export function toCircuitVerifyResponse(o: MsgpackCircuitVerifyResponse): CircuitVerifyResponse {
2355
- if (o.verified === undefined) { throw new Error("Expected verified in CircuitVerifyResponse deserialization"); };
2356
- return {
2357
- verified: o.verified,
2358
- };
2359
- }
2360
-
2361
- export function fromCircuitVerifyResponse(o: CircuitVerifyResponse): MsgpackCircuitVerifyResponse {
2362
- if (o.verified === undefined) { throw new Error("Expected verified in CircuitVerifyResponse serialization"); };
2363
- return {
2364
- verified: o.verified,
2365
- };
2366
- }
2367
-
2368
- export function toCircuitWriteSolidityVerifier(o: MsgpackCircuitWriteSolidityVerifier): CircuitWriteSolidityVerifier {
2369
- if (o.verification_key === undefined) { throw new Error("Expected verification_key in CircuitWriteSolidityVerifier deserialization"); }
2370
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitWriteSolidityVerifier deserialization"); };
2371
- return {
2372
- verificationKey: o.verification_key,
2373
- settings: toProofSystemSettings(o.settings),
2374
- };
2375
- }
2376
-
2377
- export function fromCircuitWriteSolidityVerifier(o: CircuitWriteSolidityVerifier): MsgpackCircuitWriteSolidityVerifier {
2378
- if (o.verificationKey === undefined) { throw new Error("Expected verificationKey in CircuitWriteSolidityVerifier serialization"); }
2379
- if (o.settings === undefined) { throw new Error("Expected settings in CircuitWriteSolidityVerifier serialization"); };
2380
- return {
2381
- verification_key: o.verificationKey,
2382
- settings: fromProofSystemSettings(o.settings),
2383
- };
2384
- }
2385
-
2386
- export function toCircuitWriteSolidityVerifierResponse(o: MsgpackCircuitWriteSolidityVerifierResponse): CircuitWriteSolidityVerifierResponse {
2387
- if (o.solidity_code === undefined) { throw new Error("Expected solidity_code in CircuitWriteSolidityVerifierResponse deserialization"); };
2388
- return {
2389
- solidityCode: o.solidity_code,
2390
- };
2391
- }
2392
-
2393
- export function fromCircuitWriteSolidityVerifierResponse(o: CircuitWriteSolidityVerifierResponse): MsgpackCircuitWriteSolidityVerifierResponse {
2394
- if (o.solidityCode === undefined) { throw new Error("Expected solidityCode in CircuitWriteSolidityVerifierResponse serialization"); };
2395
- return {
2396
- solidity_code: o.solidityCode,
2397
- };
2398
- }
2399
-
2400
- export function toClientIvcAccumulate(o: MsgpackClientIvcAccumulate): ClientIvcAccumulate {
2401
- if (o.witness === undefined) { throw new Error("Expected witness in ClientIvcAccumulate deserialization"); };
2402
- return {
2403
- witness: o.witness,
2404
- };
2405
- }
2406
-
2407
- export function fromClientIvcAccumulate(o: ClientIvcAccumulate): MsgpackClientIvcAccumulate {
2408
- if (o.witness === undefined) { throw new Error("Expected witness in ClientIvcAccumulate serialization"); };
2409
- return {
2410
- witness: o.witness,
2411
- };
2412
- }
2413
-
2414
- export function toClientIvcAccumulateResponse(o: MsgpackClientIvcAccumulateResponse): ClientIvcAccumulateResponse {
2415
- return {};
2416
- }
2417
-
2418
- export function fromClientIvcAccumulateResponse(o: ClientIvcAccumulateResponse): MsgpackClientIvcAccumulateResponse {
2419
- return {};
2420
- }
2421
-
2422
- export function toClientIvcCheckPrecomputedVk(o: MsgpackClientIvcCheckPrecomputedVk): ClientIvcCheckPrecomputedVk {
2423
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcCheckPrecomputedVk deserialization"); };
2424
- return {
2425
- circuit: toCircuitInput(o.circuit),
2426
- };
2427
- }
2428
-
2429
- export function fromClientIvcCheckPrecomputedVk(o: ClientIvcCheckPrecomputedVk): MsgpackClientIvcCheckPrecomputedVk {
2430
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcCheckPrecomputedVk serialization"); };
2431
- return {
2432
- circuit: fromCircuitInput(o.circuit),
2433
- };
2434
- }
2435
-
2436
- export function toClientIvcCheckPrecomputedVkResponse(o: MsgpackClientIvcCheckPrecomputedVkResponse): ClientIvcCheckPrecomputedVkResponse {
2437
- if (o.valid === undefined) { throw new Error("Expected valid in ClientIvcCheckPrecomputedVkResponse deserialization"); }
2438
- if (o.actual_vk === undefined) { throw new Error("Expected actual_vk in ClientIvcCheckPrecomputedVkResponse deserialization"); };
2439
- return {
2440
- valid: o.valid,
2441
- actualVk: o.actual_vk,
2442
- };
2443
- }
2444
-
2445
- export function fromClientIvcCheckPrecomputedVkResponse(o: ClientIvcCheckPrecomputedVkResponse): MsgpackClientIvcCheckPrecomputedVkResponse {
2446
- if (o.valid === undefined) { throw new Error("Expected valid in ClientIvcCheckPrecomputedVkResponse serialization"); }
2447
- if (o.actualVk === undefined) { throw new Error("Expected actualVk in ClientIvcCheckPrecomputedVkResponse serialization"); };
2448
- return {
2449
- valid: o.valid,
2450
- actual_vk: o.actualVk,
2451
- };
2452
- }
2453
-
2454
- export function toClientIvcComputeIvcVk(o: MsgpackClientIvcComputeIvcVk): ClientIvcComputeIvcVk {
2455
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcComputeIvcVk deserialization"); };
2456
- return {
2457
- circuit: toCircuitInputNoVK(o.circuit),
2458
- };
2459
- }
2460
-
2461
- export function fromClientIvcComputeIvcVk(o: ClientIvcComputeIvcVk): MsgpackClientIvcComputeIvcVk {
2462
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcComputeIvcVk serialization"); };
2463
- return {
2464
- circuit: fromCircuitInputNoVK(o.circuit),
2465
- };
2466
- }
2467
-
2468
- export function toClientIvcComputeIvcVkResponse(o: MsgpackClientIvcComputeIvcVkResponse): ClientIvcComputeIvcVkResponse {
2469
- if (o.bytes === undefined) { throw new Error("Expected bytes in ClientIvcComputeIvcVkResponse deserialization"); };
2470
- return {
2471
- bytes: o.bytes,
2472
- };
2473
- }
2474
-
2475
- export function fromClientIvcComputeIvcVkResponse(o: ClientIvcComputeIvcVkResponse): MsgpackClientIvcComputeIvcVkResponse {
2476
- if (o.bytes === undefined) { throw new Error("Expected bytes in ClientIvcComputeIvcVkResponse serialization"); };
2477
- return {
2478
- bytes: o.bytes,
2479
- };
2480
- }
2481
-
2482
- export function toClientIvcComputeStandaloneVk(o: MsgpackClientIvcComputeStandaloneVk): ClientIvcComputeStandaloneVk {
2483
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcComputeStandaloneVk deserialization"); };
2484
- return {
2485
- circuit: toCircuitInputNoVK(o.circuit),
2486
- };
2487
- }
2488
-
2489
- export function fromClientIvcComputeStandaloneVk(o: ClientIvcComputeStandaloneVk): MsgpackClientIvcComputeStandaloneVk {
2490
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcComputeStandaloneVk serialization"); };
2491
- return {
2492
- circuit: fromCircuitInputNoVK(o.circuit),
2493
- };
2494
- }
2495
-
2496
- export function toClientIvcComputeStandaloneVkResponse(o: MsgpackClientIvcComputeStandaloneVkResponse): ClientIvcComputeStandaloneVkResponse {
2497
- if (o.bytes === undefined) { throw new Error("Expected bytes in ClientIvcComputeStandaloneVkResponse deserialization"); }
2498
- if (o.fields === undefined) { throw new Error("Expected fields in ClientIvcComputeStandaloneVkResponse deserialization"); };
2499
- return {
2500
- bytes: o.bytes,
2501
- fields: o.fields.map((v: any) => v),
2502
- };
2503
- }
2504
-
2505
- export function fromClientIvcComputeStandaloneVkResponse(o: ClientIvcComputeStandaloneVkResponse): MsgpackClientIvcComputeStandaloneVkResponse {
2506
- if (o.bytes === undefined) { throw new Error("Expected bytes in ClientIvcComputeStandaloneVkResponse serialization"); }
2507
- if (o.fields === undefined) { throw new Error("Expected fields in ClientIvcComputeStandaloneVkResponse serialization"); };
2508
- return {
2509
- bytes: o.bytes,
2510
- fields: o.fields.map((v: any) => v),
2511
- };
2512
- }
2513
-
2514
- export function toClientIvcLoad(o: MsgpackClientIvcLoad): ClientIvcLoad {
2515
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcLoad deserialization"); };
2516
- return {
2517
- circuit: toCircuitInput(o.circuit),
2518
- };
2519
- }
2520
-
2521
- export function fromClientIvcLoad(o: ClientIvcLoad): MsgpackClientIvcLoad {
2522
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcLoad serialization"); };
2523
- return {
2524
- circuit: fromCircuitInput(o.circuit),
2525
- };
2526
- }
2527
-
2528
- export function toClientIvcLoadResponse(o: MsgpackClientIvcLoadResponse): ClientIvcLoadResponse {
2529
- return {};
2530
- }
2531
-
2532
- export function fromClientIvcLoadResponse(o: ClientIvcLoadResponse): MsgpackClientIvcLoadResponse {
2533
- return {};
2534
- }
2535
-
2536
- export function toClientIVCProof(o: MsgpackClientIVCProof): ClientIVCProof {
2537
- if (o.mega_proof === undefined) { throw new Error("Expected mega_proof in ClientIVCProof deserialization"); }
2538
- if (o.goblin_proof === undefined) { throw new Error("Expected goblin_proof in ClientIVCProof deserialization"); };
2539
- return {
2540
- megaProof: o.mega_proof.map((v: any) => v),
2541
- goblinProof: toGoblinProof(o.goblin_proof),
2542
- };
2543
- }
2544
-
2545
- export function fromClientIVCProof(o: ClientIVCProof): MsgpackClientIVCProof {
2546
- if (o.megaProof === undefined) { throw new Error("Expected megaProof in ClientIVCProof serialization"); }
2547
- if (o.goblinProof === undefined) { throw new Error("Expected goblinProof in ClientIVCProof serialization"); };
2548
- return {
2549
- mega_proof: o.megaProof.map((v: any) => v),
2550
- goblin_proof: fromGoblinProof(o.goblinProof),
2551
- };
2552
- }
2553
-
2554
- export function toClientIvcProve(o: MsgpackClientIvcProve): ClientIvcProve {
2555
- return {};
2556
- }
2557
-
2558
- export function fromClientIvcProve(o: ClientIvcProve): MsgpackClientIvcProve {
2559
- return {};
2560
- }
2561
-
2562
- export function toClientIvcProveResponse(o: MsgpackClientIvcProveResponse): ClientIvcProveResponse {
2563
- if (o.proof === undefined) { throw new Error("Expected proof in ClientIvcProveResponse deserialization"); };
2564
- return {
2565
- proof: toClientIVCProof(o.proof),
2566
- };
2567
- }
2568
-
2569
- export function fromClientIvcProveResponse(o: ClientIvcProveResponse): MsgpackClientIvcProveResponse {
2570
- if (o.proof === undefined) { throw new Error("Expected proof in ClientIvcProveResponse serialization"); };
2571
- return {
2572
- proof: fromClientIVCProof(o.proof),
2573
- };
2574
- }
2575
-
2576
- export function toClientIvcStart(o: MsgpackClientIvcStart): ClientIvcStart {
2577
- if (o.num_circuits === undefined) { throw new Error("Expected num_circuits in ClientIvcStart deserialization"); };
2578
- return {
2579
- numCircuits: o.num_circuits,
2580
- };
2581
- }
2582
-
2583
- export function fromClientIvcStart(o: ClientIvcStart): MsgpackClientIvcStart {
2584
- if (o.numCircuits === undefined) { throw new Error("Expected numCircuits in ClientIvcStart serialization"); };
2585
- return {
2586
- num_circuits: o.numCircuits,
2587
- };
2588
- }
2589
-
2590
- export function toClientIvcStartResponse(o: MsgpackClientIvcStartResponse): ClientIvcStartResponse {
2591
- return {};
2592
- }
2593
-
2594
- export function fromClientIvcStartResponse(o: ClientIvcStartResponse): MsgpackClientIvcStartResponse {
2595
- return {};
2596
- }
2597
-
2598
- export function toClientIvcStats(o: MsgpackClientIvcStats): ClientIvcStats {
2599
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcStats deserialization"); }
2600
- if (o.include_gates_per_opcode === undefined) { throw new Error("Expected include_gates_per_opcode in ClientIvcStats deserialization"); };
2601
- return {
2602
- circuit: toCircuitInputNoVK(o.circuit),
2603
- includeGatesPerOpcode: o.include_gates_per_opcode,
2604
- };
2605
- }
2606
-
2607
- export function fromClientIvcStats(o: ClientIvcStats): MsgpackClientIvcStats {
2608
- if (o.circuit === undefined) { throw new Error("Expected circuit in ClientIvcStats serialization"); }
2609
- if (o.includeGatesPerOpcode === undefined) { throw new Error("Expected includeGatesPerOpcode in ClientIvcStats serialization"); };
2610
- return {
2611
- circuit: fromCircuitInputNoVK(o.circuit),
2612
- include_gates_per_opcode: o.includeGatesPerOpcode,
2613
- };
2614
- }
2615
-
2616
- export function toClientIvcStatsResponse(o: MsgpackClientIvcStatsResponse): ClientIvcStatsResponse {
2617
- if (o.acir_opcodes === undefined) { throw new Error("Expected acir_opcodes in ClientIvcStatsResponse deserialization"); }
2618
- if (o.circuit_size === undefined) { throw new Error("Expected circuit_size in ClientIvcStatsResponse deserialization"); }
2619
- if (o.gates_per_opcode === undefined) { throw new Error("Expected gates_per_opcode in ClientIvcStatsResponse deserialization"); };
2620
- return {
2621
- acirOpcodes: o.acir_opcodes,
2622
- circuitSize: o.circuit_size,
2623
- gatesPerOpcode: o.gates_per_opcode.map((v: any) => v),
2624
- };
2625
- }
2626
-
2627
- export function fromClientIvcStatsResponse(o: ClientIvcStatsResponse): MsgpackClientIvcStatsResponse {
2628
- if (o.acirOpcodes === undefined) { throw new Error("Expected acirOpcodes in ClientIvcStatsResponse serialization"); }
2629
- if (o.circuitSize === undefined) { throw new Error("Expected circuitSize in ClientIvcStatsResponse serialization"); }
2630
- if (o.gatesPerOpcode === undefined) { throw new Error("Expected gatesPerOpcode in ClientIvcStatsResponse serialization"); };
2631
- return {
2632
- acir_opcodes: o.acirOpcodes,
2633
- circuit_size: o.circuitSize,
2634
- gates_per_opcode: o.gatesPerOpcode.map((v: any) => v),
2635
- };
2636
- }
2637
-
2638
- export function toClientIvcVerify(o: MsgpackClientIvcVerify): ClientIvcVerify {
2639
- if (o.proof === undefined) { throw new Error("Expected proof in ClientIvcVerify deserialization"); }
2640
- if (o.vk === undefined) { throw new Error("Expected vk in ClientIvcVerify deserialization"); };
2641
- return {
2642
- proof: toClientIVCProof(o.proof),
2643
- vk: o.vk,
2644
- };
2645
- }
2646
-
2647
- export function fromClientIvcVerify(o: ClientIvcVerify): MsgpackClientIvcVerify {
2648
- if (o.proof === undefined) { throw new Error("Expected proof in ClientIvcVerify serialization"); }
2649
- if (o.vk === undefined) { throw new Error("Expected vk in ClientIvcVerify serialization"); };
2650
- return {
2651
- proof: fromClientIVCProof(o.proof),
2652
- vk: o.vk,
2653
- };
2654
- }
2655
-
2656
- export function toClientIvcVerifyResponse(o: MsgpackClientIvcVerifyResponse): ClientIvcVerifyResponse {
2657
- if (o.valid === undefined) { throw new Error("Expected valid in ClientIvcVerifyResponse deserialization"); };
2658
- return {
2659
- valid: o.valid,
2660
- };
2661
- }
2662
-
2663
- export function fromClientIvcVerifyResponse(o: ClientIvcVerifyResponse): MsgpackClientIvcVerifyResponse {
2664
- if (o.valid === undefined) { throw new Error("Expected valid in ClientIvcVerifyResponse serialization"); };
2665
- return {
2666
- valid: o.valid,
2667
- };
2668
- }
2669
-
2670
- export function toECCVMProof(o: MsgpackECCVMProof): ECCVMProof {
2671
- if (o.pre_ipa_proof === undefined) { throw new Error("Expected pre_ipa_proof in ECCVMProof deserialization"); }
2672
- if (o.ipa_proof === undefined) { throw new Error("Expected ipa_proof in ECCVMProof deserialization"); };
2673
- return {
2674
- preIpaProof: o.pre_ipa_proof.map((v: any) => v),
2675
- ipaProof: o.ipa_proof.map((v: any) => v),
2676
- };
2677
- }
2678
-
2679
- export function fromECCVMProof(o: ECCVMProof): MsgpackECCVMProof {
2680
- if (o.preIpaProof === undefined) { throw new Error("Expected preIpaProof in ECCVMProof serialization"); }
2681
- if (o.ipaProof === undefined) { throw new Error("Expected ipaProof in ECCVMProof serialization"); };
2682
- return {
2683
- pre_ipa_proof: o.preIpaProof.map((v: any) => v),
2684
- ipa_proof: o.ipaProof.map((v: any) => v),
2685
- };
2686
- }
2687
-
2688
- export function toEcdsaSecp256k1ComputePublicKey(o: MsgpackEcdsaSecp256k1ComputePublicKey): EcdsaSecp256k1ComputePublicKey {
2689
- if (o.private_key === undefined) { throw new Error("Expected private_key in EcdsaSecp256k1ComputePublicKey deserialization"); };
2690
- return {
2691
- privateKey: o.private_key,
2692
- };
2693
- }
2694
-
2695
- export function fromEcdsaSecp256k1ComputePublicKey(o: EcdsaSecp256k1ComputePublicKey): MsgpackEcdsaSecp256k1ComputePublicKey {
2696
- if (o.privateKey === undefined) { throw new Error("Expected privateKey in EcdsaSecp256k1ComputePublicKey serialization"); };
2697
- return {
2698
- private_key: o.privateKey,
2699
- };
2700
- }
2701
-
2702
- export function toEcdsaSecp256k1ComputePublicKeyResponse(o: MsgpackEcdsaSecp256k1ComputePublicKeyResponse): EcdsaSecp256k1ComputePublicKeyResponse {
2703
- if (o.public_key === undefined) { throw new Error("Expected public_key in EcdsaSecp256k1ComputePublicKeyResponse deserialization"); };
2704
- return {
2705
- publicKey: toAffineElement(o.public_key),
2706
- };
2707
- }
2708
-
2709
- export function fromEcdsaSecp256k1ComputePublicKeyResponse(o: EcdsaSecp256k1ComputePublicKeyResponse): MsgpackEcdsaSecp256k1ComputePublicKeyResponse {
2710
- if (o.publicKey === undefined) { throw new Error("Expected publicKey in EcdsaSecp256k1ComputePublicKeyResponse serialization"); };
2711
- return {
2712
- public_key: fromAffineElement(o.publicKey),
2713
- };
2714
- }
2715
-
2716
- export function toEcdsaSecp256k1ConstructSignature(o: MsgpackEcdsaSecp256k1ConstructSignature): EcdsaSecp256k1ConstructSignature {
2717
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256k1ConstructSignature deserialization"); }
2718
- if (o.private_key === undefined) { throw new Error("Expected private_key in EcdsaSecp256k1ConstructSignature deserialization"); };
2719
- return {
2720
- message: o.message,
2721
- privateKey: o.private_key,
2722
- };
2723
- }
2724
-
2725
- export function fromEcdsaSecp256k1ConstructSignature(o: EcdsaSecp256k1ConstructSignature): MsgpackEcdsaSecp256k1ConstructSignature {
2726
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256k1ConstructSignature serialization"); }
2727
- if (o.privateKey === undefined) { throw new Error("Expected privateKey in EcdsaSecp256k1ConstructSignature serialization"); };
2728
- return {
2729
- message: o.message,
2730
- private_key: o.privateKey,
2731
- };
2732
- }
2733
-
2734
- export function toEcdsaSecp256k1ConstructSignatureResponse(o: MsgpackEcdsaSecp256k1ConstructSignatureResponse): EcdsaSecp256k1ConstructSignatureResponse {
2735
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256k1ConstructSignatureResponse deserialization"); }
2736
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256k1ConstructSignatureResponse deserialization"); }
2737
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256k1ConstructSignatureResponse deserialization"); };
2738
- return {
2739
- r: o.r,
2740
- s: o.s,
2741
- v: o.v,
2742
- };
2743
- }
2744
-
2745
- export function fromEcdsaSecp256k1ConstructSignatureResponse(o: EcdsaSecp256k1ConstructSignatureResponse): MsgpackEcdsaSecp256k1ConstructSignatureResponse {
2746
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256k1ConstructSignatureResponse serialization"); }
2747
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256k1ConstructSignatureResponse serialization"); }
2748
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256k1ConstructSignatureResponse serialization"); };
2749
- return {
2750
- r: o.r,
2751
- s: o.s,
2752
- v: o.v,
2753
- };
2754
- }
2755
-
2756
- export function toEcdsaSecp256k1RecoverPublicKey(o: MsgpackEcdsaSecp256k1RecoverPublicKey): EcdsaSecp256k1RecoverPublicKey {
2757
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256k1RecoverPublicKey deserialization"); }
2758
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256k1RecoverPublicKey deserialization"); }
2759
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256k1RecoverPublicKey deserialization"); }
2760
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256k1RecoverPublicKey deserialization"); };
2761
- return {
2762
- message: o.message,
2763
- r: o.r,
2764
- s: o.s,
2765
- v: o.v,
2766
- };
2767
- }
2768
-
2769
- export function fromEcdsaSecp256k1RecoverPublicKey(o: EcdsaSecp256k1RecoverPublicKey): MsgpackEcdsaSecp256k1RecoverPublicKey {
2770
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256k1RecoverPublicKey serialization"); }
2771
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256k1RecoverPublicKey serialization"); }
2772
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256k1RecoverPublicKey serialization"); }
2773
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256k1RecoverPublicKey serialization"); };
2774
- return {
2775
- message: o.message,
2776
- r: o.r,
2777
- s: o.s,
2778
- v: o.v,
2779
- };
2780
- }
2781
-
2782
- export function toEcdsaSecp256k1RecoverPublicKeyResponse(o: MsgpackEcdsaSecp256k1RecoverPublicKeyResponse): EcdsaSecp256k1RecoverPublicKeyResponse {
2783
- if (o.public_key === undefined) { throw new Error("Expected public_key in EcdsaSecp256k1RecoverPublicKeyResponse deserialization"); };
2784
- return {
2785
- publicKey: toAffineElement(o.public_key),
2786
- };
2787
- }
2788
-
2789
- export function fromEcdsaSecp256k1RecoverPublicKeyResponse(o: EcdsaSecp256k1RecoverPublicKeyResponse): MsgpackEcdsaSecp256k1RecoverPublicKeyResponse {
2790
- if (o.publicKey === undefined) { throw new Error("Expected publicKey in EcdsaSecp256k1RecoverPublicKeyResponse serialization"); };
2791
- return {
2792
- public_key: fromAffineElement(o.publicKey),
2793
- };
2794
- }
2795
-
2796
- export function toEcdsaSecp256k1VerifySignature(o: MsgpackEcdsaSecp256k1VerifySignature): EcdsaSecp256k1VerifySignature {
2797
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256k1VerifySignature deserialization"); }
2798
- if (o.public_key === undefined) { throw new Error("Expected public_key in EcdsaSecp256k1VerifySignature deserialization"); }
2799
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256k1VerifySignature deserialization"); }
2800
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256k1VerifySignature deserialization"); }
2801
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256k1VerifySignature deserialization"); };
2802
- return {
2803
- message: o.message,
2804
- publicKey: toAffineElement(o.public_key),
2805
- r: o.r,
2806
- s: o.s,
2807
- v: o.v,
2808
- };
2809
- }
2810
-
2811
- export function fromEcdsaSecp256k1VerifySignature(o: EcdsaSecp256k1VerifySignature): MsgpackEcdsaSecp256k1VerifySignature {
2812
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256k1VerifySignature serialization"); }
2813
- if (o.publicKey === undefined) { throw new Error("Expected publicKey in EcdsaSecp256k1VerifySignature serialization"); }
2814
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256k1VerifySignature serialization"); }
2815
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256k1VerifySignature serialization"); }
2816
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256k1VerifySignature serialization"); };
2817
- return {
2818
- message: o.message,
2819
- public_key: fromAffineElement(o.publicKey),
2820
- r: o.r,
2821
- s: o.s,
2822
- v: o.v,
2823
- };
2824
- }
2825
-
2826
- export function toEcdsaSecp256k1VerifySignatureResponse(o: MsgpackEcdsaSecp256k1VerifySignatureResponse): EcdsaSecp256k1VerifySignatureResponse {
2827
- if (o.verified === undefined) { throw new Error("Expected verified in EcdsaSecp256k1VerifySignatureResponse deserialization"); };
2828
- return {
2829
- verified: o.verified,
2830
- };
2831
- }
2832
-
2833
- export function fromEcdsaSecp256k1VerifySignatureResponse(o: EcdsaSecp256k1VerifySignatureResponse): MsgpackEcdsaSecp256k1VerifySignatureResponse {
2834
- if (o.verified === undefined) { throw new Error("Expected verified in EcdsaSecp256k1VerifySignatureResponse serialization"); };
2835
- return {
2836
- verified: o.verified,
2837
- };
2838
- }
2839
-
2840
- export function toEcdsaSecp256r1ComputePublicKey(o: MsgpackEcdsaSecp256r1ComputePublicKey): EcdsaSecp256r1ComputePublicKey {
2841
- if (o.private_key === undefined) { throw new Error("Expected private_key in EcdsaSecp256r1ComputePublicKey deserialization"); };
2842
- return {
2843
- privateKey: o.private_key,
2844
- };
2845
- }
2846
-
2847
- export function fromEcdsaSecp256r1ComputePublicKey(o: EcdsaSecp256r1ComputePublicKey): MsgpackEcdsaSecp256r1ComputePublicKey {
2848
- if (o.privateKey === undefined) { throw new Error("Expected privateKey in EcdsaSecp256r1ComputePublicKey serialization"); };
2849
- return {
2850
- private_key: o.privateKey,
2851
- };
2852
- }
2853
-
2854
- export function toEcdsaSecp256r1ComputePublicKeyResponse(o: MsgpackEcdsaSecp256r1ComputePublicKeyResponse): EcdsaSecp256r1ComputePublicKeyResponse {
2855
- if (o.public_key === undefined) { throw new Error("Expected public_key in EcdsaSecp256r1ComputePublicKeyResponse deserialization"); };
2856
- return {
2857
- publicKey: toAffineElement(o.public_key),
2858
- };
2859
- }
2860
-
2861
- export function fromEcdsaSecp256r1ComputePublicKeyResponse(o: EcdsaSecp256r1ComputePublicKeyResponse): MsgpackEcdsaSecp256r1ComputePublicKeyResponse {
2862
- if (o.publicKey === undefined) { throw new Error("Expected publicKey in EcdsaSecp256r1ComputePublicKeyResponse serialization"); };
2863
- return {
2864
- public_key: fromAffineElement(o.publicKey),
2865
- };
2866
- }
2867
-
2868
- export function toEcdsaSecp256r1ConstructSignature(o: MsgpackEcdsaSecp256r1ConstructSignature): EcdsaSecp256r1ConstructSignature {
2869
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256r1ConstructSignature deserialization"); }
2870
- if (o.private_key === undefined) { throw new Error("Expected private_key in EcdsaSecp256r1ConstructSignature deserialization"); };
2871
- return {
2872
- message: o.message,
2873
- privateKey: o.private_key,
2874
- };
2875
- }
2876
-
2877
- export function fromEcdsaSecp256r1ConstructSignature(o: EcdsaSecp256r1ConstructSignature): MsgpackEcdsaSecp256r1ConstructSignature {
2878
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256r1ConstructSignature serialization"); }
2879
- if (o.privateKey === undefined) { throw new Error("Expected privateKey in EcdsaSecp256r1ConstructSignature serialization"); };
2880
- return {
2881
- message: o.message,
2882
- private_key: o.privateKey,
2883
- };
2884
- }
2885
-
2886
- export function toEcdsaSecp256r1ConstructSignatureResponse(o: MsgpackEcdsaSecp256r1ConstructSignatureResponse): EcdsaSecp256r1ConstructSignatureResponse {
2887
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256r1ConstructSignatureResponse deserialization"); }
2888
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256r1ConstructSignatureResponse deserialization"); }
2889
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256r1ConstructSignatureResponse deserialization"); };
2890
- return {
2891
- r: o.r,
2892
- s: o.s,
2893
- v: o.v,
2894
- };
2895
- }
2896
-
2897
- export function fromEcdsaSecp256r1ConstructSignatureResponse(o: EcdsaSecp256r1ConstructSignatureResponse): MsgpackEcdsaSecp256r1ConstructSignatureResponse {
2898
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256r1ConstructSignatureResponse serialization"); }
2899
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256r1ConstructSignatureResponse serialization"); }
2900
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256r1ConstructSignatureResponse serialization"); };
2901
- return {
2902
- r: o.r,
2903
- s: o.s,
2904
- v: o.v,
2905
- };
2906
- }
2907
-
2908
- export function toEcdsaSecp256r1RecoverPublicKey(o: MsgpackEcdsaSecp256r1RecoverPublicKey): EcdsaSecp256r1RecoverPublicKey {
2909
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256r1RecoverPublicKey deserialization"); }
2910
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256r1RecoverPublicKey deserialization"); }
2911
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256r1RecoverPublicKey deserialization"); }
2912
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256r1RecoverPublicKey deserialization"); };
2913
- return {
2914
- message: o.message,
2915
- r: o.r,
2916
- s: o.s,
2917
- v: o.v,
2918
- };
2919
- }
2920
-
2921
- export function fromEcdsaSecp256r1RecoverPublicKey(o: EcdsaSecp256r1RecoverPublicKey): MsgpackEcdsaSecp256r1RecoverPublicKey {
2922
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256r1RecoverPublicKey serialization"); }
2923
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256r1RecoverPublicKey serialization"); }
2924
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256r1RecoverPublicKey serialization"); }
2925
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256r1RecoverPublicKey serialization"); };
2926
- return {
2927
- message: o.message,
2928
- r: o.r,
2929
- s: o.s,
2930
- v: o.v,
2931
- };
2932
- }
2933
-
2934
- export function toEcdsaSecp256r1RecoverPublicKeyResponse(o: MsgpackEcdsaSecp256r1RecoverPublicKeyResponse): EcdsaSecp256r1RecoverPublicKeyResponse {
2935
- if (o.public_key === undefined) { throw new Error("Expected public_key in EcdsaSecp256r1RecoverPublicKeyResponse deserialization"); };
2936
- return {
2937
- publicKey: toAffineElement(o.public_key),
2938
- };
2939
- }
2940
-
2941
- export function fromEcdsaSecp256r1RecoverPublicKeyResponse(o: EcdsaSecp256r1RecoverPublicKeyResponse): MsgpackEcdsaSecp256r1RecoverPublicKeyResponse {
2942
- if (o.publicKey === undefined) { throw new Error("Expected publicKey in EcdsaSecp256r1RecoverPublicKeyResponse serialization"); };
2943
- return {
2944
- public_key: fromAffineElement(o.publicKey),
2945
- };
2946
- }
2947
-
2948
- export function toEcdsaSecp256r1VerifySignature(o: MsgpackEcdsaSecp256r1VerifySignature): EcdsaSecp256r1VerifySignature {
2949
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256r1VerifySignature deserialization"); }
2950
- if (o.public_key === undefined) { throw new Error("Expected public_key in EcdsaSecp256r1VerifySignature deserialization"); }
2951
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256r1VerifySignature deserialization"); }
2952
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256r1VerifySignature deserialization"); }
2953
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256r1VerifySignature deserialization"); };
2954
- return {
2955
- message: o.message,
2956
- publicKey: toAffineElement(o.public_key),
2957
- r: o.r,
2958
- s: o.s,
2959
- v: o.v,
2960
- };
2961
- }
2962
-
2963
- export function fromEcdsaSecp256r1VerifySignature(o: EcdsaSecp256r1VerifySignature): MsgpackEcdsaSecp256r1VerifySignature {
2964
- if (o.message === undefined) { throw new Error("Expected message in EcdsaSecp256r1VerifySignature serialization"); }
2965
- if (o.publicKey === undefined) { throw new Error("Expected publicKey in EcdsaSecp256r1VerifySignature serialization"); }
2966
- if (o.r === undefined) { throw new Error("Expected r in EcdsaSecp256r1VerifySignature serialization"); }
2967
- if (o.s === undefined) { throw new Error("Expected s in EcdsaSecp256r1VerifySignature serialization"); }
2968
- if (o.v === undefined) { throw new Error("Expected v in EcdsaSecp256r1VerifySignature serialization"); };
2969
- return {
2970
- message: o.message,
2971
- public_key: fromAffineElement(o.publicKey),
2972
- r: o.r,
2973
- s: o.s,
2974
- v: o.v,
2975
- };
2976
- }
2977
-
2978
- export function toEcdsaSecp256r1VerifySignatureResponse(o: MsgpackEcdsaSecp256r1VerifySignatureResponse): EcdsaSecp256r1VerifySignatureResponse {
2979
- if (o.verified === undefined) { throw new Error("Expected verified in EcdsaSecp256r1VerifySignatureResponse deserialization"); };
2980
- return {
2981
- verified: o.verified,
2982
- };
2983
- }
2984
-
2985
- export function fromEcdsaSecp256r1VerifySignatureResponse(o: EcdsaSecp256r1VerifySignatureResponse): MsgpackEcdsaSecp256r1VerifySignatureResponse {
2986
- if (o.verified === undefined) { throw new Error("Expected verified in EcdsaSecp256r1VerifySignatureResponse serialization"); };
2987
- return {
2988
- verified: o.verified,
2989
- };
2990
- }
2991
-
2992
- export function toGoblinProof(o: MsgpackGoblinProof): GoblinProof {
2993
- if (o.merge_proof === undefined) { throw new Error("Expected merge_proof in GoblinProof deserialization"); }
2994
- if (o.eccvm_proof === undefined) { throw new Error("Expected eccvm_proof in GoblinProof deserialization"); }
2995
- if (o.translator_proof === undefined) { throw new Error("Expected translator_proof in GoblinProof deserialization"); };
2996
- return {
2997
- mergeProof: o.merge_proof.map((v: any) => v),
2998
- eccvmProof: toECCVMProof(o.eccvm_proof),
2999
- translatorProof: o.translator_proof.map((v: any) => v),
3000
- };
3001
- }
3002
-
3003
- export function fromGoblinProof(o: GoblinProof): MsgpackGoblinProof {
3004
- if (o.mergeProof === undefined) { throw new Error("Expected mergeProof in GoblinProof serialization"); }
3005
- if (o.eccvmProof === undefined) { throw new Error("Expected eccvmProof in GoblinProof serialization"); }
3006
- if (o.translatorProof === undefined) { throw new Error("Expected translatorProof in GoblinProof serialization"); };
3007
- return {
3008
- merge_proof: o.mergeProof.map((v: any) => v),
3009
- eccvm_proof: fromECCVMProof(o.eccvmProof),
3010
- translator_proof: o.translatorProof.map((v: any) => v),
3011
- };
3012
- }
3013
-
3014
- export function toGrumpkinAdd(o: MsgpackGrumpkinAdd): GrumpkinAdd {
3015
- if (o.point_a === undefined) { throw new Error("Expected point_a in GrumpkinAdd deserialization"); }
3016
- if (o.point_b === undefined) { throw new Error("Expected point_b in GrumpkinAdd deserialization"); };
3017
- return {
3018
- pointA: toAffineElement(o.point_a),
3019
- pointB: toAffineElement(o.point_b),
3020
- };
3021
- }
3022
-
3023
- export function fromGrumpkinAdd(o: GrumpkinAdd): MsgpackGrumpkinAdd {
3024
- if (o.pointA === undefined) { throw new Error("Expected pointA in GrumpkinAdd serialization"); }
3025
- if (o.pointB === undefined) { throw new Error("Expected pointB in GrumpkinAdd serialization"); };
3026
- return {
3027
- point_a: fromAffineElement(o.pointA),
3028
- point_b: fromAffineElement(o.pointB),
3029
- };
3030
- }
3031
-
3032
- export function toGrumpkinAddResponse(o: MsgpackGrumpkinAddResponse): GrumpkinAddResponse {
3033
- if (o.point === undefined) { throw new Error("Expected point in GrumpkinAddResponse deserialization"); };
3034
- return {
3035
- point: toAffineElement(o.point),
3036
- };
3037
- }
3038
-
3039
- export function fromGrumpkinAddResponse(o: GrumpkinAddResponse): MsgpackGrumpkinAddResponse {
3040
- if (o.point === undefined) { throw new Error("Expected point in GrumpkinAddResponse serialization"); };
3041
- return {
3042
- point: fromAffineElement(o.point),
3043
- };
3044
- }
3045
-
3046
- export function toGrumpkinBatchMul(o: MsgpackGrumpkinBatchMul): GrumpkinBatchMul {
3047
- if (o.points === undefined) { throw new Error("Expected points in GrumpkinBatchMul deserialization"); }
3048
- if (o.scalar === undefined) { throw new Error("Expected scalar in GrumpkinBatchMul deserialization"); };
3049
- return {
3050
- points: o.points.map((v: any) => v),
3051
- scalar: o.scalar,
3052
- };
3053
- }
3054
-
3055
- export function fromGrumpkinBatchMul(o: GrumpkinBatchMul): MsgpackGrumpkinBatchMul {
3056
- if (o.points === undefined) { throw new Error("Expected points in GrumpkinBatchMul serialization"); }
3057
- if (o.scalar === undefined) { throw new Error("Expected scalar in GrumpkinBatchMul serialization"); };
3058
- return {
3059
- points: o.points.map((v: any) => v),
3060
- scalar: o.scalar,
3061
- };
3062
- }
3063
-
3064
- export function toGrumpkinBatchMulResponse(o: MsgpackGrumpkinBatchMulResponse): GrumpkinBatchMulResponse {
3065
- if (o.points === undefined) { throw new Error("Expected points in GrumpkinBatchMulResponse deserialization"); };
3066
- return {
3067
- points: o.points.map((v: any) => v),
3068
- };
3069
- }
3070
-
3071
- export function fromGrumpkinBatchMulResponse(o: GrumpkinBatchMulResponse): MsgpackGrumpkinBatchMulResponse {
3072
- if (o.points === undefined) { throw new Error("Expected points in GrumpkinBatchMulResponse serialization"); };
3073
- return {
3074
- points: o.points.map((v: any) => v),
3075
- };
3076
- }
3077
-
3078
- export function toGrumpkinGetRandomFr(o: MsgpackGrumpkinGetRandomFr): GrumpkinGetRandomFr {
3079
- if (o.dummy === undefined) { throw new Error("Expected dummy in GrumpkinGetRandomFr deserialization"); };
3080
- return {
3081
- dummy: o.dummy,
3082
- };
3083
- }
3084
-
3085
- export function fromGrumpkinGetRandomFr(o: GrumpkinGetRandomFr): MsgpackGrumpkinGetRandomFr {
3086
- if (o.dummy === undefined) { throw new Error("Expected dummy in GrumpkinGetRandomFr serialization"); };
3087
- return {
3088
- dummy: o.dummy,
3089
- };
3090
- }
3091
-
3092
- export function toGrumpkinGetRandomFrResponse(o: MsgpackGrumpkinGetRandomFrResponse): GrumpkinGetRandomFrResponse {
3093
- if (o.value === undefined) { throw new Error("Expected value in GrumpkinGetRandomFrResponse deserialization"); };
3094
- return {
3095
- value: o.value,
3096
- };
3097
- }
3098
-
3099
- export function fromGrumpkinGetRandomFrResponse(o: GrumpkinGetRandomFrResponse): MsgpackGrumpkinGetRandomFrResponse {
3100
- if (o.value === undefined) { throw new Error("Expected value in GrumpkinGetRandomFrResponse serialization"); };
3101
- return {
3102
- value: o.value,
3103
- };
3104
- }
3105
-
3106
- export function toGrumpkinMul(o: MsgpackGrumpkinMul): GrumpkinMul {
3107
- if (o.point === undefined) { throw new Error("Expected point in GrumpkinMul deserialization"); }
3108
- if (o.scalar === undefined) { throw new Error("Expected scalar in GrumpkinMul deserialization"); };
3109
- return {
3110
- point: toAffineElement(o.point),
3111
- scalar: o.scalar,
3112
- };
3113
- }
3114
-
3115
- export function fromGrumpkinMul(o: GrumpkinMul): MsgpackGrumpkinMul {
3116
- if (o.point === undefined) { throw new Error("Expected point in GrumpkinMul serialization"); }
3117
- if (o.scalar === undefined) { throw new Error("Expected scalar in GrumpkinMul serialization"); };
3118
- return {
3119
- point: fromAffineElement(o.point),
3120
- scalar: o.scalar,
3121
- };
3122
- }
3123
-
3124
- export function toGrumpkinMulResponse(o: MsgpackGrumpkinMulResponse): GrumpkinMulResponse {
3125
- if (o.point === undefined) { throw new Error("Expected point in GrumpkinMulResponse deserialization"); };
3126
- return {
3127
- point: toAffineElement(o.point),
3128
- };
3129
- }
3130
-
3131
- export function fromGrumpkinMulResponse(o: GrumpkinMulResponse): MsgpackGrumpkinMulResponse {
3132
- if (o.point === undefined) { throw new Error("Expected point in GrumpkinMulResponse serialization"); };
3133
- return {
3134
- point: fromAffineElement(o.point),
3135
- };
3136
- }
3137
-
3138
- export function toGrumpkinReduce512(o: MsgpackGrumpkinReduce512): GrumpkinReduce512 {
3139
- if (o.input === undefined) { throw new Error("Expected input in GrumpkinReduce512 deserialization"); };
3140
- return {
3141
- input: o.input,
3142
- };
3143
- }
3144
-
3145
- export function fromGrumpkinReduce512(o: GrumpkinReduce512): MsgpackGrumpkinReduce512 {
3146
- if (o.input === undefined) { throw new Error("Expected input in GrumpkinReduce512 serialization"); };
3147
- return {
3148
- input: o.input,
3149
- };
3150
- }
3151
-
3152
- export function toGrumpkinReduce512Response(o: MsgpackGrumpkinReduce512Response): GrumpkinReduce512Response {
3153
- if (o.value === undefined) { throw new Error("Expected value in GrumpkinReduce512Response deserialization"); };
3154
- return {
3155
- value: o.value,
3156
- };
3157
- }
3158
-
3159
- export function fromGrumpkinReduce512Response(o: GrumpkinReduce512Response): MsgpackGrumpkinReduce512Response {
3160
- if (o.value === undefined) { throw new Error("Expected value in GrumpkinReduce512Response serialization"); };
3161
- return {
3162
- value: o.value,
3163
- };
3164
- }
3165
-
3166
- export function toMegaVkAsFields(o: MsgpackMegaVkAsFields): MegaVkAsFields {
3167
- if (o.verification_key === undefined) { throw new Error("Expected verification_key in MegaVkAsFields deserialization"); };
3168
- return {
3169
- verificationKey: o.verification_key,
3170
- };
3171
- }
3172
-
3173
- export function fromMegaVkAsFields(o: MegaVkAsFields): MsgpackMegaVkAsFields {
3174
- if (o.verificationKey === undefined) { throw new Error("Expected verificationKey in MegaVkAsFields serialization"); };
3175
- return {
3176
- verification_key: o.verificationKey,
3177
- };
3178
- }
3179
-
3180
- export function toMegaVkAsFieldsResponse(o: MsgpackMegaVkAsFieldsResponse): MegaVkAsFieldsResponse {
3181
- if (o.fields === undefined) { throw new Error("Expected fields in MegaVkAsFieldsResponse deserialization"); };
3182
- return {
3183
- fields: o.fields.map((v: any) => v),
3184
- };
3185
- }
3186
-
3187
- export function fromMegaVkAsFieldsResponse(o: MegaVkAsFieldsResponse): MsgpackMegaVkAsFieldsResponse {
3188
- if (o.fields === undefined) { throw new Error("Expected fields in MegaVkAsFieldsResponse serialization"); };
3189
- return {
3190
- fields: o.fields.map((v: any) => v),
3191
- };
3192
- }
3193
-
3194
- export function toPedersenCommit(o: MsgpackPedersenCommit): PedersenCommit {
3195
- if (o.inputs === undefined) { throw new Error("Expected inputs in PedersenCommit deserialization"); }
3196
- if (o.hash_index === undefined) { throw new Error("Expected hash_index in PedersenCommit deserialization"); };
3197
- return {
3198
- inputs: o.inputs.map((v: any) => v),
3199
- hashIndex: o.hash_index,
3200
- };
3201
- }
3202
-
3203
- export function fromPedersenCommit(o: PedersenCommit): MsgpackPedersenCommit {
3204
- if (o.inputs === undefined) { throw new Error("Expected inputs in PedersenCommit serialization"); }
3205
- if (o.hashIndex === undefined) { throw new Error("Expected hashIndex in PedersenCommit serialization"); };
3206
- return {
3207
- inputs: o.inputs.map((v: any) => v),
3208
- hash_index: o.hashIndex,
3209
- };
3210
- }
3211
-
3212
- export function toPedersenCommitResponse(o: MsgpackPedersenCommitResponse): PedersenCommitResponse {
3213
- if (o.point === undefined) { throw new Error("Expected point in PedersenCommitResponse deserialization"); };
3214
- return {
3215
- point: toAffineElement(o.point),
3216
- };
3217
- }
3218
-
3219
- export function fromPedersenCommitResponse(o: PedersenCommitResponse): MsgpackPedersenCommitResponse {
3220
- if (o.point === undefined) { throw new Error("Expected point in PedersenCommitResponse serialization"); };
3221
- return {
3222
- point: fromAffineElement(o.point),
3223
- };
3224
- }
3225
-
3226
- export function toPedersenHash(o: MsgpackPedersenHash): PedersenHash {
3227
- if (o.inputs === undefined) { throw new Error("Expected inputs in PedersenHash deserialization"); }
3228
- if (o.hash_index === undefined) { throw new Error("Expected hash_index in PedersenHash deserialization"); };
3229
- return {
3230
- inputs: o.inputs.map((v: any) => v),
3231
- hashIndex: o.hash_index,
3232
- };
3233
- }
3234
-
3235
- export function fromPedersenHash(o: PedersenHash): MsgpackPedersenHash {
3236
- if (o.inputs === undefined) { throw new Error("Expected inputs in PedersenHash serialization"); }
3237
- if (o.hashIndex === undefined) { throw new Error("Expected hashIndex in PedersenHash serialization"); };
3238
- return {
3239
- inputs: o.inputs.map((v: any) => v),
3240
- hash_index: o.hashIndex,
3241
- };
3242
- }
3243
-
3244
- export function toPedersenHashBuffer(o: MsgpackPedersenHashBuffer): PedersenHashBuffer {
3245
- if (o.input === undefined) { throw new Error("Expected input in PedersenHashBuffer deserialization"); }
3246
- if (o.hash_index === undefined) { throw new Error("Expected hash_index in PedersenHashBuffer deserialization"); };
3247
- return {
3248
- input: o.input,
3249
- hashIndex: o.hash_index,
3250
- };
3251
- }
3252
-
3253
- export function fromPedersenHashBuffer(o: PedersenHashBuffer): MsgpackPedersenHashBuffer {
3254
- if (o.input === undefined) { throw new Error("Expected input in PedersenHashBuffer serialization"); }
3255
- if (o.hashIndex === undefined) { throw new Error("Expected hashIndex in PedersenHashBuffer serialization"); };
3256
- return {
3257
- input: o.input,
3258
- hash_index: o.hashIndex,
3259
- };
3260
- }
3261
-
3262
- export function toPedersenHashBufferResponse(o: MsgpackPedersenHashBufferResponse): PedersenHashBufferResponse {
3263
- if (o.hash === undefined) { throw new Error("Expected hash in PedersenHashBufferResponse deserialization"); };
3264
- return {
3265
- hash: o.hash,
3266
- };
3267
- }
3268
-
3269
- export function fromPedersenHashBufferResponse(o: PedersenHashBufferResponse): MsgpackPedersenHashBufferResponse {
3270
- if (o.hash === undefined) { throw new Error("Expected hash in PedersenHashBufferResponse serialization"); };
3271
- return {
3272
- hash: o.hash,
3273
- };
3274
- }
3275
-
3276
- export function toPedersenHashResponse(o: MsgpackPedersenHashResponse): PedersenHashResponse {
3277
- if (o.hash === undefined) { throw new Error("Expected hash in PedersenHashResponse deserialization"); };
3278
- return {
3279
- hash: o.hash,
3280
- };
3281
- }
3282
-
3283
- export function fromPedersenHashResponse(o: PedersenHashResponse): MsgpackPedersenHashResponse {
3284
- if (o.hash === undefined) { throw new Error("Expected hash in PedersenHashResponse serialization"); };
3285
- return {
3286
- hash: o.hash,
3287
- };
3288
- }
3289
-
3290
- export function toPoseidon2Hash(o: MsgpackPoseidon2Hash): Poseidon2Hash {
3291
- if (o.inputs === undefined) { throw new Error("Expected inputs in Poseidon2Hash deserialization"); };
3292
- return {
3293
- inputs: o.inputs.map((v: any) => v),
3294
- };
3295
- }
3296
-
3297
- export function fromPoseidon2Hash(o: Poseidon2Hash): MsgpackPoseidon2Hash {
3298
- if (o.inputs === undefined) { throw new Error("Expected inputs in Poseidon2Hash serialization"); };
3299
- return {
3300
- inputs: o.inputs.map((v: any) => v),
3301
- };
3302
- }
3303
-
3304
- export function toPoseidon2HashAccumulate(o: MsgpackPoseidon2HashAccumulate): Poseidon2HashAccumulate {
3305
- if (o.inputs === undefined) { throw new Error("Expected inputs in Poseidon2HashAccumulate deserialization"); };
3306
- return {
3307
- inputs: o.inputs.map((v: any) => v),
3308
- };
3309
- }
3310
-
3311
- export function fromPoseidon2HashAccumulate(o: Poseidon2HashAccumulate): MsgpackPoseidon2HashAccumulate {
3312
- if (o.inputs === undefined) { throw new Error("Expected inputs in Poseidon2HashAccumulate serialization"); };
3313
- return {
3314
- inputs: o.inputs.map((v: any) => v),
3315
- };
3316
- }
3317
-
3318
- export function toPoseidon2HashAccumulateResponse(o: MsgpackPoseidon2HashAccumulateResponse): Poseidon2HashAccumulateResponse {
3319
- if (o.hash === undefined) { throw new Error("Expected hash in Poseidon2HashAccumulateResponse deserialization"); };
3320
- return {
3321
- hash: o.hash,
3322
- };
3323
- }
3324
-
3325
- export function fromPoseidon2HashAccumulateResponse(o: Poseidon2HashAccumulateResponse): MsgpackPoseidon2HashAccumulateResponse {
3326
- if (o.hash === undefined) { throw new Error("Expected hash in Poseidon2HashAccumulateResponse serialization"); };
3327
- return {
3328
- hash: o.hash,
3329
- };
3330
- }
3331
-
3332
- export function toPoseidon2HashResponse(o: MsgpackPoseidon2HashResponse): Poseidon2HashResponse {
3333
- if (o.hash === undefined) { throw new Error("Expected hash in Poseidon2HashResponse deserialization"); };
3334
- return {
3335
- hash: o.hash,
3336
- };
3337
- }
3338
-
3339
- export function fromPoseidon2HashResponse(o: Poseidon2HashResponse): MsgpackPoseidon2HashResponse {
3340
- if (o.hash === undefined) { throw new Error("Expected hash in Poseidon2HashResponse serialization"); };
3341
- return {
3342
- hash: o.hash,
3343
- };
3344
- }
3345
-
3346
- export function toPoseidon2Permutation(o: MsgpackPoseidon2Permutation): Poseidon2Permutation {
3347
- if (o.inputs === undefined) { throw new Error("Expected inputs in Poseidon2Permutation deserialization"); };
3348
- return {
3349
- inputs: o.inputs.map((v: any) => v),
3350
- };
3351
- }
3352
-
3353
- export function fromPoseidon2Permutation(o: Poseidon2Permutation): MsgpackPoseidon2Permutation {
3354
- if (o.inputs === undefined) { throw new Error("Expected inputs in Poseidon2Permutation serialization"); };
3355
- return {
3356
- inputs: o.inputs.map((v: any) => v),
3357
- };
3358
- }
3359
-
3360
- export function toPoseidon2PermutationResponse(o: MsgpackPoseidon2PermutationResponse): Poseidon2PermutationResponse {
3361
- if (o.outputs === undefined) { throw new Error("Expected outputs in Poseidon2PermutationResponse deserialization"); };
3362
- return {
3363
- outputs: o.outputs.map((v: any) => v),
3364
- };
3365
- }
3366
-
3367
- export function fromPoseidon2PermutationResponse(o: Poseidon2PermutationResponse): MsgpackPoseidon2PermutationResponse {
3368
- if (o.outputs === undefined) { throw new Error("Expected outputs in Poseidon2PermutationResponse serialization"); };
3369
- return {
3370
- outputs: o.outputs.map((v: any) => v),
3371
- };
3372
- }
3373
-
3374
- export function toProofSystemSettings(o: MsgpackProofSystemSettings): ProofSystemSettings {
3375
- if (o.ipa_accumulation === undefined) { throw new Error("Expected ipa_accumulation in ProofSystemSettings deserialization"); }
3376
- if (o.oracle_hash_type === undefined) { throw new Error("Expected oracle_hash_type in ProofSystemSettings deserialization"); }
3377
- if (o.disable_zk === undefined) { throw new Error("Expected disable_zk in ProofSystemSettings deserialization"); }
3378
- if (o.optimized_solidity_verifier === undefined) { throw new Error("Expected optimized_solidity_verifier in ProofSystemSettings deserialization"); };
3379
- return {
3380
- ipaAccumulation: o.ipa_accumulation,
3381
- oracleHashType: o.oracle_hash_type,
3382
- disableZk: o.disable_zk,
3383
- optimizedSolidityVerifier: o.optimized_solidity_verifier,
3384
- };
3385
- }
3386
-
3387
- export function fromProofSystemSettings(o: ProofSystemSettings): MsgpackProofSystemSettings {
3388
- if (o.ipaAccumulation === undefined) { throw new Error("Expected ipaAccumulation in ProofSystemSettings serialization"); }
3389
- if (o.oracleHashType === undefined) { throw new Error("Expected oracleHashType in ProofSystemSettings serialization"); }
3390
- if (o.disableZk === undefined) { throw new Error("Expected disableZk in ProofSystemSettings serialization"); }
3391
- if (o.optimizedSolidityVerifier === undefined) { throw new Error("Expected optimizedSolidityVerifier in ProofSystemSettings serialization"); };
3392
- return {
3393
- ipa_accumulation: o.ipaAccumulation,
3394
- oracle_hash_type: o.oracleHashType,
3395
- disable_zk: o.disableZk,
3396
- optimized_solidity_verifier: o.optimizedSolidityVerifier,
3397
- };
3398
- }
3399
-
3400
- export function toSchnorrComputePublicKey(o: MsgpackSchnorrComputePublicKey): SchnorrComputePublicKey {
3401
- if (o.private_key === undefined) { throw new Error("Expected private_key in SchnorrComputePublicKey deserialization"); };
3402
- return {
3403
- privateKey: o.private_key,
3404
- };
3405
- }
3406
-
3407
- export function fromSchnorrComputePublicKey(o: SchnorrComputePublicKey): MsgpackSchnorrComputePublicKey {
3408
- if (o.privateKey === undefined) { throw new Error("Expected privateKey in SchnorrComputePublicKey serialization"); };
3409
- return {
3410
- private_key: o.privateKey,
3411
- };
3412
- }
3413
-
3414
- export function toSchnorrComputePublicKeyResponse(o: MsgpackSchnorrComputePublicKeyResponse): SchnorrComputePublicKeyResponse {
3415
- if (o.public_key === undefined) { throw new Error("Expected public_key in SchnorrComputePublicKeyResponse deserialization"); };
3416
- return {
3417
- publicKey: toAffineElement(o.public_key),
3418
- };
3419
- }
3420
-
3421
- export function fromSchnorrComputePublicKeyResponse(o: SchnorrComputePublicKeyResponse): MsgpackSchnorrComputePublicKeyResponse {
3422
- if (o.publicKey === undefined) { throw new Error("Expected publicKey in SchnorrComputePublicKeyResponse serialization"); };
3423
- return {
3424
- public_key: fromAffineElement(o.publicKey),
3425
- };
3426
- }
3427
-
3428
- export function toSchnorrConstructSignature(o: MsgpackSchnorrConstructSignature): SchnorrConstructSignature {
3429
- if (o.message === undefined) { throw new Error("Expected message in SchnorrConstructSignature deserialization"); }
3430
- if (o.private_key === undefined) { throw new Error("Expected private_key in SchnorrConstructSignature deserialization"); };
3431
- return {
3432
- message: o.message,
3433
- privateKey: o.private_key,
3434
- };
3435
- }
3436
-
3437
- export function fromSchnorrConstructSignature(o: SchnorrConstructSignature): MsgpackSchnorrConstructSignature {
3438
- if (o.message === undefined) { throw new Error("Expected message in SchnorrConstructSignature serialization"); }
3439
- if (o.privateKey === undefined) { throw new Error("Expected privateKey in SchnorrConstructSignature serialization"); };
3440
- return {
3441
- message: o.message,
3442
- private_key: o.privateKey,
3443
- };
3444
- }
3445
-
3446
- export function toSchnorrConstructSignatureResponse(o: MsgpackSchnorrConstructSignatureResponse): SchnorrConstructSignatureResponse {
3447
- if (o.s === undefined) { throw new Error("Expected s in SchnorrConstructSignatureResponse deserialization"); }
3448
- if (o.e === undefined) { throw new Error("Expected e in SchnorrConstructSignatureResponse deserialization"); };
3449
- return {
3450
- s: o.s,
3451
- e: o.e,
3452
- };
3453
- }
3454
-
3455
- export function fromSchnorrConstructSignatureResponse(o: SchnorrConstructSignatureResponse): MsgpackSchnorrConstructSignatureResponse {
3456
- if (o.s === undefined) { throw new Error("Expected s in SchnorrConstructSignatureResponse serialization"); }
3457
- if (o.e === undefined) { throw new Error("Expected e in SchnorrConstructSignatureResponse serialization"); };
3458
- return {
3459
- s: o.s,
3460
- e: o.e,
3461
- };
3462
- }
3463
-
3464
- export function toSchnorrVerifySignature(o: MsgpackSchnorrVerifySignature): SchnorrVerifySignature {
3465
- if (o.message === undefined) { throw new Error("Expected message in SchnorrVerifySignature deserialization"); }
3466
- if (o.public_key === undefined) { throw new Error("Expected public_key in SchnorrVerifySignature deserialization"); }
3467
- if (o.s === undefined) { throw new Error("Expected s in SchnorrVerifySignature deserialization"); }
3468
- if (o.e === undefined) { throw new Error("Expected e in SchnorrVerifySignature deserialization"); };
3469
- return {
3470
- message: o.message,
3471
- publicKey: toAffineElement(o.public_key),
3472
- s: o.s,
3473
- e: o.e,
3474
- };
3475
- }
3476
-
3477
- export function fromSchnorrVerifySignature(o: SchnorrVerifySignature): MsgpackSchnorrVerifySignature {
3478
- if (o.message === undefined) { throw new Error("Expected message in SchnorrVerifySignature serialization"); }
3479
- if (o.publicKey === undefined) { throw new Error("Expected publicKey in SchnorrVerifySignature serialization"); }
3480
- if (o.s === undefined) { throw new Error("Expected s in SchnorrVerifySignature serialization"); }
3481
- if (o.e === undefined) { throw new Error("Expected e in SchnorrVerifySignature serialization"); };
3482
- return {
3483
- message: o.message,
3484
- public_key: fromAffineElement(o.publicKey),
3485
- s: o.s,
3486
- e: o.e,
3487
- };
3488
- }
3489
-
3490
- export function toSchnorrVerifySignatureResponse(o: MsgpackSchnorrVerifySignatureResponse): SchnorrVerifySignatureResponse {
3491
- if (o.verified === undefined) { throw new Error("Expected verified in SchnorrVerifySignatureResponse deserialization"); };
3492
- return {
3493
- verified: o.verified,
3494
- };
3495
- }
3496
-
3497
- export function fromSchnorrVerifySignatureResponse(o: SchnorrVerifySignatureResponse): MsgpackSchnorrVerifySignatureResponse {
3498
- if (o.verified === undefined) { throw new Error("Expected verified in SchnorrVerifySignatureResponse serialization"); };
3499
- return {
3500
- verified: o.verified,
3501
- };
3502
- }
3503
-
3504
- export function toSecp256k1GetRandomFr(o: MsgpackSecp256k1GetRandomFr): Secp256k1GetRandomFr {
3505
- if (o.dummy === undefined) { throw new Error("Expected dummy in Secp256k1GetRandomFr deserialization"); };
3506
- return {
3507
- dummy: o.dummy,
3508
- };
3509
- }
3510
-
3511
- export function fromSecp256k1GetRandomFr(o: Secp256k1GetRandomFr): MsgpackSecp256k1GetRandomFr {
3512
- if (o.dummy === undefined) { throw new Error("Expected dummy in Secp256k1GetRandomFr serialization"); };
3513
- return {
3514
- dummy: o.dummy,
3515
- };
3516
- }
3517
-
3518
- export function toSecp256k1GetRandomFrResponse(o: MsgpackSecp256k1GetRandomFrResponse): Secp256k1GetRandomFrResponse {
3519
- if (o.value === undefined) { throw new Error("Expected value in Secp256k1GetRandomFrResponse deserialization"); };
3520
- return {
3521
- value: o.value,
3522
- };
3523
- }
3524
-
3525
- export function fromSecp256k1GetRandomFrResponse(o: Secp256k1GetRandomFrResponse): MsgpackSecp256k1GetRandomFrResponse {
3526
- if (o.value === undefined) { throw new Error("Expected value in Secp256k1GetRandomFrResponse serialization"); };
3527
- return {
3528
- value: o.value,
3529
- };
3530
- }
3531
-
3532
- export function toSecp256k1Mul(o: MsgpackSecp256k1Mul): Secp256k1Mul {
3533
- if (o.point === undefined) { throw new Error("Expected point in Secp256k1Mul deserialization"); }
3534
- if (o.scalar === undefined) { throw new Error("Expected scalar in Secp256k1Mul deserialization"); };
3535
- return {
3536
- point: toAffineElement(o.point),
3537
- scalar: o.scalar,
3538
- };
3539
- }
3540
-
3541
- export function fromSecp256k1Mul(o: Secp256k1Mul): MsgpackSecp256k1Mul {
3542
- if (o.point === undefined) { throw new Error("Expected point in Secp256k1Mul serialization"); }
3543
- if (o.scalar === undefined) { throw new Error("Expected scalar in Secp256k1Mul serialization"); };
3544
- return {
3545
- point: fromAffineElement(o.point),
3546
- scalar: o.scalar,
3547
- };
3548
- }
3549
-
3550
- export function toSecp256k1MulResponse(o: MsgpackSecp256k1MulResponse): Secp256k1MulResponse {
3551
- if (o.point === undefined) { throw new Error("Expected point in Secp256k1MulResponse deserialization"); };
3552
- return {
3553
- point: toAffineElement(o.point),
3554
- };
3555
- }
3556
-
3557
- export function fromSecp256k1MulResponse(o: Secp256k1MulResponse): MsgpackSecp256k1MulResponse {
3558
- if (o.point === undefined) { throw new Error("Expected point in Secp256k1MulResponse serialization"); };
3559
- return {
3560
- point: fromAffineElement(o.point),
3561
- };
3562
- }
3563
-
3564
- export function toSecp256k1Reduce512(o: MsgpackSecp256k1Reduce512): Secp256k1Reduce512 {
3565
- if (o.input === undefined) { throw new Error("Expected input in Secp256k1Reduce512 deserialization"); };
3566
- return {
3567
- input: o.input,
3568
- };
3569
- }
3570
-
3571
- export function fromSecp256k1Reduce512(o: Secp256k1Reduce512): MsgpackSecp256k1Reduce512 {
3572
- if (o.input === undefined) { throw new Error("Expected input in Secp256k1Reduce512 serialization"); };
3573
- return {
3574
- input: o.input,
3575
- };
3576
- }
3577
-
3578
- export function toSecp256k1Reduce512Response(o: MsgpackSecp256k1Reduce512Response): Secp256k1Reduce512Response {
3579
- if (o.value === undefined) { throw new Error("Expected value in Secp256k1Reduce512Response deserialization"); };
3580
- return {
3581
- value: o.value,
3582
- };
3583
- }
3584
-
3585
- export function fromSecp256k1Reduce512Response(o: Secp256k1Reduce512Response): MsgpackSecp256k1Reduce512Response {
3586
- if (o.value === undefined) { throw new Error("Expected value in Secp256k1Reduce512Response serialization"); };
3587
- return {
3588
- value: o.value,
3589
- };
3590
- }
3591
-
3592
- export function toShutdown(o: MsgpackShutdown): Shutdown {
3593
- return {};
3594
- }
3595
-
3596
- export function fromShutdown(o: Shutdown): MsgpackShutdown {
3597
- return {};
3598
- }
3599
-
3600
- export function toShutdownResponse(o: MsgpackShutdownResponse): ShutdownResponse {
3601
- return {};
3602
- }
3603
-
3604
- export function fromShutdownResponse(o: ShutdownResponse): MsgpackShutdownResponse {
3605
- return {};
3606
- }
3607
-
3608
- export function toSrsInitGrumpkinSrs(o: MsgpackSrsInitGrumpkinSrs): SrsInitGrumpkinSrs {
3609
- if (o.points_buf === undefined) { throw new Error("Expected points_buf in SrsInitGrumpkinSrs deserialization"); }
3610
- if (o.num_points === undefined) { throw new Error("Expected num_points in SrsInitGrumpkinSrs deserialization"); };
3611
- return {
3612
- pointsBuf: o.points_buf,
3613
- numPoints: o.num_points,
3614
- };
3615
- }
3616
-
3617
- export function fromSrsInitGrumpkinSrs(o: SrsInitGrumpkinSrs): MsgpackSrsInitGrumpkinSrs {
3618
- if (o.pointsBuf === undefined) { throw new Error("Expected pointsBuf in SrsInitGrumpkinSrs serialization"); }
3619
- if (o.numPoints === undefined) { throw new Error("Expected numPoints in SrsInitGrumpkinSrs serialization"); };
3620
- return {
3621
- points_buf: o.pointsBuf,
3622
- num_points: o.numPoints,
3623
- };
3624
- }
3625
-
3626
- export function toSrsInitGrumpkinSrsResponse(o: MsgpackSrsInitGrumpkinSrsResponse): SrsInitGrumpkinSrsResponse {
3627
- if (o.dummy === undefined) { throw new Error("Expected dummy in SrsInitGrumpkinSrsResponse deserialization"); };
3628
- return {
3629
- dummy: o.dummy,
3630
- };
3631
- }
3632
-
3633
- export function fromSrsInitGrumpkinSrsResponse(o: SrsInitGrumpkinSrsResponse): MsgpackSrsInitGrumpkinSrsResponse {
3634
- if (o.dummy === undefined) { throw new Error("Expected dummy in SrsInitGrumpkinSrsResponse serialization"); };
3635
- return {
3636
- dummy: o.dummy,
3637
- };
3638
- }
3639
-
3640
- export function toSrsInitSrs(o: MsgpackSrsInitSrs): SrsInitSrs {
3641
- if (o.points_buf === undefined) { throw new Error("Expected points_buf in SrsInitSrs deserialization"); }
3642
- if (o.num_points === undefined) { throw new Error("Expected num_points in SrsInitSrs deserialization"); }
3643
- if (o.g2_point === undefined) { throw new Error("Expected g2_point in SrsInitSrs deserialization"); };
3644
- return {
3645
- pointsBuf: o.points_buf,
3646
- numPoints: o.num_points,
3647
- g2Point: o.g2_point,
3648
- };
3649
- }
3650
-
3651
- export function fromSrsInitSrs(o: SrsInitSrs): MsgpackSrsInitSrs {
3652
- if (o.pointsBuf === undefined) { throw new Error("Expected pointsBuf in SrsInitSrs serialization"); }
3653
- if (o.numPoints === undefined) { throw new Error("Expected numPoints in SrsInitSrs serialization"); }
3654
- if (o.g2Point === undefined) { throw new Error("Expected g2Point in SrsInitSrs serialization"); };
3655
- return {
3656
- points_buf: o.pointsBuf,
3657
- num_points: o.numPoints,
3658
- g2_point: o.g2Point,
3659
- };
3660
- }
3661
-
3662
- export function toSrsInitSrsResponse(o: MsgpackSrsInitSrsResponse): SrsInitSrsResponse {
3663
- if (o.dummy === undefined) { throw new Error("Expected dummy in SrsInitSrsResponse deserialization"); };
3664
- return {
3665
- dummy: o.dummy,
3666
- };
3667
- }
3668
-
3669
- export function fromSrsInitSrsResponse(o: SrsInitSrsResponse): MsgpackSrsInitSrsResponse {
3670
- if (o.dummy === undefined) { throw new Error("Expected dummy in SrsInitSrsResponse serialization"); };
3671
- return {
3672
- dummy: o.dummy,
3673
- };
3674
- }
3675
-
3676
- export function toVkAsFields(o: MsgpackVkAsFields): VkAsFields {
3677
- if (o.verification_key === undefined) { throw new Error("Expected verification_key in VkAsFields deserialization"); };
3678
- return {
3679
- verificationKey: o.verification_key,
3680
- };
3681
- }
3682
-
3683
- export function fromVkAsFields(o: VkAsFields): MsgpackVkAsFields {
3684
- if (o.verificationKey === undefined) { throw new Error("Expected verificationKey in VkAsFields serialization"); };
3685
- return {
3686
- verification_key: o.verificationKey,
3687
- };
3688
- }
3689
-
3690
- export function toVkAsFieldsResponse(o: MsgpackVkAsFieldsResponse): VkAsFieldsResponse {
3691
- if (o.fields === undefined) { throw new Error("Expected fields in VkAsFieldsResponse deserialization"); };
3692
- return {
3693
- fields: o.fields.map((v: any) => v),
3694
- };
3695
- }
3696
-
3697
- export function fromVkAsFieldsResponse(o: VkAsFieldsResponse): MsgpackVkAsFieldsResponse {
3698
- if (o.fields === undefined) { throw new Error("Expected fields in VkAsFieldsResponse serialization"); };
3699
- return {
3700
- fields: o.fields.map((v: any) => v),
3701
- };
3702
- }
3703
-
3704
-
3705
- // Base API interface
3706
- export interface BbApiBase {
3707
- circuitProve(command: CircuitProve): Promise<CircuitProveResponse>;
3708
- circuitComputeVk(command: CircuitComputeVk): Promise<CircuitComputeVkResponse>;
3709
- circuitStats(command: CircuitStats): Promise<CircuitInfoResponse>;
3710
- circuitVerify(command: CircuitVerify): Promise<CircuitVerifyResponse>;
3711
- clientIvcComputeStandaloneVk(command: ClientIvcComputeStandaloneVk): Promise<ClientIvcComputeStandaloneVkResponse>;
3712
- clientIvcComputeIvcVk(command: ClientIvcComputeIvcVk): Promise<ClientIvcComputeIvcVkResponse>;
3713
- clientIvcStart(command: ClientIvcStart): Promise<ClientIvcStartResponse>;
3714
- clientIvcLoad(command: ClientIvcLoad): Promise<ClientIvcLoadResponse>;
3715
- clientIvcAccumulate(command: ClientIvcAccumulate): Promise<ClientIvcAccumulateResponse>;
3716
- clientIvcProve(command: ClientIvcProve): Promise<ClientIvcProveResponse>;
3717
- clientIvcVerify(command: ClientIvcVerify): Promise<ClientIvcVerifyResponse>;
3718
- vkAsFields(command: VkAsFields): Promise<VkAsFieldsResponse>;
3719
- megaVkAsFields(command: MegaVkAsFields): Promise<MegaVkAsFieldsResponse>;
3720
- circuitWriteSolidityVerifier(command: CircuitWriteSolidityVerifier): Promise<CircuitWriteSolidityVerifierResponse>;
3721
- clientIvcCheckPrecomputedVk(command: ClientIvcCheckPrecomputedVk): Promise<ClientIvcCheckPrecomputedVkResponse>;
3722
- clientIvcStats(command: ClientIvcStats): Promise<ClientIvcStatsResponse>;
3723
- poseidon2Hash(command: Poseidon2Hash): Promise<Poseidon2HashResponse>;
3724
- poseidon2Permutation(command: Poseidon2Permutation): Promise<Poseidon2PermutationResponse>;
3725
- poseidon2HashAccumulate(command: Poseidon2HashAccumulate): Promise<Poseidon2HashAccumulateResponse>;
3726
- pedersenCommit(command: PedersenCommit): Promise<PedersenCommitResponse>;
3727
- pedersenHash(command: PedersenHash): Promise<PedersenHashResponse>;
3728
- pedersenHashBuffer(command: PedersenHashBuffer): Promise<PedersenHashBufferResponse>;
3729
- blake2s(command: Blake2s): Promise<Blake2sResponse>;
3730
- blake2sToField(command: Blake2sToField): Promise<Blake2sToFieldResponse>;
3731
- aesEncrypt(command: AesEncrypt): Promise<AesEncryptResponse>;
3732
- aesDecrypt(command: AesDecrypt): Promise<AesDecryptResponse>;
3733
- grumpkinMul(command: GrumpkinMul): Promise<GrumpkinMulResponse>;
3734
- grumpkinAdd(command: GrumpkinAdd): Promise<GrumpkinAddResponse>;
3735
- grumpkinBatchMul(command: GrumpkinBatchMul): Promise<GrumpkinBatchMulResponse>;
3736
- grumpkinGetRandomFr(command: GrumpkinGetRandomFr): Promise<GrumpkinGetRandomFrResponse>;
3737
- grumpkinReduce512(command: GrumpkinReduce512): Promise<GrumpkinReduce512Response>;
3738
- secp256k1Mul(command: Secp256k1Mul): Promise<Secp256k1MulResponse>;
3739
- secp256k1GetRandomFr(command: Secp256k1GetRandomFr): Promise<Secp256k1GetRandomFrResponse>;
3740
- secp256k1Reduce512(command: Secp256k1Reduce512): Promise<Secp256k1Reduce512Response>;
3741
- bn254FrSqrt(command: Bn254FrSqrt): Promise<Bn254FrSqrtResponse>;
3742
- schnorrComputePublicKey(command: SchnorrComputePublicKey): Promise<SchnorrComputePublicKeyResponse>;
3743
- schnorrConstructSignature(command: SchnorrConstructSignature): Promise<SchnorrConstructSignatureResponse>;
3744
- schnorrVerifySignature(command: SchnorrVerifySignature): Promise<SchnorrVerifySignatureResponse>;
3745
- ecdsaSecp256k1ComputePublicKey(command: EcdsaSecp256k1ComputePublicKey): Promise<EcdsaSecp256k1ComputePublicKeyResponse>;
3746
- ecdsaSecp256r1ComputePublicKey(command: EcdsaSecp256r1ComputePublicKey): Promise<EcdsaSecp256r1ComputePublicKeyResponse>;
3747
- ecdsaSecp256k1ConstructSignature(command: EcdsaSecp256k1ConstructSignature): Promise<EcdsaSecp256k1ConstructSignatureResponse>;
3748
- ecdsaSecp256r1ConstructSignature(command: EcdsaSecp256r1ConstructSignature): Promise<EcdsaSecp256r1ConstructSignatureResponse>;
3749
- ecdsaSecp256k1RecoverPublicKey(command: EcdsaSecp256k1RecoverPublicKey): Promise<EcdsaSecp256k1RecoverPublicKeyResponse>;
3750
- ecdsaSecp256r1RecoverPublicKey(command: EcdsaSecp256r1RecoverPublicKey): Promise<EcdsaSecp256r1RecoverPublicKeyResponse>;
3751
- ecdsaSecp256k1VerifySignature(command: EcdsaSecp256k1VerifySignature): Promise<EcdsaSecp256k1VerifySignatureResponse>;
3752
- ecdsaSecp256r1VerifySignature(command: EcdsaSecp256r1VerifySignature): Promise<EcdsaSecp256r1VerifySignatureResponse>;
3753
- srsInitSrs(command: SrsInitSrs): Promise<SrsInitSrsResponse>;
3754
- srsInitGrumpkinSrs(command: SrsInitGrumpkinSrs): Promise<SrsInitGrumpkinSrsResponse>;
3755
- shutdown(command: Shutdown): Promise<ShutdownResponse>;
3756
- destroy(): Promise<void>;
3757
- }