public final class QuadraticExtensionFieldElement extends Object
| Modifier and Type | Method and Description |
|---|---|
QuadraticExtensionFieldElement |
add(GenericFieldElement b)
Adds
b to this. |
QuadraticExtensionFieldElement |
addBase(GenericFieldElement b)
Adds
b to this where b is an element
of the underlying base field. |
QuadraticExtensionFieldElement |
addOutOfPlace(ExtensionFieldElement b)
Adds two elements and returns a new object holding the result.
|
QuadraticExtensionFieldElement |
addOutOfPlace(GenericFieldElement b)
Adds two elements and returns a new object holding the result.
|
QuadraticExtensionFieldElement |
addOutOfPlace(PrimeCharacteristicFieldElement b)
Adds two elements and returns a new object holding the result.
|
QuadraticExtensionFieldElement |
applyFrobenius(int i)
Compute the
i-th Frobenius of this. |
QuadraticExtensionFieldElement |
clone()
Clones the value of this field element.
|
QuadraticExtensionFieldElement |
conjugate()
Conjugate this element.
|
QuadraticExtensionFieldElement |
conjugate(int i)
Conjugate this element
i times. |
QuadraticExtensionFieldElement |
divide(GenericFieldElement b)
Divides
this and another field elements. |
QuadraticExtensionFieldElement |
divideBy2()
Divides
this by 2. |
boolean |
equals(Object obj) |
QuadraticExtensionFieldElement |
exponentiate(BigInteger n)
Raises
this to the power n. |
QuadraticExtensionFieldElement |
exponentiate(int n)
Raises
this to the power n. |
QuadraticExtensionFieldElement |
exponentiateByPowerOf2(int exponent)
Raise
this to the power of 2^n. |
QuadraticExtensionFieldElement |
exponentiateOutOfPlace(BigInteger n)
Raises
this to the power n. |
QuadraticExtensionFieldElement |
exponentiateOutOfPlace(int n)
Raises
this to the power n. |
iaik.security.ec.math.field.AbstractQuadraticExtensionField |
getField()
Returns the associated finite field.
|
PrimeFieldElement |
getNorm()
Computes the norm of
this, which is an element of the base
field. |
int |
getQuadraticCharacter()
Implements a quadratic character, which returns -1,0,1 depending on whether
this is a quadratic non-residue, a multiple of the modulus, or
a quadratic residue. |
PrimeCharacteristicFieldElement |
getValue(int index)
Get
index-th subfield element used to represent
this. |
GenericFieldElement[] |
getValues()
Get subfield elements used to represent
this. |
PrimeFieldElement[] |
getValuesRecursive()
Get prime field elements used to represent
this. |
int |
hashCode() |
QuadraticExtensionFieldElement |
invert()
Sets
this to its inverse. |
boolean |
isOne()
Determines whether
this is one. |
boolean |
isZero()
Determines whether
this is zero. |
QuadraticExtensionFieldElement |
multiply(BigInteger n)
Multiples
this by n. |
QuadraticExtensionFieldElement |
multiply(GenericFieldElement b)
Multiplies
this with b which is an element of the
same field. |
QuadraticExtensionFieldElement |
multiply(PrimeFieldElement b)
Multiply
this by a prime field element. |
QuadraticExtensionFieldElement |
multiplyBy2()
Multiplies
this with 2. |
QuadraticExtensionFieldElement |
multiplyBy2OutOfPlace()
Multiplies
this with 2 and returns a new object holding the
result. |
QuadraticExtensionFieldElement |
multiplyBy3()
Multiplies
this with 3. |
QuadraticExtensionFieldElement |
multiplyBy3OutOfPlace()
Multiplies
this with 3 and returns a new object holding the
result. |
QuadraticExtensionFieldElement |
multiplyByAdjointRoot()
Multiply
this by the root used to obtain the extension field. |
QuadraticExtensionFieldElement |
multiplyByAdjointRootOutOfPlace()
Multiply with adjoint root out of place
|
QuadraticExtensionFieldElement |
multiplyByBase(GenericFieldElement b)
Multiplies
this with b which is an element of the
base field. |
QuadraticExtensionFieldElement |
multiplyByBaseOutOfPlace(GenericFieldElement b)
Multiplies
this with b which is an element of the
base field, where a new object holding the result is created. |
QuadraticExtensionFieldElement |
multiplyByPowerOf2(int exponent)
Multiplies
this by 2^n. |
QuadraticExtensionFieldElement |
multiplyByPowerOf2OutOfPlace(int exponent)
Multiplies
this by 2^n and returns a new object
holding the result. |
QuadraticExtensionFieldElement |
multiplyOutOfPlace(BigInteger n)
Multiples
this by n, where a new object holding
the result is created. |
QuadraticExtensionFieldElement |
multiplyOutOfPlace(GenericFieldElement b)
Multiplies
this with b which is an element of the
same field, where a new object holding the result is created. |
QuadraticExtensionFieldElement |
multiplyOutOfPlace(PrimeFieldElement b)
Multiply
this by a prime field element, where a new object
holding the result is created. |
QuadraticExtensionFieldElement |
negate()
Returns the negative of
this. |
QuadraticExtensionFieldElement |
negateOutOfPlace()
Returns the negative of
this, where a new object holding the
result is created. |
QuadraticExtensionFieldElement |
square()
Computes the square of
this in-place. |
QuadraticExtensionFieldElement |
squareOutOfPlace()
Computes the square of
this, where a new object holding the
result is created. |
QuadraticExtensionFieldElement |
squareRoot()
Computes the square root of
this in-place. |
QuadraticExtensionFieldElement |
squareRoot(boolean checkSquare)
Computes the square root of
this. |
QuadraticExtensionFieldElement |
subtract(GenericFieldElement b)
Subtracts
b from this. |
QuadraticExtensionFieldElement |
subtractOutOfPlace(ExtensionFieldElement b)
Subtract two elements and returns a new object holding the result.
|
QuadraticExtensionFieldElement |
subtractOutOfPlace(GenericFieldElement b)
Subtracts
b from this which is an element of the
base field, where a new object holding the result is created. |
QuadraticExtensionFieldElement |
subtractOutOfPlace(PrimeCharacteristicFieldElement b)
Subtracts
b from this and returns a new object
holding the result. |
Object |
toBigIntegers()
Returns the (multi-dimensional)
BigInteger-array representation of
this instance. |
byte[] |
toByteArray()
Returns
byte-array representation of this instance. |
String |
toString() |
public GenericFieldElement[] getValues()
ExtensionFieldElementthis.thispublic PrimeCharacteristicFieldElement getValue(int index)
ExtensionFieldElementindex-th subfield element used to represent
this.index - index of the desired subfield elementindex-th subfield element used to represent
thispublic QuadraticExtensionFieldElement invert()
GenericFieldElementthis to its inverse.thispublic QuadraticExtensionFieldElement multiply(GenericFieldElement b)
GenericFieldElementthis with b which is an element of the
same field.b - the second factorthis and bpublic QuadraticExtensionFieldElement multiplyOutOfPlace(GenericFieldElement b)
GenericFieldElementthis with b which is an element of the
same field, where a new object holding the result is created.b - the second factorthis and bpublic QuadraticExtensionFieldElement multiply(PrimeFieldElement b)
this by a prime field element.b - prime field elementthis and bpublic QuadraticExtensionFieldElement multiplyOutOfPlace(PrimeFieldElement b)
this by a prime field element, where a new object
holding the result is created.b - prime field elementthis and bpublic QuadraticExtensionFieldElement multiply(BigInteger n)
GenericFieldElementthis by n.n - the factorthis and npublic QuadraticExtensionFieldElement multiplyOutOfPlace(BigInteger n)
GenericFieldElementthis by n, where a new object holding
the result is created.n - the factorthis and npublic QuadraticExtensionFieldElement multiplyByBase(GenericFieldElement b)
GenericFieldElementthis with b which is an element of the
base field.b - the second factorthis and bpublic QuadraticExtensionFieldElement multiplyByBaseOutOfPlace(GenericFieldElement b)
GenericFieldElementthis with b which is an element of the
base field, where a new object holding the result is created.b - the second factorthis and bpublic QuadraticExtensionFieldElement multiplyBy2()
PrimeCharacteristicFieldElementthis with 2.this and 2public QuadraticExtensionFieldElement multiplyBy2OutOfPlace()
PrimeCharacteristicFieldElementthis with 2 and returns a new object holding the
result.this and 2public QuadraticExtensionFieldElement multiplyBy3()
PrimeCharacteristicFieldElementthis with 3.this and 3public QuadraticExtensionFieldElement multiplyBy3OutOfPlace()
PrimeCharacteristicFieldElementthis with 3 and returns a new object holding the
result.this and 3public QuadraticExtensionFieldElement multiplyByPowerOf2(int exponent)
PrimeCharacteristicFieldElementthis by 2^n.exponent - the exponentthis and 2^npublic QuadraticExtensionFieldElement multiplyByPowerOf2OutOfPlace(int exponent)
PrimeCharacteristicFieldElementthis by 2^n and returns a new object
holding the result.exponent - the exponentthis and 2^npublic QuadraticExtensionFieldElement negate()
GenericFieldElementthis. This functions works in-place.thispublic QuadraticExtensionFieldElement negateOutOfPlace()
GenericFieldElementthis, where a new object holding the
result is created.thispublic QuadraticExtensionFieldElement add(GenericFieldElement b)
GenericFieldElementb to this. This functions works in-place.b - the second addendthis and bpublic QuadraticExtensionFieldElement addOutOfPlace(GenericFieldElement b)
PrimeCharacteristicFieldElementb - the other valuepublic QuadraticExtensionFieldElement addOutOfPlace(PrimeCharacteristicFieldElement b)
PrimeCharacteristicFieldElementb - the other valuepublic QuadraticExtensionFieldElement addOutOfPlace(ExtensionFieldElement b)
ExtensionFieldElementb - the other valuepublic QuadraticExtensionFieldElement addBase(GenericFieldElement b)
GenericFieldElementb to this where b is an element
of the underlying base field.b - the second addendthis and bpublic QuadraticExtensionFieldElement subtract(GenericFieldElement b)
GenericFieldElementb from this. This functions works in-place.b - the subtrahendthis and bpublic QuadraticExtensionFieldElement subtractOutOfPlace(GenericFieldElement b)
GenericFieldElementb from this which is an element of the
base field, where a new object holding the result is created.b - the second factorthis and bpublic QuadraticExtensionFieldElement subtractOutOfPlace(ExtensionFieldElement b)
ExtensionFieldElementb - the other valuepublic QuadraticExtensionFieldElement subtractOutOfPlace(PrimeCharacteristicFieldElement b)
PrimeCharacteristicFieldElementb from this and returns a new object
holding the result.b - the subtrahendthis and bpublic QuadraticExtensionFieldElement conjugate()
ExtensionFieldElementthispublic QuadraticExtensionFieldElement divide(GenericFieldElement b)
ExtensionFieldElementthis and another field elements.
You have no guarantee that b remains unchanged.
b - the divisorthis and bpublic QuadraticExtensionFieldElement divideBy2()
PrimeCharacteristicFieldElementthis by 2.this divided by 2.public QuadraticExtensionFieldElement square()
GenericFieldElementthis in-place.thispublic QuadraticExtensionFieldElement squareOutOfPlace()
GenericFieldElementthis, where a new object holding the
result is created.thispublic QuadraticExtensionFieldElement squareRoot()
GenericFieldElementthis in-place.this or null if the
square root does not exist.public QuadraticExtensionFieldElement squareRoot(boolean checkSquare)
PrimeCharacteristicFieldElementthis.checkSquare - check if a is a square. If true, the
return value is undefined for non-squares.thispublic QuadraticExtensionFieldElement exponentiate(BigInteger n)
GenericFieldElementthis to the power n.
Works in-place.n - the exponentnth power of thispublic QuadraticExtensionFieldElement exponentiate(int n)
GenericFieldElementthis to the power n.
Works in-place.n - the exponentnth power of thispublic QuadraticExtensionFieldElement exponentiateOutOfPlace(BigInteger n)
GenericFieldElementthis to the power n.n - the exponentnth power of thispublic QuadraticExtensionFieldElement exponentiateOutOfPlace(int n)
GenericFieldElementthis to the power n.n - the exponentnth power of thispublic QuadraticExtensionFieldElement exponentiateByPowerOf2(int exponent)
GenericFieldElementthis to the power of 2^n.exponent - the exponentn-th power of this.public QuadraticExtensionFieldElement conjugate(int i)
ExtensionFieldElementi times.i - number of times this should be conjugatedthispublic QuadraticExtensionFieldElement applyFrobenius(int i)
ExtensionFieldElementi-th Frobenius of this.i - number of times the Frobenius map should be appliedi-times to this
..public PrimeFieldElement getNorm()
ExtensionFieldElementthis, which is an element of the base
field.apublic QuadraticExtensionFieldElement multiplyByAdjointRoot()
ExtensionFieldElementthis by the root used to obtain the extension field.this multiplied by the adjoint root.public QuadraticExtensionFieldElement multiplyByAdjointRootOutOfPlace()
this and the adjoint rootpublic int getQuadraticCharacter()
PrimeCharacteristicFieldElementthis is a quadratic non-residue, a multiple of the modulus, or
a quadratic residue.(this/p)public boolean isOne()
GenericFieldElementthis is one.this is the one elementpublic boolean isZero()
GenericFieldElementthis is zero.this is the zero elementpublic Object toBigIntegers()
ExtensionFieldElementBigInteger-array representation of
this instance.BigInteger-array representationpublic iaik.security.ec.math.field.AbstractQuadraticExtensionField getField()
GenericFieldElementpublic int hashCode()
hashCode in interface GenericFieldElementhashCode in class Objectpublic boolean equals(Object obj)
equals in interface GenericFieldElementequals in class Objectpublic QuadraticExtensionFieldElement clone()
ExtensionFieldElementclone in interface ExtensionFieldElementclone in interface GenericFieldElementclone in interface PrimeCharacteristicFieldElementpublic String toString()
toString in interface GenericFieldElementtoString in class Objectpublic PrimeFieldElement[] getValuesRecursive()
ExtensionFieldElementthis. This calls
ExtensionFieldElement.getValues() recursively.
They values are sorted from the coefficients of the lowest power to the the
highest power.getValuesRecursive in interface ExtensionFieldElementthis.public byte[] toByteArray()
ExtensionFieldElementbyte-array representation of this instance.toByteArray in interface ExtensionFieldElementtoByteArray in interface GenericFieldElementbyte-array representationCopyright © 2011–2022 Stiftung SIC. All rights reserved.