Skip to content

Commit

Permalink
perf(math): use constexpr if at JacobianPoint::DoubleInPlace()
Browse files Browse the repository at this point in the history
  • Loading branch information
chokobole authored and Inseon Yu(Merlyn) committed Sep 25, 2023
1 parent 612ed61 commit b59649a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ constexpr CLASS& CLASS::DoubleInPlace() {
// D = 2 * ((X1 + B)² - A - C)
// = 2 * ((X1 + Y1²)² - A - C)
// = 2 * 2 * X1 * Y1²
uint64_t ext_deg = BaseField::Config::kExtensionDegree;
BaseField d;
if (ext_deg == 1 || ext_deg == 2) {
if constexpr (BaseField::Config::kExtensionDegree == 1 ||
BaseField::Config::kExtensionDegree == 2) {
d = x_;
d *= b;
d.DoubleInPlace().DoubleInPlace();
Expand Down

0 comments on commit b59649a

Please sign in to comment.