public class CountingBilinearMap extends java.lang.Object implements BilinearMap
BilinearMap 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 bilinear map works by mapping (Zn,+) x (Zn,+) to (Zn,+) via (a,b) -> a*b
(multiplication in Zn).
It is insecure since DLOG is trivial in Zn.
The counting capability is implemented by wrapping two LazyBilinearMaps 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.
CountingBilinearGroup| Constructor and Description |
|---|
CountingBilinearMap(LazyBilinearMap totalBilMap,
LazyBilinearMap expMultiExpBilMap) |
CountingBilinearMap(Representation repr) |
| Modifier and Type | Method and Description |
|---|---|
GroupElement |
apply(GroupElement g1,
GroupElement g2)
Corresponds to
this.apply(g1, g2, 1). |
GroupElement |
apply(GroupElement g1,
GroupElement g2,
java.math.BigInteger exponent)
Computes \(e(g1,g2)^\text{exponent}\).
|
boolean |
equals(java.lang.Object other) |
java.lang.String |
formatCounterData() |
Group |
getG1()
Returns the source group G1 associated with this bilinear map.
|
Group |
getG2()
Returns the source group G2 associated with this bilinear map.
|
Group |
getGT()
Returns the target group GT associated with this bilinear map.
|
long |
getNumPairings()
Retrieves number of pairings computed in this bilinear group.
|
int |
hashCode() |
boolean |
isSymmetric()
Returns true if
e(g,h).equals(e(h,g)) for all g, h. |
void |
resetNumPairings()
Resets pairing counter.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitapply, apply, applyExpr, applyExpr, applyExpr, applyExpr, innerProductpublic CountingBilinearMap(LazyBilinearMap totalBilMap, LazyBilinearMap expMultiExpBilMap)
public CountingBilinearMap(Representation repr)
public Group getG1()
BilinearMapgetG1 in interface BilinearMappublic Group getG2()
BilinearMapgetG2 in interface BilinearMappublic Group getGT()
BilinearMapgetGT in interface BilinearMappublic GroupElement apply(GroupElement g1, GroupElement g2, java.math.BigInteger exponent)
BilinearMap
Depending on the bilinear map and the involved groups, this may be more efficiently implemented than computing
it directly via apply(g1,g2).pow(exponent).
For example, implementations should do exponentiation in the group with the cheapest group operation.
apply in interface BilinearMapg1 - left hand side argument for the pairing functiong2 - right hand side argument for the pairing functionexponent - the exponent to apply to the result of the pairingpublic GroupElement apply(GroupElement g1, GroupElement g2)
BilinearMapthis.apply(g1, g2, 1).apply in interface java.util.function.BiFunction<GroupElement,GroupElement,GroupElement>apply in interface BilinearMapg1 - left hand side argument for the pairing functiong2 - right hand side argument for the pairing functionpublic boolean isSymmetric()
BilinearMape(g,h).equals(e(h,g)) for all g, h.isSymmetric in interface BilinearMappublic 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 java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String formatCounterData()