plutus-core-1.60.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Evaluation.Builtins.BLS12_381.TestClasses

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

    groupName :: Element #

    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 hashToGroup always produces an element of the subgroup, so we can produce random elements of G1 by hashing random bytestrings.

    Instance details

    Methods

    arbitrary :: Element] #