public abstract class PairingTargetGroupImpl extends java.lang.Object implements GroupImpl, Representable
When initialized with (finite) ExtensionField f and prime number "size", it represents the unique subgroup of the unit group of f of size "size".
| Modifier and Type | Field and Description |
|---|---|
protected ExtensionField |
fieldOfDefinition |
protected java.math.BigInteger |
size |
| Constructor and Description |
|---|
PairingTargetGroupImpl(ExtensionField f,
java.math.BigInteger size)
Construct target group as subgroup of field f of given size.
|
PairingTargetGroupImpl(Representation r) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.math.BigInteger |
getCofactor() |
abstract PairingTargetGroupElementImpl |
getElement(ExtensionFieldElement fe)
Concrete implementations should wrap the extension field element into their subclass.
|
ExtensionField |
getFieldOfDefinition() |
PairingTargetGroupElementImpl |
getGenerator()
Returns any generator of this group if the group is cyclic and it's feasible to compute a generator.
|
PairingTargetGroupElementImpl |
getNeutralElement()
Returns the neutral element of this group.
|
Representation |
getRepresentation()
The representation of this object.
|
PairingTargetGroupElementImpl |
getUniformlyRandomElement()
Generates a uniformly random element of this group.
|
java.util.Optional<java.lang.Integer> |
getUniqueByteLength()
Returns the number of bytes returned by this structure's
UniqueByteRepresentable.getUniqueByteRepresentation(),
or an empty Optional if this structure's elements do not guarantee a fixed length. |
int |
hashCode() |
protected void |
init(Representation r) |
boolean |
isCommutative()
Returns true if this group is known to be commutative.
|
PairingTargetGroupElementImpl |
restoreElement(Representation repr)
Restores a group element from its representation.
|
java.math.BigInteger |
size()
Retrieves number of elements in the group if possible.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitestimateCostInvPerOp, exp, getUniformlyRandomNonNeutral, hasPrimeSize, implementsOwnExp, implementsOwnMultiExp, multiexp, restoreFromRepresentationprotected ExtensionField fieldOfDefinition
protected java.math.BigInteger size
public PairingTargetGroupImpl(ExtensionField f, java.math.BigInteger size)
f - - field for embedding to new groupsize - - size of new grouppublic PairingTargetGroupImpl(Representation r)
public ExtensionField getFieldOfDefinition()
public java.math.BigInteger getCofactor()
public java.math.BigInteger size()
throws java.lang.UnsupportedOperationException
GroupImplpublic Representation getRepresentation()
RepresentableReprUtilgetRepresentation in interface RepresentableRepresentationprotected void init(Representation r)
public PairingTargetGroupElementImpl getNeutralElement()
GroupImplgetNeutralElement in interface GroupImplpublic PairingTargetGroupElementImpl getUniformlyRandomElement() throws java.lang.UnsupportedOperationException
GroupImplgetUniformlyRandomElement in interface GroupImpljava.lang.UnsupportedOperationException - if the random generation cannot be donepublic PairingTargetGroupElementImpl getGenerator()
GroupImplRepeated calls may or may not always supply the same generator again (i.e. the output is not guaranteed to be random)!
getGenerator in interface GroupImplpublic PairingTargetGroupElementImpl restoreElement(Representation repr)
GroupImplrestoreElement in interface GroupImplpublic abstract PairingTargetGroupElementImpl getElement(ExtensionFieldElement fe)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Optional<java.lang.Integer> getUniqueByteLength()
GroupImplUniqueByteRepresentable.getUniqueByteRepresentation(),
or an empty Optional if this structure's elements do not guarantee a fixed length.
For example, elements of Zp will always be represented by ceil(ceil(log(p))/8) bytes,
hence getUniqueByteLength() would return ceil(ceil(log(p))/8).
A polynomial ring would return an empty Optional since a polynomial's unique byte representation length
depends on its degree.
getUniqueByteLength in interface GroupImplgetUniqueByteRepresentation(),
or an empty Optional, if no guaranteepublic boolean isCommutative()
GroupImplisCommutative in interface GroupImpl