Merge pull request #16 from ebfull/y-coordinate-fix

Don't negate y if point at infinity
This commit is contained in:
ebfull 2017-04-02 15:18:53 -06:00 committed by GitHub
commit f711629486
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "bn"
version = "0.4.2"
version = "0.4.3"
authors = ["Sean Bowe <ewillbefull@gmail.com>"]
description = "Pairing cryptography with the Barreto-Naehrig curve"
keywords = ["pairing","crypto","cryptography"]

View File

@ -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:

View File

@ -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());
}