public final class Fp12Element
extends java.lang.Object
Fp^12 = Fp^6[w] / (w^2 - v), the outer level
of the BLS12-381 pairing field tower.
An element is represented as c0 + c1*w where each c_i is an Fp^6
element. The relation w^2 = v (the polynomial generator of Fp^6)
gives a clean Karatsuba-style multiplication.
| Modifier and Type | Field and Description |
|---|---|
static Fp12Element |
ONE |
static Fp12Element |
ZERO |
| Modifier and Type | Method and Description |
|---|---|
Fp12Element |
add(Fp12Element other) |
Fp6Element |
c0() |
Fp6Element |
c1() |
Fp12Element |
conjugate()
Conjugate: (c0 + c1*w) → (c0 - c1*w).
|
boolean |
equals(java.lang.Object other) |
Fp12Element |
frobenius()
Frobenius: raise to the
p power. |
Fp12Element |
frobeniusSquared()
Frobenius²: raise to the
p^2 power. |
static Fp12Element |
fromFp6(Fp6Element c0) |
int |
hashCode() |
Fp12Element |
inverse()
Modular inverse:
(c0 + c1*w)^-1 = (c0 - c1*w) / (c0^2 - c1^2 * v)
|
boolean |
isZero() |
Fp12Element |
modPow(java.math.BigInteger exponent)
Modular exponentiation by an integer exponent.
|
Fp12Element |
mul(Fp12Element other)
Karatsuba multiplication using
w^2 = v:
(a0 + a1*w)(b0 + b1*w) = (a0*b0 + a1*b1*v) + ((a0+a1)(b0+b1) - a0*b0 - a1*b1) * w
|
Fp12Element |
neg() |
static Fp12Element |
of(Fp6Element c0,
Fp6Element c1) |
Fp12Element |
square()
Squaring via complex-style: (a0 + a1*w)^2 = (a0+a1)(a0+a1*v) - a0*a1 - a0*a1*v + 2*a0*a1*w.
|
Fp12Element |
sub(Fp12Element other) |
java.lang.String |
toString() |
public static final Fp12Element ZERO
public static final Fp12Element ONE
public static Fp12Element of(Fp6Element c0, Fp6Element c1)
public static Fp12Element fromFp6(Fp6Element c0)
public Fp6Element c0()
public Fp6Element c1()
public boolean isZero()
public Fp12Element add(Fp12Element other)
public Fp12Element sub(Fp12Element other)
public Fp12Element neg()
public Fp12Element mul(Fp12Element other)
w^2 = v:
(a0 + a1*w)(b0 + b1*w) = (a0*b0 + a1*b1*v) + ((a0+a1)(b0+b1) - a0*b0 - a1*b1) * w
public Fp12Element square()
public Fp12Element frobeniusSquared()
p^2 power. Combines
Fp6Element.frobeniusSquared() on each Fp&sup6; component
with a multiplication by the precomputed Fp² coefficient
for the w basis on the c1 component.public Fp12Element frobenius()
p power. Combines
Fp6Element.frobenius() on each Fp&sup6; component with a
multiplication by the precomputed Fp² coefficient for the
w basis on the c1 component.public Fp12Element conjugate()
public Fp12Element inverse()
(c0 + c1*w)^-1 = (c0 - c1*w) / (c0^2 - c1^2 * v)
public Fp12Element modPow(java.math.BigInteger exponent)
exponent;
a negative exponent is handled by inverting and recursing on the
absolute value.public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object