zcash / librustzcash

Rust-language assets for Zcash
Other
333 stars 249 forks source link

using edwards::Point in another library #59

Closed omershlo closed 5 years ago

omershlo commented 5 years ago

Hi,

I am trying to use edwards::Point from my own library. I am using extern crate sapling_crypto; and extern crate pairing; I run the following:

use sapling_crypto::jubjub::{edwards, fs::Fs, PrimeOrder, Unknown, JubjubBls12, JubjubEngine };
use pairing::bls12_381::Bls12;
pub type PK = edwards::Point<Bls12,Unknown>;
#[derive(Clone)]
pub struct JubjubPoint {
    purpose: &'static str,
    ge: PK,
}

and get the error that the trait 'elliptic::curves::sapling_crypto::jubjub::JubjubEngine' is not implemented for 'elliptic::curves::pairing::bls12_381::Bls12' I also tried to import all relevant traits but I get the same error.

When I try this code as part of the tests in redjubjub.rs I get no error.
Apparently I need to import the code from jubjub.rs that implements the jubjubEngine trait for Bls12 but I am not sure how to do it.

Thanks!

omershlo commented 5 years ago

my problem was related to #58 as it turns out. closing this. Thanks!!