Safe Haskell | None |
---|---|
Language | Haskell2010 |
First quadratic extension of the tower:
- Fq
- Fq2 := Fq[u]/u^2 + 1
- Fq6 := Fq2[v]/v^3 - (9 + u)
- Fq12 := Fq6[w]/w^2 - v
Implementation following "Multiplication and Squaring on Pairing-Friendly Fields" by Devigili, hEigeartaigh, Scott and Dahab.
Synopsis
- data Fq2 = Fq2 {}
- new :: Fq -> Fq -> Fq2
- fq2scalarMul :: Fq -> Fq2 -> Fq2
- fq2inv :: Fq2 -> Fq2
- fq2one :: Fq2
- fq2zero :: Fq2
- fq2conj :: Fq2 -> Fq2
- fq2sqr :: Fq2 -> Fq2
- fq2sqrt :: Fq2 -> Maybe Fq2
- fq2pow :: Fq2 -> Integer -> Fq2
- fq2YforX :: Fq2 -> Bool -> Maybe Fq2
- mulXi :: Fq2 -> Fq2
- divXi :: Fq2 -> Fq2
- xi :: Fq2
- random :: MonadRandom m => m Fq2
Documentation
Quadratic extension of Fq
defined as Fq[u]/x^2 + 1
Instances
Eq Fq2 Source # | |
Fractional Fq2 Source # | |
Num Fq2 Source # | |
Ord Fq2 Source # | |
Show Fq2 Source # | |
Generic Fq2 Source # | |
Semigroup G2 Source # | |
Monoid G2 Source # | |
NFData Fq2 Source # | |
Defined in Pairing.Fq2 | |
ByteRepr Fq2 Source # | |
Defined in Pairing.Fq2 | |
Validate G2 Source # | |
Defined in Pairing.Group isValidElement :: G2 -> Bool Source # | |
FromX Fq2 Source # | |
CyclicGroup G2 Source # | |
ToUncompressedForm G2 Source # | |
Defined in Pairing.Group | |
ToCompressedForm G2 Source # | |
Defined in Pairing.Group serializeCompressed :: G2 -> Maybe ByteString Source # | |
Arbitrary (Point Fq2) Source # | |
type Rep Fq2 Source # | |
Defined in Pairing.Fq2 type Rep Fq2 = D1 (MetaData "Fq2" "Pairing.Fq2" "pairing-0.3.0-DeuZ5Z2okCW8lwO8f8VUj3" False) (C1 (MetaCons "Fq2" PrefixI True) (S1 (MetaSel (Just "fq2x") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Fq) :*: S1 (MetaSel (Just "fq2y") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Fq))) |
fq2sqrt :: Fq2 -> Maybe Fq2 Source #
Square root of Fq2 are specified by https://eprint.iacr.org/2012/685.pdf, Algorithm 9 with lots of help from https://docs.rs/pairing/0.14.1/src/pairing/bls12_381/fq2.rs.html#162-222 This implementation appears to return the larger square root so check the return value and negate as necessary
random :: MonadRandom m => m Fq2 Source #