public class RingAdditiveGroupImpl extends RingGroupImpl
| Modifier and Type | Class and Description |
|---|---|
class |
RingAdditiveGroupImpl.RingAdditiveGroupElementImpl
A ring element interpreted as an element of the ring's additive group.
|
RingGroupImpl.RingGroupElementImplring| Constructor and Description |
|---|
RingAdditiveGroupImpl(Representation repr) |
RingAdditiveGroupImpl(Ring ring)
Instantiates this ring additive group.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
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.
|
RingAdditiveGroupImpl.RingAdditiveGroupElementImpl |
getGenerator()
Returns any generator of this group if the group is cyclic and it's feasible to compute a generator.
|
RingAdditiveGroupImpl.RingAdditiveGroupElementImpl |
getNeutralElement()
Returns the neutral element of this group.
|
RingAdditiveGroupImpl.RingAdditiveGroupElementImpl |
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() |
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.
|
RingAdditiveGroupImpl.RingAdditiveGroupElementImpl |
restoreElement(Representation repr)
Restores a group element from its representation.
|
java.math.BigInteger |
size()
Retrieves number of elements in the group if possible.
|
getRepresentation, getRing, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitexp, getUniformlyRandomNonNeutral, implementsOwnExp, implementsOwnMultiExp, multiexp, restoreFromRepresentationpublic RingAdditiveGroupImpl(Ring ring)
ring - the base ring to usepublic RingAdditiveGroupImpl(Representation repr)
public 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 RingAdditiveGroupImpl.RingAdditiveGroupElementImpl getNeutralElement()
GroupImplpublic RingAdditiveGroupImpl.RingAdditiveGroupElementImpl getUniformlyRandomElement() throws java.lang.UnsupportedOperationException
GroupImpljava.lang.UnsupportedOperationException - if the random generation cannot be donepublic RingAdditiveGroupImpl.RingAdditiveGroupElementImpl 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 boolean equals(java.lang.Object obj)
equals in class RingGroupImplpublic int hashCode()
hashCode in class RingGroupImplpublic RingGroupImpl.RingGroupElementImpl getElement(RingElement ringElement)
RingGroupImplgetElement in class RingGroupImplringElement - the ring element to convertpublic RingAdditiveGroupImpl.RingAdditiveGroupElementImpl restoreElement(Representation repr)
GroupImplpublic 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