public class Zp.ZpElement extends Zn.ZnElement implements FieldElement
Zp.ZnElementv| Constructor and Description |
|---|
ZpElement(java.math.BigInteger v) |
| Modifier and Type | Method and Description |
|---|---|
Zp.ZpElement |
add(Element e)
Computes \(\text{this} + e\).
|
FieldElement |
applyFrobenius()
Computes this^characteristic.
|
Zp.ZpElement |
div(Element e)
Computes \(\text{this} / e = \text{this} \cdot e^{-1}\).
|
Zp |
getStructure()
Returns the
Structure that this Element belongs to. |
Zp.ZpElement |
inv()
Computes the multiplicative inverse of this element.
|
boolean |
isSquare()
Returns true if there is a \(y \in \mathbb{Z}_p\) such that \(y^2 = \text{this}\)
|
Zp.ZpElement |
mul(java.math.BigInteger k)
Computes \(\text{this} \cdot k\) (equivalent to \(\text{this} + \text{this} + \cdots\) k-times).
|
Zp.ZpElement |
mul(Element e)
Computes \(\text{this} \cdot e\).
|
Zp.ZpElement |
mul(long k)
Computes \(\text{this} \cdot k\) (equivalent to \(\text{this} + \text{this} + \cdots\) k-times).
|
Zp.ZpElement |
neg()
Computes the additive inverse of this element.
|
Zp.ZpElement |
pow(java.math.BigInteger k)
Calculates \(\text{this}^k\).
|
Zp.ZpElement |
pow(long k)
Calculates \(\text{this}^k\).
|
Zp.ZpElement |
sqrt()
Computes a square root of this element if it exists.
|
Zp.ZpElement |
square()
Computes \(\text{this}^2\).
|
Zp.ZpElement |
sub(Element e)
Computes \(\text{this} - e\).
|
add, asExponentExpression, asInteger, checkSameModulus, divides, divideWithRemainder, equals, getRank, getRepresentation, hashCode, isEqualTo, isEqualTo, isEqualTo, isEqualTo, mul, pow, sub, toString, updateAccumulatorclone, finalize, getClass, notify, notifyAll, wait, wait, waitapplyFrobenius, divides, divideWithRemainder, getRankasInteger, isOne, isUnit, isZero, toAdditiveGroupElement, toUnitGroupElementgetRepresentationgetUniqueByteRepresentation, updateAccumulatorpublic Zp getStructure()
ElementStructure that this Element belongs to.getStructure in interface ElementgetStructure in interface FieldElementgetStructure in interface RingElementgetStructure in class Zn.ZnElementpublic Zp.ZpElement add(Element e)
RingElementadd in interface FieldElementadd in interface RingElementadd in class Zn.ZnElemente - the addendpublic Zp.ZpElement sub(Element e)
RingElementsub in interface FieldElementsub in interface RingElementsub in class Zn.ZnElemente - the subtrahendpublic Zp.ZpElement neg()
RingElementneg in interface FieldElementneg in interface RingElementneg in class Zn.ZnElementpublic Zp.ZpElement mul(Element e)
RingElementmul in interface FieldElementmul in interface RingElementmul in class Zn.ZnElemente - the factorpublic Zp.ZpElement mul(java.math.BigInteger k)
RingElementmul in interface FieldElementmul in interface RingElementmul in class Zn.ZnElementk - the factorpublic Zp.ZpElement mul(long k)
RingElementmul in interface FieldElementmul in interface RingElementmul in class Zn.ZnElementk - the factorpublic Zp.ZpElement inv() throws java.lang.UnsupportedOperationException
RingElementinv in interface FieldElementinv in interface RingElementinv in class Zn.ZnElementjava.lang.UnsupportedOperationException - if this is not a unitpublic Zp.ZpElement square()
RingElementUseful if the ring allows squaring to be more efficiently implemented than general exponentiation.
square in interface FieldElementsquare in interface RingElementsquare in class Zn.ZnElementpublic Zp.ZpElement div(Element e) throws java.lang.IllegalArgumentException
RingElementdiv in interface FieldElementdiv in interface RingElementdiv in class Zn.ZnElemente - the divisorjava.lang.IllegalArgumentException - if e is not a unitpublic Zp.ZpElement pow(java.math.BigInteger k)
RingElementNote that \(a^0 = 1\) for any \(a\) in the ring, particularly \(0^0 = 1\).
pow in interface FieldElementpow in interface RingElementpow in class Zn.ZnElementpublic Zp.ZpElement pow(long k)
RingElementNote that \(a^0 = 1\) for any \(a\) in the ring, particularly \(0^0 = 1\).
pow in interface FieldElementpow in interface RingElementpow in class Zn.ZnElementpublic boolean isSquare()
public Zp.ZpElement sqrt() throws java.lang.ArithmeticException
java.lang.ArithmeticException - if element is not a quadratic residuepublic FieldElement applyFrobenius()
FieldElementapplyFrobenius in interface FieldElement