public class RingUnitGroupImpl extends RingGroupImpl
The unit group consists of the set of elements with a multiplicative inverse. The group operation is multiplication and the neutral element is called the one element.
| Modifier and Type | Class and Description |
|---|---|
class |
RingUnitGroupImpl.RingUnitGroupElementImpl
A ring element interpreted as an element of the ring's unit group.
|
RingGroupImpl.RingGroupElementImplring| Constructor and Description |
|---|
RingUnitGroupImpl(Representation repr) |
RingUnitGroupImpl(Ring ring) |
| Modifier and Type | Method and Description |
|---|---|
double |
estimateCostInvPerOp()
Estimates the number of inversions that can be done per group operation for the same cost.
|
RingGroupImpl.RingGroupElementImpl |
getElement(RingElement ringElement)
Creates an element of this group from the given ring element.
|
GroupElementImpl |
getGenerator()
Returns any generator of this group if the group is cyclic and it's feasible to compute a generator.
|
RingUnitGroupImpl.RingUnitGroupElementImpl |
getNeutralElement()
Returns the neutral element of this group.
|
RingUnitGroupImpl.RingUnitGroupElementImpl |
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. |
boolean |
hasPrimeSize()
Returns true if the size of this structure is known and prime.
|
boolean |
isCommutative()
Returns true if this group is known to be commutative.
|
RingUnitGroupImpl.RingUnitGroupElementImpl |
restoreElement(Representation repr)
Restores a group element from its representation.
|
java.math.BigInteger |
size()
Retrieves number of elements in the group if possible.
|
equals, getRepresentation, getRing, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitexp, getUniformlyRandomNonNeutral, implementsOwnExp, implementsOwnMultiExp, multiexp, restoreFromRepresentationpublic RingUnitGroupImpl(Ring ring)
public RingUnitGroupImpl(Representation repr)
public RingGroupImpl.RingGroupElementImpl getElement(RingElement ringElement)
RingGroupImplgetElement in class RingGroupImplringElement - the ring element to convertpublic java.math.BigInteger size()
throws java.lang.UnsupportedOperationException
GroupImpljava.lang.UnsupportedOperationException - if the number of elements is unknown or is too expensive to computepublic boolean hasPrimeSize()
GroupImplpublic double estimateCostInvPerOp()
GroupImpl2 would mean that an inversion costs half as much as a group operation, on average.public RingUnitGroupImpl.RingUnitGroupElementImpl getNeutralElement()
GroupImplpublic RingUnitGroupImpl.RingUnitGroupElementImpl getUniformlyRandomElement() throws java.lang.UnsupportedOperationException
GroupImpljava.lang.UnsupportedOperationException - if the random generation cannot be donepublic RingUnitGroupImpl.RingUnitGroupElementImpl restoreElement(Representation repr)
GroupImplpublic GroupElementImpl getGenerator() throws java.lang.UnsupportedOperationException
GroupImplRepeated calls may or may not always supply the same generator again (i.e. the output is not guaranteed to be random)!
java.lang.UnsupportedOperationException - if group is not cyclic or it's too hard to compute a generatorpublic 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.
getUniqueByteRepresentation(),
or an empty Optional, if no guaranteepublic boolean isCommutative()
GroupImpl