Class Fp6Element
java.lang.Object
org.bouncycastle.crypto.bls.Fp6Element
Immutable element of
Fp^6 = Fp^2[v] / (v^3 - (1 + I)), the cubic
extension of Fp2Element used as the inner level of the BLS12-381
pairing field tower.
An element is represented as c0 + c1*v + c2*v^2 where each c_i is
an Fp^2 element. Multiplication uses the relation v^3 = NON_RESIDUE
where NON_RESIDUE = 1 + I, the standard BLS12-381 cubic non-residue
choice.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionadd(Fp6Element other) c0()c1()c2()booleanFrobenius: raise to theppower.Frobenius²: raise to thep^2power.static Fp6ElementfromFp2(Fp2Element c0) inthashCode()inverse()Inverse via the standard cubic-extension formula:booleanisZero()modPow(BigInteger exponent) Modular exponentiation by a non-negative integer.mul(Fp6Element other) Schoolbook multiplication usingv^3 = NON_RESIDUE:mulByV()Multiplies an element of Fp^6 byv, the polynomial generator.mulFp2(Fp2Element s) Multiplies by an Fp^2 scalar.neg()static Fp6Elementof(Fp2Element c0, Fp2Element c1, Fp2Element c2) square()Squaring via the Chung-Hasan SQR3 algorithm: 6 Fp^2 multiplications versus 9 for the schoolbook product.sub(Fp6Element other) toString()
-
Field Details
-
ZERO
-
ONE
-
-
Method Details
-
of
-
fromFp2
-
c0
-
c1
-
c2
-
isZero
public boolean isZero() -
add
-
sub
-
neg
-
mul
Schoolbook multiplication usingv^3 = NON_RESIDUE:(a0 + a1*v + a2*v^2) * (b0 + b1*v + b2*v^2) = (a0*b0 + (a1*b2 + a2*b1)*xi) + (a0*b1 + a1*b0 + a2*b2*xi) * v + (a0*b2 + a1*b1 + a2*b0) * v^2
where xi = NON_RESIDUE. -
square
Squaring via the Chung-Hasan SQR3 algorithm: 6 Fp^2 multiplications versus 9 for the schoolbook product. -
mulByV
Multiplies an element of Fp^6 byv, the polynomial generator. Useful for the Fp^12 multiplication formula. -
mulFp2
Multiplies by an Fp^2 scalar. -
inverse
Inverse via the standard cubic-extension formula:t0 = c0^2 - xi*c1*c2 t1 = xi*c2^2 - c0*c1 t2 = c1^2 - c0*c2 norm = c0*t0 + xi*c2*t1 + xi*c1*t2 inv = (t0 + t1*v + t2*v^2) / norm
-
frobeniusSquared
Frobenius²: raise to thep^2power. Identity on Fp² components (Frobenius² in Fp² is identity), with thev-basis components scaled by precomputed Fp² constants. -
frobenius
Frobenius: raise to theppower. The Fp² components are conjugated (Fp² Frobenius is conjugation since p ≡ 3 mod 4), then the v-basis components are scaled by precomputed coefficients. -
modPow
Modular exponentiation by a non-negative integer. -
equals
-
hashCode
-
toString
-