public interface PrimeCharacteristicField extends GenericField
PrimeCharacteristicFieldElement
,
PrimeField
equals, exponentiate, getBaseField, getCardinality, getFieldType, hashCode, invertElements, multiplyOutOfPlace, multiplyOutOfPlace, negateOutOfPlace, squareOutOfPlace
getFieldSize
PrimeCharacteristicFieldElement divideBy2(PrimeCharacteristicFieldElement a)
a
by 2.a
- the dividenda
and 2.PrimeCharacteristicFieldElement multiplyBy2(PrimeCharacteristicFieldElement a)
a
by 2
, which is a left-shift. Works in-place.a
- the element to be shifteda
holding the resultPrimeCharacteristicFieldElement multiplyBy2OutOfPlace(PrimeCharacteristicFieldElement a)
a
by 2
, which is a left-shift and
returns a new object holding the result.a
- the element to be shifteda
holding the resultPrimeCharacteristicFieldElement multiplyBy3(PrimeCharacteristicFieldElement a)
a
by 3
, which is a left-shift plus an
addition. Works in-place.a
- the element to multiplieda
holding the resultPrimeCharacteristicFieldElement multiplyBy3OutOfPlace(PrimeCharacteristicFieldElement a)
a
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 resultPrimeCharacteristicFieldElement multiplyByPowerOf2(PrimeCharacteristicFieldElement a, int exponent)
a
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 resultPrimeCharacteristicFieldElement multiplyByPowerOf2OutOfPlace(PrimeCharacteristicFieldElement a, int exponent)
a
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 resultPrimeCharacteristicFieldElement getZero()
GenericField
getZero
in interface GenericField
PrimeCharacteristicFieldElement getOne()
GenericField
getOne
in interface GenericField
PrimeCharacteristicFieldElement add(GenericFieldElement a, GenericFieldElement b)
GenericField
b
to a
, i.e. performs the operation
a += b
.add
in interface GenericField
a
- the first addendb
- the second addenda
and b
PrimeCharacteristicFieldElement addOutOfPlace(PrimeCharacteristicFieldElement a, PrimeCharacteristicFieldElement b)
a
- first summandb
- second summandPrimeCharacteristicFieldElement subtract(GenericFieldElement a, GenericFieldElement b)
GenericField
b
from a
, i.e. performs the operation
a -= b
.subtract
in interface GenericField
a
- the minuendb
- the subtrahenda
and b
PrimeCharacteristicFieldElement subtractOutOfPlace(GenericFieldElement a, GenericFieldElement b)
b
from this
and returns a new object
holding the result.a
- the minuendb
- the subtrahenda
and b
PrimeCharacteristicFieldElement negate(GenericFieldElement a)
GenericField
a
, i.e. performs the operation b = -b
.negate
in interface GenericField
a
- the field elementa
PrimeCharacteristicFieldElement multiply(GenericFieldElement a, BigInteger n)
GenericField
a
by n
, i.e. performs the operation
a *= n
.multiply
in interface GenericField
a
- the first factorn
- the second factora
and n
PrimeCharacteristicFieldElement multiply(GenericFieldElement a, GenericFieldElement b)
GenericField
a
by b
, i.e. performs the operation
a *= b
.multiply
in interface GenericField
a
- the first factorb
- the second factora
and b
PrimeCharacteristicFieldElement square(GenericFieldElement a)
GenericField
a
, i.e. performs the operation a *= a
.square
in interface GenericField
a
- the field elementa
PrimeCharacteristicFieldElement exponentiate(GenericFieldElement a, BigInteger n)
GenericField
a
to the power n
, i.e. performs the
operation a = a^n
.exponentiate
in interface GenericField
a
- the field elementn
- the exponentn
th power of
a
PrimeCharacteristicFieldElement divide(GenericFieldElement a, GenericFieldElement b)
GenericField
a
by b
, i.e. performs the operation
a /= b
.divide
in interface GenericField
a
- the dividendb
- the divisora
and b
PrimeCharacteristicFieldElement exponentiateByPowerOf2(GenericFieldElement a, int n)
GenericField
a
to the power 2n
.exponentiateByPowerOf2
in interface GenericField
a
- the field elementn
- the exponentPrimeCharacteristicFieldElement invert(GenericFieldElement a)
GenericField
a
, i.e. performs the operation
a = a^(-1)
.invert
in interface GenericField
a
- the field elementa
PrimeCharacteristicFieldElement newElement(byte[] bytes)
GenericField
byte
-array representation.newElement
in interface GenericField
bytes
- the byte[]
in little-endian orderPrimeCharacteristicFieldElement toElement(byte[] bytes)
GenericField
byte
-array. Unlike
GenericField.newElement(byte[])
, this method does not assume the
input to be a valid encoding of a field element.toElement
in interface GenericField
bytes
- a byte[]
in little-endian orderint getQuadraticCharacter(PrimeCharacteristicFieldElement a)
a
is a quadratic non-residue, a multiple of the
modulus, or a quadratic residue.a
- a field element(a/p)
PrimeCharacteristicFieldElement getUniformlyRandomElement()
PrimeCharacteristicFieldElement getUniformlyRandomNonZeroElement()
Copyright © 2011–2022 Stiftung SIC. All rights reserved.