kilic / bls12-381

High-speed BLS12-381 implementation in Go
Apache License 2.0
124 stars 47 forks source link

Group order exposed? #6

Closed wbl closed 4 years ago

wbl commented 4 years ago

As far as I can tell the order of the group isn't defined as a constant or function returning a big.Int in the API. This makes it very hard to do arithmetic outside the package and then pass in the result: this is necessary for things like picking random points or doing arithmetic in the exponents.

I can easily submit a PR to fix this if you think it's a good idea, but want to know what you think of the various ways to solve this problem.

kilic commented 4 years ago

I totally agree that group order should be exposed. It is now a function of each group and it can be reached like below.

g.Q()
wbl commented 4 years ago

Thank you!