Merge pull request #292 from zcash/expression-square

plonk::circuit.rs: Add Expression::square() method.
This commit is contained in:
ying tong 2021-06-12 06:49:36 +08:00 committed by GitHub
commit d04b532368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -427,6 +427,11 @@ impl<F: Field> Expression<F> {
Expression::Scaled(poly, _) => poly.degree(),
}
}
/// Square this expression.
pub fn square(self) -> Self {
self.clone() * self
}
}
impl<F: Field> Neg for Expression<F> {