From b6f2ab337703286a78454fbfb62ad5d027b62cd4 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sun, 2 Apr 2017 13:48:53 -0600 Subject: [PATCH] Add test that y coordinate remains 1 in jacobian when G1/G2 are negated. --- src/groups/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/groups/mod.rs b/src/groups/mod.rs index fb19ef7..8983779 100644 --- a/src/groups/mod.rs +++ b/src/groups/mod.rs @@ -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"); -} \ No newline at end of file +} + +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()); +}