public class CountingBilinearGroup extends java.lang.Object implements BilinearGroup
BilinearGroup implementing a fast, but insecure pairing over Zn.
Allows for counting group operations and (multi-)exponentiations as well as pairings on the bilinear
group level.
The counting capability is implemented by wrapping two LazyBilinearGroups which contain
CountingBilinearGroupImpls themselves. All operations are executed in both groups,
one counts total group operations and one counts each (multi-)exponentiation as one unit.
This allows for tracking both kinds of data.
BilinearGroup.Type| Modifier and Type | Field and Description |
|---|---|
protected CountingBilinearMap |
bilMap
The underlying bilinear map used for applying the pairing function and counting it.
|
protected LazyBilinearGroup |
expMultiExpBilGroup
The bilinear group responsible for counting (multi-)exponentiations and group operations outside of those.
|
protected BilinearGroup.Type |
pairingType
The type of pairing this bilinear group should offer.
|
protected java.lang.Integer |
securityParameter
The security level offered by this bilinear group in number of bits.
|
protected LazyBilinearGroup |
totalBilGroup
The bilinear group responsible for counting total group operations.
|
| Constructor and Description |
|---|
CountingBilinearGroup(BilinearGroup.Type pairingType)
Initializes this prime order bilinear group of 128 bit size
|
CountingBilinearGroup(int securityParameter,
BilinearGroup.Type pairingType)
Initializes this bilinear group with the given security level, pairing type and prime group order.
|
CountingBilinearGroup(int securityParameter,
BilinearGroup.Type pairingType,
int numPrimeFactors)
Initializes this bilinear group with the given security level, pairing type, and group order factoring
into the given number of prime factors.
|
CountingBilinearGroup(Representation repr) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
formatCounterData()
Returns a string with all count data formatted for printing.
|
BilinearMap |
getBilinearMap()
Returns the
BilinearMap (contains the pairing operation) belonging to this BilinearGroup. |
Group |
getG1()
Returns the source group G1 associated with this bilinear group.
|
Group |
getG2()
Returns the source group G2 associated with this bilinear group.
|
Group |
getGT()
Returns the target group GT associated with this bilinear group.
|
HashIntoGroup |
getHashIntoG1()
Retrieves a hash function that maps byte arrays to G1.
|
HashIntoGroup |
getHashIntoG2()
Retrieves a hash function that maps byte arrays to G2.
|
HashIntoGroup |
getHashIntoGT()
Retrieves a hash function that maps byte arrays to GT.
|
GroupHomomorphism |
getHomomorphismG2toG1()
Retrieves the homomorphism from G2 to G1 if it exists.
|
long |
getNumPairings()
Returns the number of pairings computed in this bilinear group.
|
BilinearGroup.Type |
getPairingType() |
Representation |
getRepresentation()
The representation of this object.
|
java.lang.Integer |
getSecurityLevel() |
int |
hashCode() |
protected void |
init()
Initializes the underlying bilinear map
bilMap. |
void |
resetCounters()
Resets all counters, including the ones in groups G1, G2, GT.
|
void |
resetNumPairings()
Resets pairing counter.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetHashIntoZGroupExponent, getZn, sizeprotected java.lang.Integer securityParameter
protected BilinearGroup.Type pairingType
protected LazyBilinearGroup totalBilGroup
protected LazyBilinearGroup expMultiExpBilGroup
protected CountingBilinearMap bilMap
public CountingBilinearGroup(int securityParameter,
BilinearGroup.Type pairingType,
int numPrimeFactors)
securityParameter - the security level in number of bitspairingType - the type of pairing that should be offered by this bilinear groupnumPrimeFactors - the number of prime factors the group order should havepublic CountingBilinearGroup(int securityParameter,
BilinearGroup.Type pairingType)
securityParameter - the security level in number of bitspairingType - the type of pairing that should be offered by this bilinear grouppublic CountingBilinearGroup(BilinearGroup.Type pairingType)
pairingType - the type of pairing that should be offered by this bilinear grouppublic CountingBilinearGroup(Representation repr)
protected void init()
bilMap.public Group getG1()
BilinearGroupgetG1 in interface BilinearGrouppublic Group getG2()
BilinearGroupgetG2 in interface BilinearGrouppublic Group getGT()
BilinearGroupgetGT in interface BilinearGrouppublic BilinearMap getBilinearMap()
BilinearGroupBilinearMap (contains the pairing operation) belonging to this BilinearGroup.getBilinearMap in interface BilinearGrouppublic GroupHomomorphism getHomomorphismG2toG1() throws java.lang.UnsupportedOperationException
BilinearGroupgetHomomorphismG2toG1 in interface BilinearGroupjava.lang.UnsupportedOperationException - if no such homomorphism exists or the bilinear group is not configured
to support such functionalitypublic HashIntoGroup getHashIntoG1() throws java.lang.UnsupportedOperationException
BilinearGroupgetHashIntoG1 in interface BilinearGroupjava.lang.UnsupportedOperationException - if no such hash function exists or the bilinear group is not configured
to support such functionalitypublic HashIntoGroup getHashIntoG2() throws java.lang.UnsupportedOperationException
BilinearGroupgetHashIntoG2 in interface BilinearGroupjava.lang.UnsupportedOperationException - if no such hash function exists or the bilinear group is not configured
to support such functionalitypublic HashIntoGroup getHashIntoGT() throws java.lang.UnsupportedOperationException
BilinearGroupgetHashIntoGT in interface BilinearGroupjava.lang.UnsupportedOperationException - if no such hash function exists or the bilinear group is not configured
to support such functionalitypublic java.lang.Integer getSecurityLevel()
getSecurityLevel in interface BilinearGrouppublic BilinearGroup.Type getPairingType()
getPairingType in interface BilinearGrouppublic 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.Objectpublic long getNumPairings()
public void resetNumPairings()
public void resetCounters()
public java.lang.String formatCounterData()