@aztec/bb.js 0.86.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/browser/barretenberg-threads.js +1 -1
- package/dest/browser/barretenberg.js +1 -1
- package/dest/browser/index.js +179 -345
- package/dest/browser/main.worker.js +116 -116
- package/dest/browser/thread.worker.js +116 -116
- package/dest/node/barretenberg/backend.d.ts +5 -40
- package/dest/node/barretenberg/backend.d.ts.map +1 -1
- package/dest/node/barretenberg/backend.js +28 -108
- package/dest/node/barretenberg/index.d.ts +1 -1
- package/dest/node/barretenberg/index.d.ts.map +1 -1
- package/dest/node/barretenberg/index.js +6 -6
- package/dest/node/barretenberg/verifier.d.ts +0 -2
- package/dest/node/barretenberg/verifier.d.ts.map +1 -1
- package/dest/node/barretenberg/verifier.js +2 -12
- package/dest/node/barretenberg_api/index.d.ts +7 -11
- package/dest/node/barretenberg_api/index.d.ts.map +1 -1
- package/dest/node/barretenberg_api/index.js +46 -74
- package/dest/node/barretenberg_wasm/barretenberg-threads.wasm.gz +0 -0
- package/dest/node/bigint-array/index.d.ts +1 -0
- package/dest/node/bigint-array/index.d.ts.map +1 -1
- package/dest/node/bindgen/mappings.js +2 -2
- package/dest/node/bindgen/typescript.js +1 -1
- package/dest/node/crs/net_crs.d.ts.map +1 -1
- package/dest/node/crs/net_crs.js +6 -7
- package/dest/node/crs/node/index.js +4 -4
- package/dest/node/index.d.ts +1 -1
- package/dest/node/index.d.ts.map +1 -1
- package/dest/node/index.js +2 -2
- package/dest/node/main.d.ts +0 -8
- package/dest/node/main.d.ts.map +1 -1
- package/dest/node/main.js +38 -244
- package/dest/node/proof/index.d.ts +1 -2
- package/dest/node/proof/index.d.ts.map +1 -1
- package/dest/node/proof/index.js +2 -9
- package/dest/node/serialize/buffer_reader.d.ts.map +1 -1
- package/dest/node/serialize/buffer_reader.js +1 -1
- package/dest/node/types/fields.d.ts +1 -0
- package/dest/node/types/fields.d.ts.map +1 -1
- package/dest/node/types/fields.js +1 -1
- package/dest/node/types/point.d.ts +1 -0
- package/dest/node/types/point.d.ts.map +1 -1
- package/dest/node/types/point.js +1 -1
- package/dest/node-cjs/barretenberg/backend.d.ts +5 -40
- package/dest/node-cjs/barretenberg/backend.d.ts.map +1 -1
- package/dest/node-cjs/barretenberg/backend.js +28 -109
- package/dest/node-cjs/barretenberg/index.d.ts +1 -1
- package/dest/node-cjs/barretenberg/index.d.ts.map +1 -1
- package/dest/node-cjs/barretenberg/index.js +6 -7
- package/dest/node-cjs/barretenberg/verifier.d.ts +0 -2
- package/dest/node-cjs/barretenberg/verifier.d.ts.map +1 -1
- package/dest/node-cjs/barretenberg/verifier.js +1 -11
- package/dest/node-cjs/barretenberg_api/index.d.ts +7 -11
- package/dest/node-cjs/barretenberg_api/index.d.ts.map +1 -1
- package/dest/node-cjs/barretenberg_api/index.js +45 -73
- package/dest/node-cjs/barretenberg_wasm/barretenberg-threads.wasm.gz +0 -0
- package/dest/node-cjs/bigint-array/index.d.ts +1 -0
- package/dest/node-cjs/bigint-array/index.d.ts.map +1 -1
- package/dest/node-cjs/bindgen/mappings.js +2 -2
- package/dest/node-cjs/bindgen/typescript.js +1 -1
- package/dest/node-cjs/crs/net_crs.d.ts.map +1 -1
- package/dest/node-cjs/crs/net_crs.js +6 -7
- package/dest/node-cjs/crs/node/index.js +4 -4
- package/dest/node-cjs/index.d.ts +1 -1
- package/dest/node-cjs/index.d.ts.map +1 -1
- package/dest/node-cjs/index.js +2 -3
- package/dest/node-cjs/main.d.ts +0 -8
- package/dest/node-cjs/main.d.ts.map +1 -1
- package/dest/node-cjs/main.js +39 -253
- package/dest/node-cjs/proof/index.d.ts +1 -2
- package/dest/node-cjs/proof/index.d.ts.map +1 -1
- package/dest/node-cjs/proof/index.js +3 -11
- package/dest/node-cjs/serialize/buffer_reader.d.ts.map +1 -1
- package/dest/node-cjs/serialize/buffer_reader.js +1 -1
- package/dest/node-cjs/types/fields.d.ts +1 -0
- package/dest/node-cjs/types/fields.d.ts.map +1 -1
- package/dest/node-cjs/types/fields.js +1 -1
- package/dest/node-cjs/types/point.d.ts +1 -0
- package/dest/node-cjs/types/point.d.ts.map +1 -1
- package/dest/node-cjs/types/point.js +1 -1
- package/package.json +7 -8
- package/src/barretenberg/backend.ts +41 -159
- package/src/barretenberg/index.ts +10 -6
- package/src/barretenberg/verifier.ts +1 -13
- package/src/barretenberg_api/index.ts +74 -130
- package/src/bindgen/mappings.ts +1 -1
- package/src/bindgen/typescript.ts +4 -4
- package/src/crs/net_crs.ts +5 -6
- package/src/crs/node/index.ts +3 -3
- package/src/index.html +1 -1
- package/src/index.ts +0 -1
- package/src/main.ts +44 -279
- package/src/proof/index.ts +1 -13
- package/src/serialize/buffer_reader.ts +4 -1
- package/src/types/fields.ts +2 -2
- package/src/types/point.ts +4 -1
- package/dest/browser/733.655674bbbb79bdf168c4.js +0 -7
- package/dest/node/crs/node/ignition_files_crs.d.ts +0 -38
- package/dest/node/crs/node/ignition_files_crs.d.ts.map +0 -1
- package/dest/node/crs/node/ignition_files_crs.js +0 -65
- package/dest/node/examples/simple.rawtest.d.ts +0 -2
- package/dest/node/examples/simple.rawtest.d.ts.map +0 -1
- package/dest/node/examples/simple.rawtest.js +0 -30
- package/dest/node/examples/simple.test.d.ts +0 -2
- package/dest/node/examples/simple.test.d.ts.map +0 -1
- package/dest/node/examples/simple.test.js +0 -23
- package/dest/node-cjs/crs/node/ignition_files_crs.d.ts +0 -38
- package/dest/node-cjs/crs/node/ignition_files_crs.d.ts.map +0 -1
- package/dest/node-cjs/crs/node/ignition_files_crs.js +0 -69
- package/dest/node-cjs/examples/simple.rawtest.d.ts +0 -2
- package/dest/node-cjs/examples/simple.rawtest.d.ts.map +0 -1
- package/dest/node-cjs/examples/simple.rawtest.js +0 -33
- package/dest/node-cjs/examples/simple.test.d.ts +0 -2
- package/dest/node-cjs/examples/simple.test.d.ts.map +0 -1
- package/dest/node-cjs/examples/simple.test.js +0 -25
- package/src/crs/node/ignition_files_crs.ts +0 -74
- package/src/examples/simple.rawtest.ts +0 -38
- package/src/examples/simple.test.ts +0 -28
|
@@ -183,18 +183,6 @@ export class BarretenbergApi {
|
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
async examplesSimpleCreateAndVerifyProof(): Promise<boolean> {
|
|
187
|
-
const inArgs = [].map(serializeBufferable);
|
|
188
|
-
const outTypes: OutputType[] = [BoolDeserializer()];
|
|
189
|
-
const result = await this.wasm.callWasmExport(
|
|
190
|
-
'examples_simple_create_and_verify_proof',
|
|
191
|
-
inArgs,
|
|
192
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
193
|
-
);
|
|
194
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
195
|
-
return out[0];
|
|
196
|
-
}
|
|
197
|
-
|
|
198
186
|
async testThreads(threads: number, iterations: number): Promise<number> {
|
|
199
187
|
const inArgs = [threads, iterations].map(serializeBufferable);
|
|
200
188
|
const outTypes: OutputType[] = [NumberDeserializer()];
|
|
@@ -235,58 +223,6 @@ export class BarretenbergApi {
|
|
|
235
223
|
return out as any;
|
|
236
224
|
}
|
|
237
225
|
|
|
238
|
-
async acirNewAcirComposer(sizeHint: number): Promise<Ptr> {
|
|
239
|
-
const inArgs = [sizeHint].map(serializeBufferable);
|
|
240
|
-
const outTypes: OutputType[] = [Ptr];
|
|
241
|
-
const result = await this.wasm.callWasmExport(
|
|
242
|
-
'acir_new_acir_composer',
|
|
243
|
-
inArgs,
|
|
244
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
245
|
-
);
|
|
246
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
247
|
-
return out[0];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
async acirDeleteAcirComposer(acirComposerPtr: Ptr): Promise<void> {
|
|
251
|
-
const inArgs = [acirComposerPtr].map(serializeBufferable);
|
|
252
|
-
const outTypes: OutputType[] = [];
|
|
253
|
-
const result = await this.wasm.callWasmExport(
|
|
254
|
-
'acir_delete_acir_composer',
|
|
255
|
-
inArgs,
|
|
256
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
257
|
-
);
|
|
258
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
async acirInitProvingKey(acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array, recursive: boolean): Promise<void> {
|
|
263
|
-
const inArgs = [acirComposerPtr, constraintSystemBuf, recursive].map(serializeBufferable);
|
|
264
|
-
const outTypes: OutputType[] = [];
|
|
265
|
-
const result = await this.wasm.callWasmExport(
|
|
266
|
-
'acir_init_proving_key',
|
|
267
|
-
inArgs,
|
|
268
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
269
|
-
);
|
|
270
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
async acirCreateProof(
|
|
275
|
-
acirComposerPtr: Ptr,
|
|
276
|
-
constraintSystemBuf: Uint8Array,
|
|
277
|
-
recursive: boolean,
|
|
278
|
-
witnessBuf: Uint8Array,
|
|
279
|
-
): Promise<Uint8Array> {
|
|
280
|
-
const inArgs = [acirComposerPtr, constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable);
|
|
281
|
-
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
282
|
-
const result = await this.wasm.callWasmExport(
|
|
283
|
-
'acir_create_proof',
|
|
284
|
-
inArgs,
|
|
285
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
286
|
-
);
|
|
287
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
288
|
-
return out[0];
|
|
289
|
-
}
|
|
290
226
|
|
|
291
227
|
async acirProveAndVerifyUltraHonk(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): Promise<boolean> {
|
|
292
228
|
const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable);
|
|
@@ -472,6 +408,18 @@ export class BarretenbergApi {
|
|
|
472
408
|
return out[0];
|
|
473
409
|
}
|
|
474
410
|
|
|
411
|
+
async acirProveUltraKeccakZKHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Promise<Uint8Array> {
|
|
412
|
+
const inArgs = [acirVec, witnessVec].map(serializeBufferable);
|
|
413
|
+
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
414
|
+
const result = await this.wasm.callWasmExport(
|
|
415
|
+
'acir_prove_ultra_keccak_zk_honk',
|
|
416
|
+
inArgs,
|
|
417
|
+
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
418
|
+
);
|
|
419
|
+
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
420
|
+
return out[0];
|
|
421
|
+
}
|
|
422
|
+
|
|
475
423
|
async acirProveUltraStarknetHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Promise<Uint8Array> {
|
|
476
424
|
const inArgs = [acirVec, witnessVec].map(serializeBufferable);
|
|
477
425
|
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
@@ -508,6 +456,18 @@ export class BarretenbergApi {
|
|
|
508
456
|
return out[0];
|
|
509
457
|
}
|
|
510
458
|
|
|
459
|
+
async acirVerifyUltraKeccakZKHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): Promise<boolean> {
|
|
460
|
+
const inArgs = [proofBuf, vkBuf].map(serializeBufferable);
|
|
461
|
+
const outTypes: OutputType[] = [BoolDeserializer()];
|
|
462
|
+
const result = await this.wasm.callWasmExport(
|
|
463
|
+
'acir_verify_ultra_keccak_zk_honk',
|
|
464
|
+
inArgs,
|
|
465
|
+
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
466
|
+
);
|
|
467
|
+
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
468
|
+
return out[0];
|
|
469
|
+
}
|
|
470
|
+
|
|
511
471
|
async acirVerifyUltraStarknetHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): Promise<boolean> {
|
|
512
472
|
const inArgs = [proofBuf, vkBuf].map(serializeBufferable);
|
|
513
473
|
const outTypes: OutputType[] = [BoolDeserializer()];
|
|
@@ -544,6 +504,18 @@ export class BarretenbergApi {
|
|
|
544
504
|
return out[0];
|
|
545
505
|
}
|
|
546
506
|
|
|
507
|
+
async acirWriteVkUltraKeccakZKHonk(acirVec: Uint8Array): Promise<Uint8Array> {
|
|
508
|
+
const inArgs = [acirVec].map(serializeBufferable);
|
|
509
|
+
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
510
|
+
const result = await this.wasm.callWasmExport(
|
|
511
|
+
'acir_write_vk_ultra_keccak_zk_honk',
|
|
512
|
+
inArgs,
|
|
513
|
+
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
514
|
+
);
|
|
515
|
+
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
516
|
+
return out[0];
|
|
517
|
+
}
|
|
518
|
+
|
|
547
519
|
async acirWriteVkUltraStarknetHonk(acirVec: Uint8Array): Promise<Uint8Array> {
|
|
548
520
|
const inArgs = [acirVec].map(serializeBufferable);
|
|
549
521
|
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
@@ -775,18 +747,6 @@ export class BarretenbergApiSync {
|
|
|
775
747
|
return;
|
|
776
748
|
}
|
|
777
749
|
|
|
778
|
-
examplesSimpleCreateAndVerifyProof(): boolean {
|
|
779
|
-
const inArgs = [].map(serializeBufferable);
|
|
780
|
-
const outTypes: OutputType[] = [BoolDeserializer()];
|
|
781
|
-
const result = this.wasm.callWasmExport(
|
|
782
|
-
'examples_simple_create_and_verify_proof',
|
|
783
|
-
inArgs,
|
|
784
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
785
|
-
);
|
|
786
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
787
|
-
return out[0];
|
|
788
|
-
}
|
|
789
|
-
|
|
790
750
|
testThreads(threads: number, iterations: number): number {
|
|
791
751
|
const inArgs = [threads, iterations].map(serializeBufferable);
|
|
792
752
|
const outTypes: OutputType[] = [NumberDeserializer()];
|
|
@@ -823,58 +783,6 @@ export class BarretenbergApiSync {
|
|
|
823
783
|
return out as any;
|
|
824
784
|
}
|
|
825
785
|
|
|
826
|
-
acirNewAcirComposer(sizeHint: number): Ptr {
|
|
827
|
-
const inArgs = [sizeHint].map(serializeBufferable);
|
|
828
|
-
const outTypes: OutputType[] = [Ptr];
|
|
829
|
-
const result = this.wasm.callWasmExport(
|
|
830
|
-
'acir_new_acir_composer',
|
|
831
|
-
inArgs,
|
|
832
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
833
|
-
);
|
|
834
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
835
|
-
return out[0];
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
acirDeleteAcirComposer(acirComposerPtr: Ptr): void {
|
|
839
|
-
const inArgs = [acirComposerPtr].map(serializeBufferable);
|
|
840
|
-
const outTypes: OutputType[] = [];
|
|
841
|
-
const result = this.wasm.callWasmExport(
|
|
842
|
-
'acir_delete_acir_composer',
|
|
843
|
-
inArgs,
|
|
844
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
845
|
-
);
|
|
846
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
847
|
-
return;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
acirInitProvingKey(acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array, recursive: boolean): void {
|
|
851
|
-
const inArgs = [acirComposerPtr, constraintSystemBuf, recursive].map(serializeBufferable);
|
|
852
|
-
const outTypes: OutputType[] = [];
|
|
853
|
-
const result = this.wasm.callWasmExport(
|
|
854
|
-
'acir_init_proving_key',
|
|
855
|
-
inArgs,
|
|
856
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
857
|
-
);
|
|
858
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
859
|
-
return;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
acirCreateProof(
|
|
863
|
-
acirComposerPtr: Ptr,
|
|
864
|
-
constraintSystemBuf: Uint8Array,
|
|
865
|
-
recursive: boolean,
|
|
866
|
-
witnessBuf: Uint8Array,
|
|
867
|
-
): Uint8Array {
|
|
868
|
-
const inArgs = [acirComposerPtr, constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable);
|
|
869
|
-
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
870
|
-
const result = this.wasm.callWasmExport(
|
|
871
|
-
'acir_create_proof',
|
|
872
|
-
inArgs,
|
|
873
|
-
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
874
|
-
);
|
|
875
|
-
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
876
|
-
return out[0];
|
|
877
|
-
}
|
|
878
786
|
|
|
879
787
|
acirProveAndVerifyUltraHonk(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): boolean {
|
|
880
788
|
const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable);
|
|
@@ -1056,6 +964,30 @@ export class BarretenbergApiSync {
|
|
|
1056
964
|
return out[0];
|
|
1057
965
|
}
|
|
1058
966
|
|
|
967
|
+
acirProveUltraKeccakZKHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array {
|
|
968
|
+
const inArgs = [acirVec, witnessVec].map(serializeBufferable);
|
|
969
|
+
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
970
|
+
const result = this.wasm.callWasmExport(
|
|
971
|
+
'acir_prove_ultra_keccak_zk_honk',
|
|
972
|
+
inArgs,
|
|
973
|
+
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
974
|
+
);
|
|
975
|
+
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
976
|
+
return out[0];
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
acirProveUltraKeccakZkHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array {
|
|
980
|
+
const inArgs = [acirVec, witnessVec].map(serializeBufferable);
|
|
981
|
+
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
982
|
+
const result = this.wasm.callWasmExport(
|
|
983
|
+
'acir_prove_ultra_keccak_zk_honk',
|
|
984
|
+
inArgs,
|
|
985
|
+
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
986
|
+
);
|
|
987
|
+
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
988
|
+
return out[0];
|
|
989
|
+
}
|
|
990
|
+
|
|
1059
991
|
acirVerifyUltraHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): boolean {
|
|
1060
992
|
const inArgs = [proofBuf, vkBuf].map(serializeBufferable);
|
|
1061
993
|
const outTypes: OutputType[] = [BoolDeserializer()];
|
|
@@ -1068,11 +1000,11 @@ export class BarretenbergApiSync {
|
|
|
1068
1000
|
return out[0];
|
|
1069
1001
|
}
|
|
1070
1002
|
|
|
1071
|
-
|
|
1003
|
+
acirVerifyUltraKeccakZKHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): boolean {
|
|
1072
1004
|
const inArgs = [proofBuf, vkBuf].map(serializeBufferable);
|
|
1073
1005
|
const outTypes: OutputType[] = [BoolDeserializer()];
|
|
1074
1006
|
const result = this.wasm.callWasmExport(
|
|
1075
|
-
'
|
|
1007
|
+
'acir_verify_ultra_keccak_zk_honk',
|
|
1076
1008
|
inArgs,
|
|
1077
1009
|
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
1078
1010
|
);
|
|
@@ -1104,6 +1036,18 @@ export class BarretenbergApiSync {
|
|
|
1104
1036
|
return out[0];
|
|
1105
1037
|
}
|
|
1106
1038
|
|
|
1039
|
+
acirWriteVkUltraKeccakZKHonk(acirVec: Uint8Array): Uint8Array {
|
|
1040
|
+
const inArgs = [acirVec].map(serializeBufferable);
|
|
1041
|
+
const outTypes: OutputType[] = [BufferDeserializer()];
|
|
1042
|
+
const result = this.wasm.callWasmExport(
|
|
1043
|
+
'acir_write_vk_ultra_keccak_zk_honk',
|
|
1044
|
+
inArgs,
|
|
1045
|
+
outTypes.map(t => t.SIZE_IN_BYTES),
|
|
1046
|
+
);
|
|
1047
|
+
const out = result.map((r, i) => outTypes[i].fromBuffer(r));
|
|
1048
|
+
return out[0];
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1107
1051
|
acirProofAsFieldsUltraHonk(proofBuf: Uint8Array): Fr[] {
|
|
1108
1052
|
const inArgs = [proofBuf].map(serializeBufferable);
|
|
1109
1053
|
const outTypes: OutputType[] = [VectorDeserializer(Fr)];
|
package/src/bindgen/mappings.ts
CHANGED
|
@@ -13,7 +13,7 @@ const typeMap: { [key: string]: string } = {
|
|
|
13
13
|
'fq::vec_in_buf': 'Fq[]',
|
|
14
14
|
'fq::vec_out_buf': 'Fq[]',
|
|
15
15
|
'const uint8_t *': 'Uint8Array',
|
|
16
|
-
|
|
16
|
+
uint8_vec_vec_in_buf: 'Uint8Array[]',
|
|
17
17
|
'uint8_t **': 'Uint8Array',
|
|
18
18
|
in_str_buf: 'string',
|
|
19
19
|
out_str_buf: 'string',
|
|
@@ -46,8 +46,8 @@ export class BarretenbergApi {
|
|
|
46
46
|
outArgs.length === 0
|
|
47
47
|
? 'void'
|
|
48
48
|
: outArgs.length === 1
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
? `${mapType(outArgs[0].type)}`
|
|
50
|
+
: `[${outArgs.map(a => mapType(a.type)).join(', ')}]`;
|
|
51
51
|
|
|
52
52
|
output += `
|
|
53
53
|
async ${toCamelCase(functionName)}(${parameters}): Promise<${returnType}> {
|
|
@@ -93,8 +93,8 @@ export class BarretenbergApiSync {
|
|
|
93
93
|
outArgs.length === 0
|
|
94
94
|
? 'void'
|
|
95
95
|
: outArgs.length === 1
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
? `${mapType(outArgs[0].type)}`
|
|
97
|
+
: `[${outArgs.map(a => mapType(a.type)).join(', ')}]`;
|
|
98
98
|
|
|
99
99
|
output += `
|
|
100
100
|
${toCamelCase(functionName)}(${parameters}): ${returnType} {
|
package/src/crs/net_crs.ts
CHANGED
|
@@ -78,7 +78,7 @@ export class NetCrs {
|
|
|
78
78
|
const g1End = this.numPoints * 64 - 1;
|
|
79
79
|
return await retry(
|
|
80
80
|
() =>
|
|
81
|
-
fetch('https://aztec
|
|
81
|
+
fetch('https://crs.aztec.network/g1.dat', {
|
|
82
82
|
headers: {
|
|
83
83
|
Range: `bytes=0-${g1End}`,
|
|
84
84
|
},
|
|
@@ -94,7 +94,7 @@ export class NetCrs {
|
|
|
94
94
|
private async fetchG2Data(): Promise<Response> {
|
|
95
95
|
return await retry(
|
|
96
96
|
() =>
|
|
97
|
-
fetch('https://aztec
|
|
97
|
+
fetch('https://crs.aztec.network/g2.dat', {
|
|
98
98
|
cache: 'force-cache',
|
|
99
99
|
}),
|
|
100
100
|
makeBackoff([5, 5, 5]),
|
|
@@ -152,12 +152,11 @@ export class NetGrumpkinCrs {
|
|
|
152
152
|
return new Response(new Uint8Array([]));
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
const
|
|
156
|
-
const g1End = g1Start + (this.numPoints * 64 - 1);
|
|
155
|
+
const g1End = this.numPoints * 64 - 1;
|
|
157
156
|
|
|
158
|
-
return await fetch('https://aztec
|
|
157
|
+
return await fetch('https://crs.aztec.network/grumpkin_g1.dat', {
|
|
159
158
|
headers: {
|
|
160
|
-
Range: `bytes
|
|
159
|
+
Range: `bytes=0-${g1End}`,
|
|
161
160
|
},
|
|
162
161
|
cache: 'force-cache',
|
|
163
162
|
});
|
package/src/crs/node/index.ts
CHANGED
|
@@ -98,7 +98,7 @@ export class GrumpkinCrs {
|
|
|
98
98
|
async init(): Promise<void> {
|
|
99
99
|
mkdirSync(this.path, { recursive: true });
|
|
100
100
|
|
|
101
|
-
const g1FileSize = await stat(this.path + '/grumpkin_g1.dat')
|
|
101
|
+
const g1FileSize = await stat(this.path + '/grumpkin_g1.flat.dat')
|
|
102
102
|
.then(stats => stats.size)
|
|
103
103
|
.catch(() => 0);
|
|
104
104
|
|
|
@@ -111,7 +111,7 @@ export class GrumpkinCrs {
|
|
|
111
111
|
const crs = new NetGrumpkinCrs(this.numPoints);
|
|
112
112
|
const stream = await crs.streamG1Data();
|
|
113
113
|
|
|
114
|
-
await finished(Readable.fromWeb(stream as any).pipe(createWriteStream(this.path + '/grumpkin_g1.dat')));
|
|
114
|
+
await finished(Readable.fromWeb(stream as any).pipe(createWriteStream(this.path + '/grumpkin_g1.flat.dat')));
|
|
115
115
|
writeFileSync(this.path + '/grumpkin_size', String(crs.numPoints));
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -120,6 +120,6 @@ export class GrumpkinCrs {
|
|
|
120
120
|
* @returns The points data.
|
|
121
121
|
*/
|
|
122
122
|
getG1Data(): Uint8Array {
|
|
123
|
-
return readFileSync(this.path + '/grumpkin_g1.dat');
|
|
123
|
+
return readFileSync(this.path + '/grumpkin_g1.flat.dat');
|
|
124
124
|
}
|
|
125
125
|
}
|
package/src/index.html
CHANGED