Check that E' points are actually in G2 by ensuring they are of order r.

This commit is contained in:
Sean Bowe
2016-12-12 19:14:42 -07:00
parent 9f7bc6cba5
commit c4fce3fc81
2 changed files with 65 additions and 0 deletions

View File

@@ -163,6 +163,10 @@ curve_G2 CompressedG2::to_libsnark_g2() const
assert(r.is_well_formed());
if (alt_bn128_modulus_r * r != curve_G2::zero()) {
throw std::runtime_error("point is not in G2");
}
return r;
}