public class BooleanStructure extends java.lang.Object implements Ring
| Constructor and Description |
|---|
BooleanStructure() |
BooleanStructure(Representation repr) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
java.math.BigInteger |
getCharacteristic()
Returns the characteristic of the ring.
|
RingElement |
getElement(java.math.BigInteger i)
Maps the integer i into this ring \(R\), such that this map is a
ring homomorphism \(\mathbb{Z}_{\text{getCharacteristic()}} \rightarrow R\).
|
RingElement |
getOneElement()
Returns the multiplicative neutral element of this ring.
|
Representation |
getRepresentation()
The representation of this object.
|
RingElement |
getUniformlyRandomElement()
Returns an element of this structure that is drawn uniformly at random
using a cryptographically strong RNG.
|
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. |
RingElement |
getZeroElement()
Returns the additive neutral element of this ring.
|
int |
hashCode() |
boolean |
isCommutative()
Returns true if this ring is known to be commutative.
|
RingElement |
restoreElement(Representation repr)
Creates an element of this structure from its representation.
|
java.math.BigInteger |
size()
Returns the number of elements in this structure (the size).
|
java.math.BigInteger |
sizeUnitGroup()
Returns the number of units in this ring.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitasAdditiveGroup, asUnitGroup, extendedEuclideanAlgorithm, extendedEuclideanAlgorithm, getElement, getUniformlyRandomElements, getUniformlyRandomNonzeroElement, getUniformlyRandomNonzeroElements, getUniformlyRandomUnit, getUniformlyRandomUnits, restoreFromRepresentation, restoreVectorhasPrimeSizepublic BooleanStructure()
public BooleanStructure(Representation repr)
public java.math.BigInteger sizeUnitGroup()
throws java.lang.UnsupportedOperationException
RingsizeUnitGroup in interface Ringjava.lang.UnsupportedOperationException - if size is unknown or is computationally too expensive to computepublic RingElement getZeroElement()
RinggetZeroElement in interface Ringpublic RingElement getOneElement()
RinggetOneElement in interface Ringpublic RingElement restoreElement(Representation repr)
StructurerestoreElement in interface RingrestoreElement in interface Structurerepr - the Representation returned by Representable.getRepresentation()public java.util.Optional<java.lang.Integer> getUniqueByteLength()
StructureUniqueByteRepresentable.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 StructuregetUniqueByteRepresentation(),
or an empty Optional, if no guaranteepublic java.math.BigInteger size()
throws java.lang.UnsupportedOperationException
Structurepublic RingElement getUniformlyRandomElement() throws java.lang.UnsupportedOperationException
StructuregetUniformlyRandomElement in interface RinggetUniformlyRandomElement in interface Structurejava.lang.UnsupportedOperationException - if the operation is not supportedpublic java.math.BigInteger getCharacteristic()
throws java.lang.UnsupportedOperationException
Ring
The characteristic of a ring is defined to be the number n
such that there is a ring homomorphism from Zn to the ring.
getCharacteristic in interface Ringjava.lang.UnsupportedOperationException - if unknownpublic RingElement getElement(java.math.BigInteger i)
RinggetElement in interface Ringi - the integer to mappublic boolean isCommutative()
RingisCommutative in interface Ringpublic Representation getRepresentation()
RepresentableReprUtilgetRepresentation in interface RepresentableRepresentationpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object