@aztec/bb.js 0.67.1 → 0.68.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/522.index.js +1 -1
- package/dest/browser/crs/node/index.d.ts.map +1 -1
- package/dest/browser/index.js +13 -13
- package/dest/node/barretenberg/backend.js +2 -2
- package/dest/node/barretenberg/index.js +1 -1
- package/dest/node/barretenberg_wasm/barretenberg-threads.wasm.gz +0 -0
- package/dest/node/barretenberg_wasm/helpers/browser/index.js +2 -2
- package/dest/node/crs/node/index.d.ts.map +1 -1
- package/dest/node/crs/node/index.js +8 -3
- package/dest/node/main.d.ts +8 -7
- package/dest/node/main.d.ts.map +1 -1
- package/dest/node/main.js +55 -53
- package/dest/node/random/browser/index.js +3 -3
- package/dest/node-cjs/barretenberg/backend.js +2 -2
- package/dest/node-cjs/barretenberg/index.js +1 -1
- package/dest/node-cjs/barretenberg_wasm/barretenberg-threads.wasm.gz +0 -0
- package/dest/node-cjs/barretenberg_wasm/helpers/browser/index.js +2 -2
- package/dest/node-cjs/crs/node/index.d.ts.map +1 -1
- package/dest/node-cjs/crs/node/index.js +7 -2
- package/dest/node-cjs/main.d.ts +8 -7
- package/dest/node-cjs/main.d.ts.map +1 -1
- package/dest/node-cjs/main.js +55 -53
- package/dest/node-cjs/random/browser/index.js +3 -3
- package/package.json +4 -3
- package/src/barretenberg/backend.ts +1 -1
- package/src/barretenberg/index.ts +1 -1
- package/src/barretenberg_wasm/helpers/browser/index.ts +1 -1
- package/src/crs/node/index.ts +7 -2
- package/src/main.ts +59 -52
- package/src/random/browser/index.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { wrap } from 'comlink';
|
|
2
2
|
|
|
3
3
|
export function getSharedMemoryAvailable() {
|
|
4
|
-
const globalScope = typeof window !== 'undefined' ? window :
|
|
4
|
+
const globalScope = typeof window !== 'undefined' ? window : globalThis;
|
|
5
5
|
return typeof SharedArrayBuffer !== 'undefined' && globalScope.crossOriginIsolated;
|
|
6
6
|
}
|
|
7
7
|
|
package/src/crs/node/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NetCrs, NetGrumpkinCrs } from '../net_crs.js';
|
|
2
|
-
import { mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
2
|
+
import { closeSync, mkdirSync, openSync, readFileSync, readSync, writeFileSync } from 'fs';
|
|
3
3
|
import { stat } from 'fs/promises';
|
|
4
4
|
import createDebug from 'debug';
|
|
5
5
|
import { homedir } from 'os';
|
|
@@ -45,7 +45,12 @@ export class Crs {
|
|
|
45
45
|
* @returns The points data.
|
|
46
46
|
*/
|
|
47
47
|
getG1Data(): Uint8Array {
|
|
48
|
-
|
|
48
|
+
const length = this.numPoints * 64;
|
|
49
|
+
const fd = openSync(this.path + '/bn254_g1.dat', 'r');
|
|
50
|
+
const buffer = new Uint8Array(length);
|
|
51
|
+
readSync(fd, buffer, 0, length, 0);
|
|
52
|
+
closeSync(fd);
|
|
53
|
+
return buffer;
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
/**
|
package/src/main.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import 'source-map-support/register.js';
|
|
2
3
|
import { Crs, GrumpkinCrs, Barretenberg, RawBuffer } from './index.js';
|
|
3
4
|
import createDebug from 'debug';
|
|
4
5
|
import { readFileSync, writeFileSync } from 'fs';
|
|
@@ -141,11 +142,11 @@ async function initClientIVC(crsPath: string) {
|
|
|
141
142
|
return { api };
|
|
142
143
|
}
|
|
143
144
|
|
|
144
|
-
async function initLite() {
|
|
145
|
+
async function initLite(crsPath: string) {
|
|
145
146
|
const api = await Barretenberg.new({ threads: 1 });
|
|
146
147
|
|
|
147
148
|
// Plus 1 needed! (Move +1 into Crs?)
|
|
148
|
-
const crs = await Crs.new(1);
|
|
149
|
+
const crs = await Crs.new(1, crsPath);
|
|
149
150
|
|
|
150
151
|
// Load CRS into wasm global CRS state.
|
|
151
152
|
await api.srsInitSrs(new RawBuffer(crs.getG1Data()), crs.numPoints, new RawBuffer(crs.getG2Data()));
|
|
@@ -305,8 +306,8 @@ export async function gateCountUltra(bytecodePath: string, recursive: boolean, h
|
|
|
305
306
|
}
|
|
306
307
|
}
|
|
307
308
|
|
|
308
|
-
export async function verify(proofPath: string, vkPath: string) {
|
|
309
|
-
const { api, acirComposer } = await initLite();
|
|
309
|
+
export async function verify(proofPath: string, vkPath: string, crsPath: string) {
|
|
310
|
+
const { api, acirComposer } = await initLite(crsPath);
|
|
310
311
|
try {
|
|
311
312
|
await api.acirLoadVerificationKey(acirComposer, new RawBuffer(readFileSync(vkPath)));
|
|
312
313
|
const verified = await api.acirVerifyProof(acirComposer, readFileSync(proofPath));
|
|
@@ -317,8 +318,8 @@ export async function verify(proofPath: string, vkPath: string) {
|
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
320
|
|
|
320
|
-
export async function contract(outputPath: string, vkPath: string) {
|
|
321
|
-
const { api, acirComposer } = await initLite();
|
|
321
|
+
export async function contract(outputPath: string, vkPath: string, crsPath: string) {
|
|
322
|
+
const { api, acirComposer } = await initLite(crsPath);
|
|
322
323
|
try {
|
|
323
324
|
await api.acirLoadVerificationKey(acirComposer, new RawBuffer(readFileSync(vkPath)));
|
|
324
325
|
const contract = await api.acirGetSolidityVerifier(acirComposer);
|
|
@@ -397,8 +398,8 @@ export async function writePk(bytecodePath: string, recursive: boolean, crsPath:
|
|
|
397
398
|
}
|
|
398
399
|
}
|
|
399
400
|
|
|
400
|
-
export async function proofAsFields(proofPath: string, vkPath: string, outputPath: string) {
|
|
401
|
-
const { api, acirComposer } = await initLite();
|
|
401
|
+
export async function proofAsFields(proofPath: string, vkPath: string, outputPath: string, crsPath: string) {
|
|
402
|
+
const { api, acirComposer } = await initLite(crsPath);
|
|
402
403
|
|
|
403
404
|
try {
|
|
404
405
|
debug('serializing proof byte array into field elements');
|
|
@@ -424,8 +425,8 @@ export async function proofAsFields(proofPath: string, vkPath: string, outputPat
|
|
|
424
425
|
}
|
|
425
426
|
}
|
|
426
427
|
|
|
427
|
-
export async function vkAsFields(vkPath: string, vkeyOutputPath: string) {
|
|
428
|
-
const { api, acirComposer } = await initLite();
|
|
428
|
+
export async function vkAsFields(vkPath: string, vkeyOutputPath: string, crsPath: string) {
|
|
429
|
+
const { api, acirComposer } = await initLite(crsPath);
|
|
429
430
|
|
|
430
431
|
try {
|
|
431
432
|
debug('serializing vk byte array into field elements');
|
|
@@ -509,8 +510,13 @@ export async function writeVkUltraHonk(
|
|
|
509
510
|
}
|
|
510
511
|
}
|
|
511
512
|
|
|
512
|
-
export async function verifyUltraHonk(
|
|
513
|
-
|
|
513
|
+
export async function verifyUltraHonk(
|
|
514
|
+
proofPath: string,
|
|
515
|
+
vkPath: string,
|
|
516
|
+
crsPath: string,
|
|
517
|
+
options?: UltraHonkBackendOptions,
|
|
518
|
+
) {
|
|
519
|
+
const { api } = await initLite(crsPath);
|
|
514
520
|
try {
|
|
515
521
|
const acirVerifyUltraHonk = options?.keccak
|
|
516
522
|
? api.acirVerifyUltraKeccakHonk.bind(api)
|
|
@@ -524,8 +530,8 @@ export async function verifyUltraHonk(proofPath: string, vkPath: string, options
|
|
|
524
530
|
}
|
|
525
531
|
}
|
|
526
532
|
|
|
527
|
-
export async function proofAsFieldsUltraHonk(proofPath: string, outputPath: string) {
|
|
528
|
-
const { api } = await initLite();
|
|
533
|
+
export async function proofAsFieldsUltraHonk(proofPath: string, outputPath: string, crsPath: string) {
|
|
534
|
+
const { api } = await initLite(crsPath);
|
|
529
535
|
try {
|
|
530
536
|
debug('outputting proof as vector of fields');
|
|
531
537
|
const proofAsFields = await api.acirProofAsFieldsUltraHonk(readFileSync(proofPath));
|
|
@@ -545,8 +551,8 @@ export async function proofAsFieldsUltraHonk(proofPath: string, outputPath: stri
|
|
|
545
551
|
}
|
|
546
552
|
}
|
|
547
553
|
|
|
548
|
-
export async function vkAsFieldsUltraHonk(vkPath: string, vkeyOutputPath: string) {
|
|
549
|
-
const { api } = await initLite();
|
|
554
|
+
export async function vkAsFieldsUltraHonk(vkPath: string, vkeyOutputPath: string, crsPath: string) {
|
|
555
|
+
const { api } = await initLite(crsPath);
|
|
550
556
|
|
|
551
557
|
try {
|
|
552
558
|
debug('serializing vk byte array into field elements');
|
|
@@ -576,6 +582,7 @@ function handleGlobalOptions() {
|
|
|
576
582
|
if (program.opts().verbose) {
|
|
577
583
|
createDebug.enable('bb.js*');
|
|
578
584
|
}
|
|
585
|
+
return { crsPath: program.opts().crsPath };
|
|
579
586
|
}
|
|
580
587
|
|
|
581
588
|
program
|
|
@@ -584,8 +591,8 @@ program
|
|
|
584
591
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
585
592
|
.option('-r, --recursive', 'Whether to use a SNARK friendly proof', false)
|
|
586
593
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witness.gz')
|
|
587
|
-
.action(async ({ bytecodePath, recursive, witnessPath
|
|
588
|
-
handleGlobalOptions();
|
|
594
|
+
.action(async ({ bytecodePath, recursive, witnessPath }) => {
|
|
595
|
+
const { crsPath } = handleGlobalOptions();
|
|
589
596
|
const result = await proveAndVerify(bytecodePath, recursive, witnessPath, crsPath);
|
|
590
597
|
process.exit(result ? 0 : 1);
|
|
591
598
|
});
|
|
@@ -596,8 +603,8 @@ program
|
|
|
596
603
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
597
604
|
.option('-r, --recursive', 'Whether to use a SNARK friendly proof', false)
|
|
598
605
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witness.gz')
|
|
599
|
-
.action(async ({ bytecodePath, recursive, witnessPath
|
|
600
|
-
handleGlobalOptions();
|
|
606
|
+
.action(async ({ bytecodePath, recursive, witnessPath }) => {
|
|
607
|
+
const { crsPath } = handleGlobalOptions();
|
|
601
608
|
const result = await proveAndVerifyUltraHonk(bytecodePath, recursive, witnessPath, crsPath);
|
|
602
609
|
process.exit(result ? 0 : 1);
|
|
603
610
|
});
|
|
@@ -608,8 +615,8 @@ program
|
|
|
608
615
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
609
616
|
.option('-r, --recursive', 'Whether to use a SNARK friendly proof', false)
|
|
610
617
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witness.gz')
|
|
611
|
-
.action(async ({ bytecodePath, recursive, witnessPath
|
|
612
|
-
handleGlobalOptions();
|
|
618
|
+
.action(async ({ bytecodePath, recursive, witnessPath }) => {
|
|
619
|
+
const { crsPath } = handleGlobalOptions();
|
|
613
620
|
const result = await proveAndVerifyMegaHonk(bytecodePath, recursive, witnessPath, crsPath);
|
|
614
621
|
process.exit(result ? 0 : 1);
|
|
615
622
|
});
|
|
@@ -619,8 +626,8 @@ program
|
|
|
619
626
|
.description('Generate a ClientIVC proof.')
|
|
620
627
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/acir.msgpack.b64')
|
|
621
628
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witnesses.msgpack.b64')
|
|
622
|
-
.action(async ({ bytecodePath, witnessPath
|
|
623
|
-
handleGlobalOptions();
|
|
629
|
+
.action(async ({ bytecodePath, witnessPath }) => {
|
|
630
|
+
const { crsPath } = handleGlobalOptions();
|
|
624
631
|
const result = await proveAndVerifyAztecClient(bytecodePath, witnessPath, crsPath);
|
|
625
632
|
process.exit(result ? 0 : 1);
|
|
626
633
|
});
|
|
@@ -631,8 +638,8 @@ program
|
|
|
631
638
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
632
639
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
633
640
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witness.gz')
|
|
634
|
-
.action(async ({ bytecodePath, recursive, witnessPath
|
|
635
|
-
handleGlobalOptions();
|
|
641
|
+
.action(async ({ bytecodePath, recursive, witnessPath }) => {
|
|
642
|
+
const { crsPath } = handleGlobalOptions();
|
|
636
643
|
const result = await foldAndVerifyProgram(bytecodePath, recursive, witnessPath, crsPath);
|
|
637
644
|
process.exit(result ? 0 : 1);
|
|
638
645
|
});
|
|
@@ -644,8 +651,8 @@ program
|
|
|
644
651
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
645
652
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witness.gz')
|
|
646
653
|
.option('-o, --output-path <path>', 'Specify the proof output path', './proofs/proof')
|
|
647
|
-
.action(async ({ bytecodePath, recursive, witnessPath, outputPath
|
|
648
|
-
handleGlobalOptions();
|
|
654
|
+
.action(async ({ bytecodePath, recursive, witnessPath, outputPath }) => {
|
|
655
|
+
const { crsPath } = handleGlobalOptions();
|
|
649
656
|
await prove(bytecodePath, recursive, witnessPath, crsPath, outputPath);
|
|
650
657
|
});
|
|
651
658
|
|
|
@@ -666,8 +673,8 @@ program
|
|
|
666
673
|
.requiredOption('-p, --proof-path <path>', 'Specify the path to the proof')
|
|
667
674
|
.requiredOption('-k, --vk <path>', 'path to a verification key. avoids recomputation.')
|
|
668
675
|
.action(async ({ proofPath, vk }) => {
|
|
669
|
-
handleGlobalOptions();
|
|
670
|
-
const result = await verify(proofPath, vk);
|
|
676
|
+
const { crsPath } = handleGlobalOptions();
|
|
677
|
+
const result = await verify(proofPath, vk, crsPath);
|
|
671
678
|
process.exit(result ? 0 : 1);
|
|
672
679
|
});
|
|
673
680
|
|
|
@@ -678,8 +685,8 @@ program
|
|
|
678
685
|
.option('-o, --output-path <path>', 'Specify the path to write the contract', './target/contract.sol')
|
|
679
686
|
.requiredOption('-k, --vk-path <path>', 'Path to a verification key. avoids recomputation.')
|
|
680
687
|
.action(async ({ outputPath, vkPath }) => {
|
|
681
|
-
handleGlobalOptions();
|
|
682
|
-
await contract(outputPath, vkPath);
|
|
688
|
+
const { crsPath } = handleGlobalOptions();
|
|
689
|
+
await contract(outputPath, vkPath, crsPath);
|
|
683
690
|
});
|
|
684
691
|
|
|
685
692
|
program
|
|
@@ -699,8 +706,8 @@ program
|
|
|
699
706
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
700
707
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
701
708
|
.option('-o, --output-path <path>', 'Specify the path to write the key')
|
|
702
|
-
.action(async ({ bytecodePath, recursive, outputPath
|
|
703
|
-
handleGlobalOptions();
|
|
709
|
+
.action(async ({ bytecodePath, recursive, outputPath }) => {
|
|
710
|
+
const { crsPath } = handleGlobalOptions();
|
|
704
711
|
await writeVk(bytecodePath, recursive, crsPath, outputPath);
|
|
705
712
|
});
|
|
706
713
|
|
|
@@ -710,8 +717,8 @@ program
|
|
|
710
717
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
711
718
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
712
719
|
.requiredOption('-o, --output-path <path>', 'Specify the path to write the key')
|
|
713
|
-
.action(async ({ bytecodePath, recursive, outputPath
|
|
714
|
-
handleGlobalOptions();
|
|
720
|
+
.action(async ({ bytecodePath, recursive, outputPath }) => {
|
|
721
|
+
const { crsPath } = handleGlobalOptions();
|
|
715
722
|
await writePk(bytecodePath, recursive, crsPath, outputPath);
|
|
716
723
|
});
|
|
717
724
|
|
|
@@ -722,8 +729,8 @@ program
|
|
|
722
729
|
.requiredOption('-k, --vk-path <path>', 'Path to verification key.')
|
|
723
730
|
.requiredOption('-o, --output-path <path>', 'Specify the JSON path to write the proof fields')
|
|
724
731
|
.action(async ({ proofPath, vkPath, outputPath }) => {
|
|
725
|
-
handleGlobalOptions();
|
|
726
|
-
await proofAsFields(proofPath, vkPath, outputPath);
|
|
732
|
+
const { crsPath } = handleGlobalOptions();
|
|
733
|
+
await proofAsFields(proofPath, vkPath, outputPath, crsPath);
|
|
727
734
|
});
|
|
728
735
|
|
|
729
736
|
program
|
|
@@ -732,8 +739,8 @@ program
|
|
|
732
739
|
.requiredOption('-k, --vk-path <path>', 'Path to verification key.')
|
|
733
740
|
.requiredOption('-o, --output-path <path>', 'Specify the JSON path to write the verification key fields and key hash')
|
|
734
741
|
.action(async ({ vkPath, outputPath }) => {
|
|
735
|
-
handleGlobalOptions();
|
|
736
|
-
await vkAsFields(vkPath, outputPath);
|
|
742
|
+
const { crsPath } = handleGlobalOptions();
|
|
743
|
+
await vkAsFields(vkPath, outputPath, crsPath);
|
|
737
744
|
});
|
|
738
745
|
|
|
739
746
|
program
|
|
@@ -743,8 +750,8 @@ program
|
|
|
743
750
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
744
751
|
.option('-w, --witness-path <path>', 'Specify the witness path', './target/witness.gz')
|
|
745
752
|
.option('-o, --output-path <path>', 'Specify the proof output path', './proofs/proof')
|
|
746
|
-
.action(async ({ bytecodePath, recursive, witnessPath, outputPath
|
|
747
|
-
handleGlobalOptions();
|
|
753
|
+
.action(async ({ bytecodePath, recursive, witnessPath, outputPath }) => {
|
|
754
|
+
const { crsPath } = handleGlobalOptions();
|
|
748
755
|
await proveUltraHonk(bytecodePath, recursive, witnessPath, crsPath, outputPath);
|
|
749
756
|
});
|
|
750
757
|
|
|
@@ -766,8 +773,8 @@ program
|
|
|
766
773
|
.option('-b, --bytecode-path <path>', 'Specify the bytecode path', './target/program.json')
|
|
767
774
|
.option('-r, --recursive', 'Create a SNARK friendly proof', false)
|
|
768
775
|
.requiredOption('-o, --output-path <path>', 'Specify the path to write the key')
|
|
769
|
-
.action(async ({ bytecodePath, recursive, outputPath
|
|
770
|
-
handleGlobalOptions();
|
|
776
|
+
.action(async ({ bytecodePath, recursive, outputPath }) => {
|
|
777
|
+
const { crsPath } = handleGlobalOptions();
|
|
771
778
|
await writeVkUltraHonk(bytecodePath, recursive, crsPath, outputPath);
|
|
772
779
|
});
|
|
773
780
|
|
|
@@ -788,8 +795,8 @@ program
|
|
|
788
795
|
.requiredOption('-p, --proof-path <path>', 'Specify the path to the proof')
|
|
789
796
|
.requiredOption('-k, --vk <path>', 'path to a verification key. avoids recomputation.')
|
|
790
797
|
.action(async ({ proofPath, vk }) => {
|
|
791
|
-
handleGlobalOptions();
|
|
792
|
-
const result = await verifyUltraHonk(proofPath, vk);
|
|
798
|
+
const { crsPath } = handleGlobalOptions();
|
|
799
|
+
const result = await verifyUltraHonk(proofPath, vk, crsPath);
|
|
793
800
|
process.exit(result ? 0 : 1);
|
|
794
801
|
});
|
|
795
802
|
|
|
@@ -799,8 +806,8 @@ program
|
|
|
799
806
|
.requiredOption('-p, --proof-path <path>', 'Specify the path to the proof')
|
|
800
807
|
.requiredOption('-k, --vk <path>', 'path to a verification key. avoids recomputation.')
|
|
801
808
|
.action(async ({ proofPath, vk }) => {
|
|
802
|
-
handleGlobalOptions();
|
|
803
|
-
const result = await verifyUltraHonk(proofPath, vk, { keccak: true });
|
|
809
|
+
const { crsPath } = handleGlobalOptions();
|
|
810
|
+
const result = await verifyUltraHonk(proofPath, vk, crsPath, { keccak: true });
|
|
804
811
|
process.exit(result ? 0 : 1);
|
|
805
812
|
});
|
|
806
813
|
|
|
@@ -810,8 +817,8 @@ program
|
|
|
810
817
|
.requiredOption('-p, --proof-path <path>', 'Specify the proof path')
|
|
811
818
|
.requiredOption('-o, --output-path <path>', 'Specify the JSON path to write the proof fields')
|
|
812
819
|
.action(async ({ proofPath, outputPath }) => {
|
|
813
|
-
handleGlobalOptions();
|
|
814
|
-
await proofAsFieldsUltraHonk(proofPath, outputPath);
|
|
820
|
+
const { crsPath } = handleGlobalOptions();
|
|
821
|
+
await proofAsFieldsUltraHonk(proofPath, outputPath, crsPath);
|
|
815
822
|
});
|
|
816
823
|
|
|
817
824
|
program
|
|
@@ -820,8 +827,8 @@ program
|
|
|
820
827
|
.requiredOption('-k, --vk-path <path>', 'Path to verification key.')
|
|
821
828
|
.requiredOption('-o, --output-path <path>', 'Specify the JSON path to write the verification key fields.')
|
|
822
829
|
.action(async ({ vkPath, outputPath }) => {
|
|
823
|
-
handleGlobalOptions();
|
|
824
|
-
await vkAsFieldsUltraHonk(vkPath, outputPath);
|
|
830
|
+
const { crsPath } = handleGlobalOptions();
|
|
831
|
+
await vkAsFieldsUltraHonk(vkPath, outputPath, crsPath);
|
|
825
832
|
});
|
|
826
833
|
|
|
827
834
|
program.name('bb.js').parse(process.argv);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const randomBytes = (len: number) => {
|
|
2
2
|
const getWebCrypto = () => {
|
|
3
3
|
if (typeof window !== 'undefined' && window.crypto) return window.crypto;
|
|
4
|
-
if (typeof
|
|
4
|
+
if (typeof globalThis !== 'undefined' && globalThis.crypto) return globalThis.crypto;
|
|
5
5
|
return undefined;
|
|
6
6
|
};
|
|
7
7
|
|