Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly specify the associated type of the trait & Minimum version. #228

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In addition, the [`curves`](https://github.com/arkworks-rs/curves) repository co

## Build guide

The library compiles on the `stable` toolchain of the Rust compiler. To install the latest version of Rust, first install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager. Once `rustup` is installed, install the Rust toolchain by invoking:
The library compiles on the `stable (1.46+)` toolchain of the Rust compiler. To install the latest version of Rust, first install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager. Once `rustup` is installed, install the Rust toolchain by invoking:
```bash
rustup install stable
```
Expand Down
16 changes: 15 additions & 1 deletion ec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ where

pub trait CurveCycle
where
<Self::E1 as AffineCurve>::BaseField: PrimeField + SquareRootField,
<Self::E2 as AffineCurve>::BaseField: PrimeField + SquareRootField,
<Self::E1 as AffineCurve>::Projective: MulAssign<<Self::E2 as AffineCurve>::BaseField>,
<Self::E2 as AffineCurve>::Projective: MulAssign<<Self::E1 as AffineCurve>::BaseField>,
{
Expand All @@ -340,7 +342,19 @@ where
type E2: AffineCurve;
}

pub trait PairingFriendlyCycle: CurveCycle {
pub trait PairingFriendlyCycle: CurveCycle
where
<Self::E1 as AffineCurve>::BaseField: PrimeField + SquareRootField,
<Self::E2 as AffineCurve>::BaseField: PrimeField + SquareRootField,
<Self::E1 as AffineCurve>::Projective: MulAssign<<Self::E2 as AffineCurve>::BaseField>,
<Self::E2 as AffineCurve>::Projective: MulAssign<<Self::E1 as AffineCurve>::BaseField>,
<Self::Engine1 as PairingEngine>::G1Prepared: From<Self::E1>,
<Self::Engine2 as PairingEngine>::G1Prepared: From<Self::E2>,
<Self::Engine1 as PairingEngine>::G2Projective:
MulAssign<<Self::E1 as AffineCurve>::ScalarField>,
<Self::Engine2 as PairingEngine>::G2Projective:
MulAssign<<Self::E2 as AffineCurve>::ScalarField>,
{
type Engine1: PairingEngine<
G1Affine = Self::E1,
G1Projective = <Self::E1 as AffineCurve>::Projective,
Expand Down