Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Evaluation.Builtins.BLS12_381.TestClasses
Contents
Synopsis
- class (Eq a, Show a, Arbitrary a, ArbitraryBuiltin a) ⇒ TestableAbelianGroup a where
- class TestableAbelianGroup a ⇒ HashAndCompress a where
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.
Methods
addTerm ∷ PlcTerm → PlcTerm → PlcTerm Source #
negTerm ∷ PlcTerm → PlcTerm Source #
scalarMulTerm ∷ PlcTerm → PlcTerm → PlcTerm Source #
Instances
class TestableAbelianGroup a ⇒ HashAndCompress a where Source #
Methods
compress ∷ a → ByteString Source #
compressTerm ∷ PlcTerm → PlcTerm Source #
Instances
HashAndCompress Element Source # | |
Defined in Evaluation.Builtins.BLS12_381.TestClasses Methods compress ∷ Element → ByteString Source # compressTerm ∷ PlcTerm → PlcTerm Source # | |
HashAndCompress Element Source # | |
Defined in Evaluation.Builtins.BLS12_381.TestClasses Methods compress ∷ Element → ByteString Source # compressTerm ∷ PlcTerm → PlcTerm Source # |
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 |
Arbitrary Element Source # | See the comment for the Arbitrary instance for G1. |