From c85330e11c6e4708bbbd01f04285e62cb5f4c007 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sun, 2 Apr 2017 13:48:53 -0600 Subject: [PATCH 1/2] 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()); +} From 6fb541e8a78d69a4d57bdb7ed6bcc6d175d166b0 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sun, 2 Apr 2017 13:50:16 -0600 Subject: [PATCH 2/2] Version bump --- Cargo.toml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3177874..6064d04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bn" -version = "0.4.2" +version = "0.4.3" authors = ["Sean Bowe "] description = "Pairing cryptography with the Barreto-Naehrig curve" keywords = ["pairing","crypto","cryptography"] diff --git a/README.md b/README.md index fc88a08..d79eaec 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Add the `bn` crate to your dependencies in `Cargo.toml`... ```toml [dependencies] -bn = "0.4.2" +bn = "0.4.3" ``` ...and add an `extern crate` declaration to your crate root: