Skip to content

Commit

Permalink
fix(zkalc): workaround generic sandwich bug in Nim 1.6.x nim-lang/Nim…
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim committed Jul 12, 2024
1 parent 5c989d9 commit 28f03e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion benchmarks/zkalc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import
# Third-party
jsony, cliche

# Workarounds generic sandwich bug in 1.6.x
from constantine/named/algebras import matchingBigInt, matchingOrderBigInt, getLimbs2x

type
ZkalcBenchDetails = object
`range`: seq[int]
Expand Down Expand Up @@ -110,7 +113,7 @@ template bench(body: untyped): AggStats =

# We can store integers up to 2⁵³ in a float64 without loss of precision (see also ulp)
# 1 billion is ~ 2³⁰, so you would need 2²³ seconds = 8388608s = 13 weeks 6 days 2 hours 10 minutes 8 seconds
stats.push(elapsedNs)
stats.push(elapsedNs.int)

(stats, batchSize)

Expand Down
2 changes: 1 addition & 1 deletion constantine/named/zoo_subgroups.nim
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export
func clearCofactor*[EC](P: var EC) {.inline.} =
## Clear the cofactor of a point on the curve
## From a point on the curve, returns a point on the subgroup of order r
when EC.getName() in {BN254_Nogami, BN254_Snarks, BLS12_377, BLS12_381}:
when EC.F.Name in {BN254_Nogami, BN254_Snarks, BLS12_377, BLS12_381}:
P.clearCofactorFast()
else:
P.clearCofactorReference()

0 comments on commit 28f03e9

Please sign in to comment.