public class PairingExpr extends AbstractGroupElementExpression
GroupElementExpression representing a bilinear pairing applied to two group element expressions.| Modifier and Type | Field and Description |
|---|---|
protected GroupElementExpression |
lhs |
protected BilinearMap |
map |
protected GroupElementExpression |
rhs |
group| Constructor and Description |
|---|
PairingExpr(BilinearMap map,
GroupElementExpression lhs,
GroupElementExpression rhs) |
| Modifier and Type | Method and Description |
|---|---|
GroupElement |
evaluate(Substitution substitutions)
Evaluates the expression after substituting contained variables.
|
GroupOpExpr |
flatten(ExponentExpr exponent)
Linearizes the expression \(\text{this}^\text{exponent}\).
|
void |
forEachChild(java.util.function.Consumer<Expression> action)
Calls action on every (direct) child of this expression.
|
GroupElementExpression |
getLhs()
Retrieves the left argument of the pairing.
|
BilinearMap |
getMap()
Returns the bilinear map that is used for this pairing expression.
|
GroupElementExpression |
getRhs()
Retrieves the right argument of the pairing.
|
GroupOpExpr |
linearize()
Returns an equivalent expression of the form
y * f(groupVariables, exponentVariables),
where y is constant (no variables), and the expression f is linear. |
PairingExpr |
substitute(Substitution substitutions)
Substitutes variables using the given function.
|
getGroup, getGroupOrderIfKnownclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitevaluate, flatten, inv, isEqualTo, isEqualTo, isEqualTo, op, op, op, opPow, opPow, opPow, opPow, opPow, opPow, opPow, opPow, pow, pow, pow, pow, pow, precompute, substitute, substituteaccumulate, containsExprMatchingPredicate, containsVariables, getVariables, treeWalkprotected GroupElementExpression lhs
protected GroupElementExpression rhs
protected BilinearMap map
public PairingExpr(BilinearMap map, GroupElementExpression lhs, GroupElementExpression rhs)
public BilinearMap getMap()
public GroupElementExpression getLhs()
public GroupElementExpression getRhs()
public void forEachChild(java.util.function.Consumer<Expression> action)
ExpressionGroupOpExpr, this would call action on the left- and right-hand-side and then return.public GroupElement evaluate(Substitution substitutions)
Expressionsubstitutions - a function mapping variables to expressions that can be evaluatedpublic PairingExpr substitute(Substitution substitutions)
Expressionsubstitutions - a function mapping variable expressions to their replacement expressionspublic GroupOpExpr linearize() throws java.lang.IllegalArgumentException
GroupElementExpressiony * f(groupVariables, exponentVariables),
where y is constant (no variables), and the expression f is linear.
Linearity means that
f(groupVariables, exponentVariables) * f(groupVariables2, exponentVariables2) = f(groupVariables * groupVariables2, exponentVariables + exponentVariables2)The exact result is a
GroupOpExpr where the left-hand-side y fulfills
y.containsVariables() == false and the right-hand side is linear.java.lang.IllegalArgumentException - if it's not possible to form the desired output
(e.g., the input is something like \(g^{x_1 \cdot x_2}\) for variables \(x_1, x_2\)).public GroupOpExpr flatten(ExponentExpr exponent)
GroupElementExpression