public interface PrimeCharacteristicFieldElement extends GenericFieldElement
Modifier and Type | Method and Description |
---|---|
PrimeCharacteristicFieldElement |
add(GenericFieldElement b)
Adds
b to this . |
PrimeCharacteristicFieldElement |
addBase(GenericFieldElement b)
Adds
b to this where b is an element
of the underlying base field. |
PrimeCharacteristicFieldElement |
addOutOfPlace(GenericFieldElement b)
Adds two elements and returns a new object holding the result.
|
PrimeCharacteristicFieldElement |
addOutOfPlace(PrimeCharacteristicFieldElement b)
Adds two elements and returns a new object holding the result.
|
PrimeCharacteristicFieldElement |
clone()
Clones the value of this field element.
|
PrimeCharacteristicFieldElement |
divide(GenericFieldElement b)
Divides
this and another field elements. |
PrimeCharacteristicFieldElement |
divideBy2()
Divides
this by 2. |
PrimeCharacteristicFieldElement |
exponentiate(BigInteger n)
Raises
this to the power n . |
PrimeCharacteristicFieldElement |
exponentiate(int n)
Raises
this to the power n . |
PrimeCharacteristicFieldElement |
exponentiateByPowerOf2(int n)
Raise
this to the power of 2^n . |
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 |
invert()
Sets
this to its inverse. |
PrimeCharacteristicFieldElement |
multiply(BigInteger b)
Multiples
this by n . |
PrimeCharacteristicFieldElement |
multiply(GenericFieldElement b)
Multiplies
this with b which is an element of the
same field. |
PrimeCharacteristicFieldElement |
multiplyBy2()
Multiplies
this with 2. |
PrimeCharacteristicFieldElement |
multiplyBy2OutOfPlace()
Multiplies
this with 2 and returns a new object holding the
result. |
PrimeCharacteristicFieldElement |
multiplyBy3()
Multiplies
this with 3. |
PrimeCharacteristicFieldElement |
multiplyBy3OutOfPlace()
Multiplies
this with 3 and returns a new object holding the
result. |
PrimeCharacteristicFieldElement |
multiplyByBase(GenericFieldElement b)
Multiplies
this with b which is an element of the
base field. |
PrimeCharacteristicFieldElement |
multiplyByBaseOutOfPlace(GenericFieldElement b)
Multiplies
this with b which is an element of the
base field, where a new object holding the result is created. |
PrimeCharacteristicFieldElement |
multiplyByPowerOf2(int n)
Multiplies
this by 2^n . |
PrimeCharacteristicFieldElement |
multiplyByPowerOf2OutOfPlace(int n)
Multiplies
this by 2^n and returns a new object
holding the result. |
PrimeCharacteristicFieldElement |
multiplyOutOfPlace(BigInteger b)
Multiples
this by n , where a new object holding
the result is created. |
PrimeCharacteristicFieldElement |
multiplyOutOfPlace(GenericFieldElement b)
Multiplies
this with b which is an element of the
same field, where a new object holding the result is created. |
PrimeCharacteristicFieldElement |
negate()
Returns the negative of
this . |
PrimeCharacteristicFieldElement |
negateOutOfPlace()
Returns the negative of
this , where a new object holding the
result is created. |
PrimeCharacteristicFieldElement |
square()
Computes the square of
this in-place. |
PrimeCharacteristicFieldElement |
squareOutOfPlace()
Computes the square of
this , where a new object holding the
result is created. |
PrimeCharacteristicFieldElement |
squareRoot()
Computes the square root of
this in-place. |
PrimeCharacteristicFieldElement |
squareRoot(boolean checkSquare)
Computes the square root of
this . |
PrimeCharacteristicFieldElement |
subtract(GenericFieldElement b)
Subtracts
b from this . |
PrimeCharacteristicFieldElement |
subtractOutOfPlace(GenericFieldElement b)
Subtracts
b from this which is an element of the
base field, where a new object holding the result is created. |
PrimeCharacteristicFieldElement |
subtractOutOfPlace(PrimeCharacteristicFieldElement b)
Subtracts
b from this and returns a new object
holding the result. |
equals, exponentiateOutOfPlace, exponentiateOutOfPlace, getField, hashCode, isOne, isZero, toByteArray, toString
PrimeCharacteristicFieldElement multiplyBy2()
this
with 2.this
and 2PrimeCharacteristicFieldElement multiplyBy2OutOfPlace()
this
with 2 and returns a new object holding the
result.this
and 2PrimeCharacteristicFieldElement multiplyBy3()
this
with 3.this
and 3PrimeCharacteristicFieldElement multiplyBy3OutOfPlace()
this
with 3 and returns a new object holding the
result.this
and 3PrimeCharacteristicFieldElement multiplyByPowerOf2(int n)
this
by 2^n
.n
- the exponentthis
and 2^nPrimeCharacteristicFieldElement multiplyByPowerOf2OutOfPlace(int n)
this
by 2^n
and returns a new object
holding the result.n
- the exponentthis
and 2^nPrimeCharacteristicFieldElement divideBy2()
this
by 2.this
divided by 2.PrimeCharacteristicFieldElement add(GenericFieldElement b)
GenericFieldElement
b
to this
. This functions works in-place.add
in interface GenericFieldElement
b
- the second addendthis
and b
PrimeCharacteristicFieldElement addOutOfPlace(GenericFieldElement b)
addOutOfPlace
in interface GenericFieldElement
b
- the other valuePrimeCharacteristicFieldElement addOutOfPlace(PrimeCharacteristicFieldElement b)
b
- the other valuePrimeCharacteristicFieldElement multiply(GenericFieldElement b)
GenericFieldElement
this
with b
which is an element of the
same field.multiply
in interface GenericFieldElement
b
- the second factorthis
and b
PrimeCharacteristicFieldElement multiply(BigInteger b)
GenericFieldElement
this
by n
.multiply
in interface GenericFieldElement
b
- the factorthis
and n
PrimeCharacteristicFieldElement multiplyOutOfPlace(GenericFieldElement b)
GenericFieldElement
this
with b
which is an element of the
same field, where a new object holding the result is created.multiplyOutOfPlace
in interface GenericFieldElement
b
- the second factorthis
and b
PrimeCharacteristicFieldElement multiplyOutOfPlace(BigInteger b)
GenericFieldElement
this
by n
, where a new object holding
the result is created.multiplyOutOfPlace
in interface GenericFieldElement
b
- the factorthis
and n
PrimeCharacteristicFieldElement multiplyByBase(GenericFieldElement b)
GenericFieldElement
this
with b
which is an element of the
base field.multiplyByBase
in interface GenericFieldElement
b
- the second factorthis
and b
PrimeCharacteristicFieldElement multiplyByBaseOutOfPlace(GenericFieldElement b)
GenericFieldElement
this
with b
which is an element of the
base field, where a new object holding the result is created.multiplyByBaseOutOfPlace
in interface GenericFieldElement
b
- the second factorthis
and b
PrimeCharacteristicFieldElement square()
GenericFieldElement
this
in-place.square
in interface GenericFieldElement
this
PrimeCharacteristicFieldElement squareOutOfPlace()
GenericFieldElement
this
, where a new object holding the
result is created.squareOutOfPlace
in interface GenericFieldElement
this
PrimeCharacteristicFieldElement addBase(GenericFieldElement b)
GenericFieldElement
b
to this
where b
is an element
of the underlying base field.addBase
in interface GenericFieldElement
b
- the second addendthis
and b
PrimeCharacteristicFieldElement exponentiate(BigInteger n)
GenericFieldElement
this
to the power n
.
Works in-place.exponentiate
in interface GenericFieldElement
n
- the exponentn
th power of this
PrimeCharacteristicFieldElement exponentiate(int n)
GenericFieldElement
this
to the power n
.
Works in-place.exponentiate
in interface GenericFieldElement
n
- the exponentn
th power of this
PrimeCharacteristicFieldElement exponentiateByPowerOf2(int n)
GenericFieldElement
this
to the power of 2^n
.exponentiateByPowerOf2
in interface GenericFieldElement
n
- the exponentn
-th power of this
.PrimeCharacteristicFieldElement subtract(GenericFieldElement b)
GenericFieldElement
b
from this
. This functions works in-place.subtract
in interface GenericFieldElement
b
- the subtrahendthis
and b
PrimeCharacteristicFieldElement subtractOutOfPlace(GenericFieldElement b)
GenericFieldElement
b
from this
which is an element of the
base field, where a new object holding the result is created.subtractOutOfPlace
in interface GenericFieldElement
b
- the second factorthis
and b
PrimeCharacteristicFieldElement subtractOutOfPlace(PrimeCharacteristicFieldElement b)
b
from this
and returns a new object
holding the result.b
- the subtrahendthis
and b
PrimeCharacteristicFieldElement negate()
GenericFieldElement
this
. This functions works in-place.negate
in interface GenericFieldElement
this
PrimeCharacteristicFieldElement negateOutOfPlace()
GenericFieldElement
this
, where a new object holding the
result is created.negateOutOfPlace
in interface GenericFieldElement
this
PrimeCharacteristicFieldElement divide(GenericFieldElement b)
GenericFieldElement
this
and another field elements.divide
in interface GenericFieldElement
b
- the divisorthis
and b
PrimeCharacteristicFieldElement invert()
GenericFieldElement
this
to its inverse.invert
in interface GenericFieldElement
this
PrimeCharacteristicFieldElement squareRoot()
GenericFieldElement
this
in-place.squareRoot
in interface GenericFieldElement
this
or null
if the
square root does not exist.PrimeCharacteristicFieldElement squareRoot(boolean checkSquare)
this
.checkSquare
- check if a
is a square. If true
, the
return value is undefined for non-squares.this
int getQuadraticCharacter()
this
is a quadratic non-residue, a multiple of the modulus, or
a quadratic residue.(this/p)
PrimeCharacteristicFieldElement clone()
GenericFieldElement
clone
in interface GenericFieldElement
Copyright © 2011–2022 Stiftung SIC. All rights reserved.