Merge pull request #16 from ebfull/y-coordinate-fix
Don't negate y if point at infinity
This commit is contained in:
commit
f711629486
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bn"
|
name = "bn"
|
||||||
version = "0.4.2"
|
version = "0.4.3"
|
||||||
authors = ["Sean Bowe <ewillbefull@gmail.com>"]
|
authors = ["Sean Bowe <ewillbefull@gmail.com>"]
|
||||||
description = "Pairing cryptography with the Barreto-Naehrig curve"
|
description = "Pairing cryptography with the Barreto-Naehrig curve"
|
||||||
keywords = ["pairing","crypto","cryptography"]
|
keywords = ["pairing","crypto","cryptography"]
|
||||||
|
|
|
@ -14,7 +14,7 @@ Add the `bn` crate to your dependencies in `Cargo.toml`...
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bn = "0.4.2"
|
bn = "0.4.3"
|
||||||
```
|
```
|
||||||
|
|
||||||
...and add an `extern crate` declaration to your crate root:
|
...and add an `extern crate` declaration to your crate root:
|
||||||
|
|
|
@ -821,3 +821,12 @@ fn test_binlinearity() {
|
||||||
assert_eq!((a.pow(t)) * a, Fq12::one());
|
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());
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue