Safe Haskell | None |
---|---|
Language | Haskell2010 |
Prime field with characteristic _q, over which the elliptic curve is defined and the other finite field extensions.
- Fq
- Fq2 := Fq[u]/u^2 + 1
- Fq6 := Fq2[v]/v^3 - (9 + u)
- Fq12 := Fq6[w]/w^2 - v
Synopsis
- type Fq = PrimeField 21888242871839275222246405745257275088696311157297823662689037894645226208583
- type Fq2 = ExtensionField Fq PolynomialU
- type Fq6 = ExtensionField Fq2 PolynomialV
- type Fq12 = ExtensionField Fq6 PolynomialW
- fqSqrt :: (Fq -> Fq -> Fq) -> Fq -> Maybe Fq
- fq2Sqrt :: Fq2 -> Maybe Fq2
- fqYforX :: Fq -> (Fq -> Fq -> Fq) -> Maybe Fq
- fq2YforX :: Fq2 -> (Fq2 -> Fq2 -> Fq2) -> Maybe Fq2
- fqNqr :: Fq
- xi :: Fq2
- mulXi :: Fq6 -> Fq6
- fq2Conj :: Fq2 -> Fq2
- fq2ScalarMul :: Fq -> Fq2 -> Fq2
- construct :: [Fq] -> Fq12
- deconstruct :: Fq12 -> [Fq]
- fq12Conj :: Fq12 -> Fq12
- fq12Frobenius :: Int -> Fq12 -> Fq12
Documentation
type Fq = PrimeField 21888242871839275222246405745257275088696311157297823662689037894645226208583 Source #
Prime field Fq
with characteristic _q
type Fq2 = ExtensionField Fq PolynomialU Source #
Quadratic extension field of Fq
defined as Fq2 = Fq[u]/f(u)
type Fq6 = ExtensionField Fq2 PolynomialV Source #
Cubic extension field of Fq2
defined as Fq6 = Fq2[v]/g(v)
type Fq12 = ExtensionField Fq6 PolynomialW Source #
Quadratic extension field of Fq6
defined as Fq12 = Fq6[w]/h(w)
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
construct :: [Fq] -> Fq12 Source #
Create a new value in Fq12
by providing a list of twelve coefficients
in Fq
, should be used instead of the Fq12
constructor.
deconstruct :: Fq12 -> [Fq] Source #
Deconstruct a value in Fq12
into a list of twelve coefficients in Fq
.