shortcut of twist_b for BN254

dev
MITSUNARI Shigeo 6 years ago
parent 3a06b921da
commit 20a39f9eb3
  1. 4
      include/mcl/bn.hpp

@ -1041,9 +1041,13 @@ struct Param {
}
if (cp.isMtype) {
twist_b = Fp2(cp.b) * xi;
} else {
if (cp.b == 2 && cp.xi_a == 1) {
twist_b = Fp2(1, -1); // shortcut
} else {
twist_b = Fp2(cp.b) / xi;
}
}
if (twist_b == Fp2(1, -1)) {
twist_b_type = tb_1m1i;
} else if (twist_b == Fp2(1, -2)) {

Loading…
Cancel
Save