Merge pull request #9 from ebfull/more-api-changes

More API changes
This commit is contained in:
ebfull 2016-09-12 16:15:18 -06:00 committed by GitHub
commit 5dc0252a1c
3 changed files with 17 additions and 3 deletions

View File

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

View File

@ -12,7 +12,7 @@ Add the `bn` crate to your dependencies in `Cargo.toml`...
```toml
[dependencies]
bn = "0.2.1"
bn = "0.2.2"
```
...and add an `extern crate` declaration to your crate root:

View File

@ -50,7 +50,21 @@ impl Mul for Fr {
fn mul(self, other: Fr) -> Fr { Fr(self.0 * other.0) }
}
pub trait Group: Copy + Clone + PartialEq + Eq + Sized + Add<Self> + Sub<Self> + Neg + Mul<Fr> {
pub trait Group:
rustc_serialize::Encodable +
rustc_serialize::Decodable +
'static +
Send +
Copy +
Clone +
PartialEq +
Eq +
Sized +
Add<Self, Output=Self> +
Sub<Self, Output=Self> +
Neg<Output=Self> +
Mul<Fr, Output=Self>
{
fn zero() -> Self;
fn one() -> Self;
fn random<R: Rng>(rng: &mut R) -> Self;