| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Evaluation.Builtins.BLS12_381.TestClasses
Contents
Synopsis
- class (`Contains` a) => TestableAbelianGroup a where #
The code for the property tests for G1 and G2 is essentially identical, so it's worth abstracting over the common features. The blst Haskell FFI uses a phantom type to do this but unfortunately we have to hide that to stop the builtin machinery spotting it and then we have to re-abstract here.
Methods
Generate an arbitrary element of G1. It's tricky to construct such an element directly without using quite low-level operations on the curve because a random point on the curve is highly unlikely to be in the subgroup G1, but fortunately
hashToGroupalways produces an element of the subgroup, so we can produce random elements of G1 by hashing random bytestrings.