public abstract class PairingSourceGroupImpl extends java.lang.Object implements WeierstrassCurve
| Modifier and Type | Field and Description |
|---|---|
protected java.math.BigInteger |
cofactor |
protected Field |
field |
protected PairingSourceGroupElement |
generator |
protected java.math.BigInteger |
size |
| Constructor and Description |
|---|
PairingSourceGroupImpl(java.math.BigInteger size,
java.math.BigInteger cofactor,
FieldElement a4,
FieldElement a6) |
PairingSourceGroupImpl(java.math.BigInteger size,
java.math.BigInteger cofactor,
FieldElement a1,
FieldElement a2,
FieldElement a3,
FieldElement a4,
FieldElement a6) |
PairingSourceGroupImpl(Representation repr) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
FieldElement |
getA1()
Returns \(A1\) from the weierstrass equation
\(y^2 + A1 \cdot xy + A3 \cdot y = x^3 + A2 \cdot x^2 + A4 \cdot x + A6\).
|
FieldElement |
getA2()
Returns \(A2\) from the weierstrass equation
\(y^2 + A1 \cdot xy + A3 \cdot y = x^3 + A2 \cdot x^2 + A4 \cdot x + A6\).
|
FieldElement |
getA3()
Returns \(A3\) from the weierstrass equation
\(y^2 + A1 \cdot xy + A3 \cdot y = x^3 + A2 \cdot x^2 + A4 \cdot x + A6\).
|
FieldElement |
getA4()
Returns \(A4\) from the weierstrass equation
\(y^2 + A1 \cdot xy + A3 \cdot y = x^3 + A2 \cdot x^2 + A4 \cdot x + A6\).
|
FieldElement |
getA6()
Returns \(A6\) from the weierstrass equation
\(y^2 + A1 \cdot xy + A3 \cdot y = x^3 + A2 \cdot x^2 + A4 \cdot x + A6\).
|
java.math.BigInteger |
getCofactor()
Returns cofactor of this subgroup.
|
abstract PairingSourceGroupElement |
getElement(FieldElement x,
FieldElement y)
Construct an point on this curve given the x- and y-coordinates.
|
Field |
getFieldOfDefinition()
Returns the base field over which the elliptic curve is defined.
|
PairingSourceGroupElement |
getGenerator()
Returns any generator of this group if the group is cyclic and it's feasible to compute a generator.
|
Representation |
getRepresentation()
The representation of this object.
|
java.math.BigInteger |
getSize() |
PairingSourceGroupElement |
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 |
isMember(FieldElement x,
FieldElement y)
Tests if (x,y) is a member of this (sub)group.
|
boolean |
isOnCurve(FieldElement x,
FieldElement y)
Tests if (x,y) is on curve that defines this group.
|
PairingSourceGroupElement |
multiplyByCofactor(FieldElement x,
FieldElement y)
Maps a point (x,y) on the curve into the subgroup represented by this object.
|
PairingSourceGroupElement |
multiplyByCofactor(GroupElementImpl element)
Maps a point (x,y) on the curve into the subgroup represented by this object.
|
PairingSourceGroupElement |
restoreElement(Representation repr)
Restores a group element from its representation.
|
void |
setGenerator(PairingSourceGroupElement generator) |
java.math.BigInteger |
size()
Retrieves number of elements in the group if possible.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisShortFormisCommutativeestimateCostInvPerOp, exp, getNeutralElement, getUniformlyRandomNonNeutral, hasPrimeSize, implementsOwnExp, implementsOwnMultiExp, multiexp, restoreFromRepresentationprotected java.math.BigInteger size
protected java.math.BigInteger cofactor
protected PairingSourceGroupElement generator
protected Field field
public PairingSourceGroupImpl(java.math.BigInteger size,
java.math.BigInteger cofactor,
FieldElement a1,
FieldElement a2,
FieldElement a3,
FieldElement a4,
FieldElement a6)
public PairingSourceGroupImpl(java.math.BigInteger size,
java.math.BigInteger cofactor,
FieldElement a4,
FieldElement a6)
public PairingSourceGroupImpl(Representation repr)
public java.math.BigInteger getSize()
public FieldElement getA1()
WeierstrassCurveIs zero if the curve is given by a weierstrass equation in short form.
getA1 in interface WeierstrassCurvepublic FieldElement getA2()
WeierstrassCurveIs zero if the curve is given by a weierstrass equation in short form.
getA2 in interface WeierstrassCurvepublic FieldElement getA3()
WeierstrassCurveIs zero if the curve is given by a weierstrass equation in short form.
getA3 in interface WeierstrassCurvepublic FieldElement getA4()
WeierstrassCurvegetA4 in interface WeierstrassCurvepublic FieldElement getA6()
WeierstrassCurvegetA6 in interface WeierstrassCurvepublic PairingSourceGroupElement 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 void setGenerator(PairingSourceGroupElement generator)
public java.math.BigInteger getCofactor()
public java.math.BigInteger size()
throws java.lang.UnsupportedOperationException
GroupImplpublic Representation getRepresentation()
RepresentableReprUtilgetRepresentation in interface RepresentableRepresentationpublic boolean isOnCurve(FieldElement x, FieldElement y)
x - - x-coordinate of point that shall be checkedy - - y-coordinate of point that shall be checkedpublic boolean isMember(FieldElement x, FieldElement y)
This function first checks of (x,y) defines a point on the curve that defines this group. Then a subgroup membership test is performed by multiplication either with the group order or with the cofactor. If both are large, this is an expensive operation.
For cryptographic protocols where x and y are inputs to the algorithm, a subgroup membership test is mandatory to avoid small subgroup attacks, twist attacks,...
x - x-coordinate of point to be checkedy - y-coordinate of point to be checkedpublic Field getFieldOfDefinition()
EllipticCurvegetFieldOfDefinition in interface EllipticCurvepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic PairingSourceGroupElement getUniformlyRandomElement() throws java.lang.UnsupportedOperationException
GroupImplgetUniformlyRandomElement in interface GroupImpljava.lang.UnsupportedOperationException - if the random generation cannot be donepublic PairingSourceGroupElement restoreElement(Representation repr)
GroupImplrestoreElement in interface 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.
getUniqueByteLength in interface GroupImplgetUniqueByteRepresentation(),
or an empty Optional, if no guaranteepublic abstract PairingSourceGroupElement getElement(FieldElement x, FieldElement y)
WeierstrassCurvegetElement in interface WeierstrassCurvex - the x-coordinatey - the y-coordinatepublic PairingSourceGroupElement multiplyByCofactor(FieldElement x, FieldElement y)
x - first coordinate of the point to mapy - second coordinate of the point to mappublic PairingSourceGroupElement multiplyByCofactor(GroupElementImpl element)
element - the curve element to map to the subgroup