Add test that y coordinate remains 1 in jacobian when G1/G2 are negated.

This commit is contained in:
Sean Bowe
2017-04-02 13:48:53 -06:00
parent 872252832f
commit b6f2ab3377
+9 -1
View File
@@ -947,4 +947,12 @@ fn affine_fail() {
fn affine_ok() {
let res = AffineG1::new(Fq::one(), G1Params::coeff_b());
assert!(res.is_err(), "Affine initialization should be ok because the point is on the curve");
}
}
fn test_y_at_point_at_infinity() {
assert!(G1::zero().y == Fq::one());
assert!((-G1::zero()).y == Fq::one());
assert!(G2::zero().y == Fq2::one());
assert!((-G2::zero()).y == Fq2::one());
}