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

Evaluation.Builtins.BLS12_381.TestClasses

Synopsis

Documentation

class (Eq a, Show a, Arbitrary a, ArbitraryBuiltin a) ⇒ TestableAbelianGroup a where Source #

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.

Orphan instances

Arbitrary Element Source #

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 hasing random bytestrings.

Instance details

Arbitrary Element Source #

See the comment for the Arbitrary instance for G1.

Instance details