shortcut of twist_b for BN254

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

@ -1042,7 +1042,11 @@ struct Param {
if (cp.isMtype) { if (cp.isMtype) {
twist_b = Fp2(cp.b) * xi; twist_b = Fp2(cp.b) * xi;
} else { } else {
twist_b = Fp2(cp.b) / xi; 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)) { if (twist_b == Fp2(1, -1)) {
twist_b_type = tb_1m1i; twist_b_type = tb_1m1i;

Loading…
Cancel
Save