public interface Group extends Structure, RepresentationRestorer
| Modifier and Type | Method and Description |
|---|---|
default GroupElementExpression |
expr()
Returns a GroupElementExpression containing the neutral group element.
|
default GroupElement |
getGenerator()
Returns any generator of this group if the group is cyclic and it's feasible to compute a generator.
|
GroupElement |
getNeutralElement()
Returns the neutral element for this group
|
GroupElement |
getUniformlyRandomElement()
Returns an element of this structure that is drawn uniformly at random
using a cryptographically strong RNG.
|
default GroupElementVector |
getUniformlyRandomElements(int n)
Returns n elements of this structure that are drawn uniformly and independently at random
using a cryptographically strong RNG.
|
default Zn.ZnElement |
getUniformlyRandomExponent()
Returns a random integer between
0 and size()-1 (inclusive) using a cryptographically strong RNG. |
default RingElementVector |
getUniformlyRandomExponents(int n)
Returns n random integers between
0 and size()-1 (inclusive) using a cryptographically strong RNG. |
default GroupElement |
getUniformlyRandomNonNeutral()
Generates a uniformly random non-neutral element of this group using a cryptographically strong RNG.
|
default GroupElementVector |
getUniformlyRandomNonNeutrals(int n)
Generates
n uniformly random non-neutral element of this group using a cryptographically strong RNG. |
default Zn.ZnElement |
getUniformlyRandomNonzeroExponent()
Returns a random integer between
1 and size()-1 (inclusive) using a cryptographically strong RNG. |
default RingElementVector |
getUniformlyRandomNonzeroExponents(int n)
Returns n random integers between
1 and size()-1 (inclusive) using a cryptographically strong RNG. |
default Zn.ZnElement |
getUniformlyRandomUnitExponent()
Returns a random integer invertible mod
size() using a cryptographically strong RNG. |
default RingElementVector |
getUniformlyRandomUnitExponents(int n)
Returns n random integers invertible mod
size() using a cryptographically strong RNG. |
default Zn |
getZn()
Returns
Zn, where n == size(). |
boolean |
isCommutative()
Returns true if this group is known to be commutative.
|
GroupElement |
restoreElement(Representation repr)
Creates an element of this structure from its representation.
|
default java.lang.Object |
restoreFromRepresentation(java.lang.reflect.Type type,
Representation repr)
Takes a representation and creates an object of the given type from it if the type is supported by the restorer.
|
default GroupElementVector |
restoreVector(Representation repr)
Restores a
GroupElementVector containing group elements from this Group from a
Representation of that vector. |
getUniqueByteLength, hasPrimeSize, sizegetRepresentationGroupElement getNeutralElement()
GroupElement getUniformlyRandomElement() throws java.lang.UnsupportedOperationException
StructuregetUniformlyRandomElement in interface Structurejava.lang.UnsupportedOperationException - if the operation is not supporteddefault GroupElementVector getUniformlyRandomElements(int n) throws java.lang.UnsupportedOperationException
StructuregetUniformlyRandomElements in interface Structurejava.lang.UnsupportedOperationException - if the operation is not supporteddefault GroupElement getUniformlyRandomNonNeutral()
default GroupElementVector getUniformlyRandomNonNeutrals(int n)
n uniformly random non-neutral element of this group using a cryptographically strong RNG.GroupElement restoreElement(Representation repr)
StructurerestoreElement in interface Structurerepr - the Representation returned by Representable.getRepresentation()default GroupElementVector restoreVector(Representation repr)
GroupElementVector containing group elements from this Group from a
Representation of that vector.repr - a representation of a GroupElementVector
(obtained via GroupElementVector.getRepresentation()).default GroupElement getGenerator() throws java.lang.UnsupportedOperationException
Repeated 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 the group doesn't know or have a generatorboolean isCommutative()
default GroupElementExpression expr()
default java.lang.Object restoreFromRepresentation(java.lang.reflect.Type type,
Representation repr)
RepresentationRestorerrestoreFromRepresentation in interface RepresentationRestorertype - tells the restorer which type the restored object should haverepr - the representation to restore the object fromdefault Zn getZn()
Zn, where n == size().default Zn.ZnElement getUniformlyRandomExponent()
0 and size()-1 (inclusive) using a cryptographically strong RNG.default RingElementVector getUniformlyRandomExponents(int n)
0 and size()-1 (inclusive) using a cryptographically strong RNG.default Zn.ZnElement getUniformlyRandomUnitExponent()
size() using a cryptographically strong RNG.default RingElementVector getUniformlyRandomUnitExponents(int n)
size() using a cryptographically strong RNG.default Zn.ZnElement getUniformlyRandomNonzeroExponent()
1 and size()-1 (inclusive) using a cryptographically strong RNG.default RingElementVector getUniformlyRandomNonzeroExponents(int n)
1 and size()-1 (inclusive) using a cryptographically strong RNG.