diff --git a/benchmark/index.ts b/benchmark/index.ts index e936fd3..f1998fe 100644 --- a/benchmark/index.ts +++ b/benchmark/index.ts @@ -84,6 +84,35 @@ import {aggCount, runs} from "./params"; runs, }); + // Verify multiple signatures + + await runBenchmark<{pks: PublicKey[]; msgs: Uint8Array[]; sigs: Signature[]}, boolean>({ + id: `${implementation} verifyMultipleSignatures (${aggCount})`, + + prepareTest: () => { + const dataArr = range(aggCount).map(() => { + const sk = bls.SecretKey.fromKeygen(); + const pk = sk.toPublicKey(); + const msg = randomMessage(); + const sig = sk.sign(msg); + return {pk, msg, sig}; + }); + + const pks = dataArr.map((data) => data.pk); + const msgs = dataArr.map((data) => data.msg); + const sigs = dataArr.map((data) => data.sig); + + return { + input: {pks, msgs, sigs}, + resultCheck: (valid) => valid === true, + }; + }, + testRunner: ({pks, msgs, sigs}) => { + return bls.Signature.verifyMultipleSignatures(pks, msgs, sigs); + }, + runs, + }); + // Aggregate pubkeys await runBenchmark({