public class DebugBilinearMapImpl extends java.lang.Object implements BilinearMapImpl
BilinearMapImpl implementing a fast, but insecure pairing over Zn.
Allows for counting pairings.
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.
| Modifier and Type | Field and Description |
|---|---|
protected DebugGroupImpl |
g1
The groups underlying the bilinear group.
|
protected DebugGroupImpl |
g2
The groups underlying the bilinear group.
|
protected DebugGroupImpl |
gt
The groups underlying the bilinear group.
|
protected BilinearGroup.Type |
pairingType
The type of pairing this bilinear map offers.
|
protected java.math.BigInteger |
size
The order of the bilinear group.
|
protected Zn |
zn
Zn of order the bilinear group's size.
|
| Constructor and Description |
|---|
DebugBilinearMapImpl(java.math.BigInteger groupSize,
BilinearGroup.Type type,
boolean enableExpMultiExpCounting)
Instantiates this bilinear map with the given pairing type, group size, and counting configuration.
|
| Modifier and Type | Method and Description |
|---|---|
GroupElementImpl |
apply(GroupElementImpl g1,
GroupElementImpl g2)
Corresponds to
this.apply(g1, g2, 1). |
GroupElementImpl |
apply(GroupElementImpl g1,
GroupElementImpl g2,
java.math.BigInteger exponent)
Computes \(e(g1,g2)^\text{exponent}\).
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
protected void |
incrementNumPairings()
Increments the pairing counter for the current bucket.
|
boolean |
isSymmetric()
Returns true if \(e(g,h) = e(h,g)\) for all g in G1, h in G2.
|
java.lang.String |
toString() |
protected DebugGroupImpl g1
protected DebugGroupImpl g2
protected DebugGroupImpl gt
protected Zn zn
protected java.math.BigInteger size
protected BilinearGroup.Type pairingType
public DebugBilinearMapImpl(java.math.BigInteger groupSize,
BilinearGroup.Type type,
boolean enableExpMultiExpCounting)
groupSize - size of g1, g2, and gt (number of group elements)type - type of the pairingenableExpMultiExpCounting - if true, number of terms in each multi-exponentiation is tracked and
group operations within multi-exponentiations are not counted; otherwise
the former is not done and group operations within multi-exponentiations
are added to the total count.
Furthermore, if true, exponentiations in G1, G2 and GT are counted
as a single unit and group operations within exponentiations are not counted;
otherwise the former is not done and group operations within exponentiations are
added to the total countpublic GroupElementImpl apply(GroupElementImpl g1, GroupElementImpl g2, java.math.BigInteger exponent)
BilinearMapImpl
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 BilinearMapImplg1 - 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 GroupElementImpl apply(GroupElementImpl g1, GroupElementImpl g2)
BilinearMapImplthis.apply(g1, g2, 1).apply in interface java.util.function.BiFunction<GroupElementImpl,GroupElementImpl,GroupElementImpl>apply in interface BilinearMapImplg1 - left hand side argument for the pairing functiong2 - right hand side argument for the pairing functionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isSymmetric()
BilinearMapImplisSymmetric in interface BilinearMapImplpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectprotected void incrementNumPairings()