public final class SexticOverQuadraticTowerExtensionField extends Object
This class also offers special methods to multiply sparsely populated
elements of the form v0 + v2 i^2 + v3 i^3 respectively v0
+ v3 i^3 + v4 i^4. Furthermore, computation of powers in the
cyclotomic subgroup is implemented [3].
References:
[1] N. Benger, M. Scott. Constructing Tower Extensions of Finite Fields for Implementation of Pairing-Based Cryptography.
[2] A. Weimerskirch, C. Paar. Generalizations of the Karatsuba Algorithm for Efficient Implementations.
[3] R. Granger, M. Scott. Faster Squaring in the Cyclotomic Subgroup of Sixth Degree Extensions
public SexticExtensionFieldElement negate(GenericFieldElement a)
GenericFielda, i.e. performs the operation b = -b.a - the field elementapublic SexticExtensionFieldElement negateOutOfPlace(GenericFieldElement a)
GenericFielda, i.e. performs the operation b = -b,
where a new object holding the result is created.a - the field elementapublic SexticExtensionFieldElement add(GenericFieldElement a, GenericFieldElement b)
GenericFieldb to a, i.e. performs the operation
a += b.a - the first addendb - the second addenda and bpublic SexticExtensionFieldElement addOutOfPlace(PrimeCharacteristicFieldElement a, PrimeCharacteristicFieldElement b)
PrimeCharacteristicFielda - first summandb - second summandpublic SexticExtensionFieldElement subtract(GenericFieldElement a, GenericFieldElement b)
GenericFieldb from a, i.e. performs the operation
a -= b.a - the minuendb - the subtrahenda and bpublic SexticExtensionFieldElement subtractOutOfPlace(GenericFieldElement a, GenericFieldElement b)
PrimeCharacteristicFieldb from this and returns a new object
holding the result.a - the minuendb - the subtrahenda and bpublic SexticExtensionFieldElement multiply(GenericFieldElement a, GenericFieldElement b)
GenericFielda by b, i.e. performs the operation
a *= b.a - the first factorb - the second factora and bpublic SexticExtensionFieldElement multiplyOutOfPlace(GenericFieldElement a, GenericFieldElement b)
GenericFielda by b, i.e. performs the operation
a *= b, where a new object holding the result is created.a - the first factorb - the second factora and bpublic SexticExtensionFieldElement multiply(GenericFieldElement a, BigInteger n)
GenericFielda by n, i.e. performs the operation
a *= n.a - the first factorn - the second factora and npublic SexticExtensionFieldElement multiplyOutOfPlace(GenericFieldElement a, BigInteger n)
GenericFielda by n, i.e. performs the operation
a *= n, where a new object holding the result is created.a - the first factorn - the second factora and npublic SexticExtensionFieldElement multiplyBy2(PrimeCharacteristicFieldElement a)
PrimeCharacteristicFielda by 2, which is a left-shift. Works in-place.a - the element to be shifteda holding the resultpublic SexticExtensionFieldElement multiplyBy2OutOfPlace(PrimeCharacteristicFieldElement a)
PrimeCharacteristicFielda by 2, which is a left-shift and
returns a new object holding the result.a - the element to be shifteda holding the resultpublic SexticExtensionFieldElement multiplyBy3(PrimeCharacteristicFieldElement a)
PrimeCharacteristicFielda by 3, which is a left-shift plus an
addition. Works in-place.a - the element to multiplieda holding the resultpublic SexticExtensionFieldElement multiplyBy3OutOfPlace(PrimeCharacteristicFieldElement a)
PrimeCharacteristicFielda by 3, which is a left-shift plus an
addition and returns a new object holding the result.a - the element to multiplieda holding the resultpublic SexticExtensionFieldElement multiplyByPowerOf2(PrimeCharacteristicFieldElement a, int exponent)
PrimeCharacteristicFielda by a power of 2, which is a
left-shift. Works in-place.a - the element to be shiftedexponent - the power of 2a holding the resultpublic SexticExtensionFieldElement multiplyByPowerOf2OutOfPlace(PrimeCharacteristicFieldElement a, int exponent)
PrimeCharacteristicFielda by a power of 2, which is a
left-shift and returns a new object holding the result.a - the element to be shiftedexponent - the power of 2a holding the resultpublic SexticExtensionFieldElement divide(GenericFieldElement a, GenericFieldElement b)
GenericFielda by b, i.e. performs the operation
a /= b.a - the dividendb - the divisora and bpublic SexticExtensionFieldElement divideBy2(PrimeCharacteristicFieldElement a)
PrimeCharacteristicFielda by 2.a - the dividenda and 2.public SexticExtensionFieldElement conjugate(ExtensionFieldElement b)
ExtensionFieldb - the element to be conjugatedbpublic SexticExtensionFieldElement invert(GenericFieldElement a)
GenericFielda, i.e. performs the operation
a = a^(-1).a - the field elementapublic SexticExtensionFieldElement square(GenericFieldElement a)
GenericFielda, i.e. performs the operation a *= a.a - the field elementapublic SexticExtensionFieldElement squareOutOfPlace(GenericFieldElement a)
GenericFielda, i.e. performs the operation a*a,
where a new object holding the result is created.a - the field elementapublic SexticExtensionFieldElement squareRoot(ExtensionFieldElement a, boolean checkSquare)
UnsupportedOperationException.a - the field elementcheckSquare - check if a is a square. If true, the
return value is undefined for non-squares.a if it exists, null otherwisepublic SexticExtensionFieldElement squareRoot(ExtensionFieldElement a)
UnsupportedOperationException.a - the field elementa if it exists, null otherwisepublic PrimeFieldElement getNorm(ExtensionFieldElement a)
ExtensionFielda - the field elementapublic SexticExtensionFieldElement getOne()
GenericFieldpublic SexticExtensionFieldElement getZero()
GenericFieldpublic SexticExtensionFieldElement newElement(Object b)
ExtensionFieldBigInteger-array
representation. Every component in the canonical representation of the
field's elements corresponds to an array dimension, in ascending order.b - the BigInteger[]public SexticExtensionFieldElement newElement(PrimeCharacteristicFieldElement a, PrimeCharacteristicFieldElement b, PrimeCharacteristicFieldElement c, PrimeCharacteristicFieldElement d, PrimeCharacteristicFieldElement e, PrimeCharacteristicFieldElement f)
a - the first elementb - the second elementc - the third elementd - the fourth elemente - the fifth elementf - the sixth elementa,b,c,d,e,fpublic SexticExtensionFieldElement newElement(byte[] bytes)
GenericFieldbyte-array representation.bytes - the byte[] in little-endian orderpublic SexticExtensionFieldElement toElement(byte[] bytes)
GenericFieldbyte-array. Unlike
GenericField.newElement(byte[]), this method does not assume the
input to be a valid encoding of a field element.bytes - a byte[] in little-endian orderpublic SexticExtensionFieldElement getUniformlyRandomElement()
PrimeCharacteristicFieldpublic SexticExtensionFieldElement getUniformlyRandomNonZeroElement()
PrimeCharacteristicFieldpublic BigInteger[][] toBigIntegers(ExtensionFieldElement a)
ExtensionFieldBigInteger
representation.a - the field elementBigInteger representationpublic SexticExtensionFieldElement newElementFromBaseField(PrimeFieldElement a)
ExtensionFieldthis.a - a prime field elementa as element of thispublic SexticExtensionFieldElement newElementFromSubField(PrimeCharacteristicFieldElement a)
ExtensionFieldthis.a - a sub field elementa as element of thispublic SexticExtensionFieldElement multiply(ExtensionFieldElement a, PrimeFieldElement b)
ExtensionFielda - extension field elementb - prime field elementa multiplied by the adjoint root.public QuadraticExtensionFieldElement getNonResidue()
public int getQuadraticCharacter(PrimeCharacteristicFieldElement a)
UnsupportedOperationException.a - a field element(a/p)public SexticExtensionFieldElement multiplyByAdjointRoot(ExtensionFieldElement a)
ExtensionFielda by the root used to obtain the extension field.a - extension field elementa multiplied by the adjoint root.public SexticExtensionFieldElement multiplyDenseSparse023(SexticExtensionFieldElement a, ExtensionFieldElement b)
a - first operandb - second operand (sparse)a and bpublic SexticExtensionFieldElement multiplyDenseSparse023(SexticExtensionFieldElement a, PrimeCharacteristicFieldElement b_0, PrimeCharacteristicFieldElement b_2, PrimeCharacteristicFieldElement b_3)
a - first operandb_0 - constant coefficient of second operandb_2 - coefficient of i^2 of second operandb_3 - coefficient of i^3 of second operanda and bpublic SexticExtensionFieldElement multiplySparse023(SexticExtensionFieldElement a, ExtensionFieldElement b)
a - first operand (sparse)b - second operand (sparse)a and bpublic SexticExtensionFieldElement multiplySparse023(SexticExtensionFieldElement a, PrimeCharacteristicFieldElement b_0, PrimeCharacteristicFieldElement b_2, PrimeCharacteristicFieldElement b_3)
a - first operand (sparse)b_0 - constant coefficient of second operandb_2 - coefficient of i^2 of second operandb_3 - coefficient of i^3 of second operanda and bpublic SexticExtensionFieldElement multiplyDenseSparse034(SexticExtensionFieldElement a, ExtensionFieldElement b)
a - first operandb - second operand (sparse)a and bpublic SexticExtensionFieldElement multiplyDenseSparse034(SexticExtensionFieldElement a, PrimeCharacteristicFieldElement v0, PrimeCharacteristicFieldElement v3, PrimeCharacteristicFieldElement v4)
a - first operandv0 - constant coefficient of second operandv3 - coefficient of i^3 of second operandv4 - coefficient of i^4 of second operanda and bpublic SexticExtensionFieldElement multiplySparse034(SexticExtensionFieldElement a, ExtensionFieldElement b)
a - first operand (sparse)b - second operand (sparse)a and bpublic SexticExtensionFieldElement multiplySparse034(SexticExtensionFieldElement a, PrimeCharacteristicFieldElement v0, PrimeCharacteristicFieldElement v3, PrimeCharacteristicFieldElement v4)
a - first operand (sparse)v0 - constant coefficient of second operandv3 - coefficient of i^3 of second operandv4 - coefficient of i^4 of second operanda and bpublic SexticExtensionFieldElement conjugate(ExtensionFieldElement b, int i)
ExtensionFieldi times.b - the element to be conjugatedi - number of times the element should be conjugatedb conjugated i timespublic SexticExtensionFieldElement applyFrobenius(ExtensionFieldElement a, int i)
ExtensionFieldi-th Frobenius of a.a - the element on which the Frobenius map should be applied.i - number of times the Frobenius map should be applied.i times to a.public FrobeniusSexticExtensionOverQuadraticConstants getFrobeniusConstants()
public SexticExtensionFieldElement squareUni(SexticExtensionFieldElement a)
a - the cyclotomic subgroup elementa squaredpublic SexticExtensionFieldElement exponentiateUni(SexticExtensionFieldElement a, BigInteger n)
a - the cyclotomic subgroup elementn - the exponenta to the n-th powerpublic GenericFieldElement[] invertElements(GenericFieldElement[] elements)
GenericFieldinvertElements in interface GenericFieldelements - the array of field elementspublic ExtensionFieldElement exponentiate(GenericFieldElement a, BigInteger n)
GenericFielda to the power n, i.e. performs the
operation a = a^n.exponentiate in interface ExtensionFieldexponentiate in interface GenericFieldexponentiate in interface PrimeCharacteristicFielda - the field elementn - the exponentnth power of
apublic ExtensionFieldElement exponentiate(GenericFieldElement a, int n)
GenericFielda to the power n, i.e. performs the
operation a = a^n.exponentiate in interface GenericFielda - the field elementn - the exponentnth power of
apublic ExtensionFieldElement exponentiateByPowerOf2(GenericFieldElement a, int n)
GenericFielda to the power 2n.exponentiateByPowerOf2 in interface ExtensionFieldexponentiateByPowerOf2 in interface GenericFieldexponentiateByPowerOf2 in interface PrimeCharacteristicFielda - the field elementn - the exponentpublic BigInteger getCardinality()
GenericFieldgetCardinality in interface GenericFieldBigInteger holding the cardinalitypublic FieldTypes getFieldType()
GenericFieldgetFieldType in interface GenericFieldpublic int getFieldSize()
getFieldSize in interface ECFieldpublic int getDepth()
ExtensionFieldgetDepth in interface ExtensionFieldpublic int getDegree()
ExtensionFieldgetDegree in interface ExtensionFieldthis over its subfield.public int getDegreeOverBaseField()
ExtensionFieldgetDegreeOverBaseField in interface ExtensionFieldthis over its base field.public AbstractPrimeField getBaseField()
GenericFieldgetBaseField in interface ExtensionFieldgetBaseField in interface GenericFieldpublic ExtensionField getSubField()
ExtensionFieldnull if the subfield equals the base field, and the
subfield otherwise.getSubField in interface ExtensionFieldnull if the subfield equals the base field, and the
subfield otherwise.public int hashCode()
hashCode in interface GenericFieldhashCode in class Objectpublic boolean equals(Object obj)
equals in interface GenericFieldequals in class ObjectCopyright © 2011–2022 Stiftung SIC. All rights reserved.