Skip to content

Commit

Permalink
commit subgroup check benches from https://github.com/mratsim/constan…
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim committed Apr 27, 2024
1 parent 2a805d8 commit d1af981
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions benchmarks/bench_summary_bls12_377.nim
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ proc main() =
finalExpBLS12Bench(curve, Iters)
pairingBLS12Bench(curve, Iters)
separator()
subgroupCheckBench(ECP_ShortW_Jac[Fp[curve], G1], Iters)
subgroupCheckBench(ECP_ShortW_Jac[Fp2[curve], G2], Iters)
separator()

main()
notes()
3 changes: 3 additions & 0 deletions benchmarks/bench_summary_bls12_381.nim
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ proc main() =
hashToCurveBLS12381G1Bench(Iters)
hashToCurveBLS12381G2Bench(Iters)
separator()
subgroupCheckBench(ECP_ShortW_Jac[Fp[curve], G1], Iters)
subgroupCheckBench(ECP_ShortW_Jac[Fp2[curve], G2], Iters)
separator()

main()
notes()
3 changes: 3 additions & 0 deletions benchmarks/bench_summary_bn254_nogami.nim
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ proc main() =
finalExpBNBench(curve, Iters)
pairingBNBench(curve, Iters)
separator()
subgroupCheckBench(ECP_ShortW_Jac[Fp[curve], G1], Iters)
subgroupCheckBench(ECP_ShortW_Jac[Fp2[curve], G2], Iters)
separator()

main()
notes()
3 changes: 3 additions & 0 deletions benchmarks/bench_summary_bn254_snarks.nim
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ proc main() =
hashToCurveBN254SnarksG1Bench(Iters)
hashToCurveBN254SnarksG2Bench(Iters)
separator()
subgroupCheckBench(ECP_ShortW_Jac[Fp[curve], G1], Iters)
subgroupCheckBench(ECP_ShortW_Jac[Fp2[curve], G2], Iters)
separator()

main()
notes()
7 changes: 7 additions & 0 deletions benchmarks/bench_summary_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,10 @@ proc hashToCurveBN254SnarksG2Bench*(iters: int) =
message = msg,
domainSepTag = dst
)

proc subgroupCheckBench*(EC: typedesc, iters: int) =
var P = rng.random_unsafe(EC)
P.clearCofactor()

bench("Subgroup check", EC, iters):
discard P.isInSubgroup()

0 comments on commit d1af981

Please sign in to comment.