From c85330e11c6e4708bbbd01f04285e62cb5f4c007 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/groups/mod.rs b/src/groups/mod.rs index 2c248c9..fd9df00 100644 --- a/src/groups/mod.rs +++ b/src/groups/mod.rs @@ -821,3 +821,12 @@ fn test_binlinearity() { assert_eq!((a.pow(t)) * a, Fq12::one()); } } + +#[test] +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()); +}