Skip to content

Commit

Permalink
fix error with latest bellman/pairing
Browse files Browse the repository at this point in the history
  • Loading branch information
shamatar committed May 14, 2020
1 parent f30d66b commit d840fd9
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://github.com/matter-labs/sapling-crypto"
license = "MIT/Apache-2.0"
name = "sapling-crypto_ce"
repository = "https://github.com/matter-labs/sapling-crypto"
version = "0.1.2"
version = "0.1.3"
#edition = "2018"

[lib]
Expand Down
4 changes: 2 additions & 2 deletions src/alt_babyjubjub/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const NEGATIVE_ONE: Fs = Fs(FsRepr([
]));

/// This is the underlying representation of an element of `Fs`.
#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Default, Debug, Hash)]
pub struct FsRepr(pub [u64; 4]);

impl ::rand::Rand for FsRepr {
Expand Down Expand Up @@ -257,7 +257,7 @@ impl PrimeFieldRepr for FsRepr {
}

/// This is an element of the scalar field of the Jubjub curve.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct Fs(FsRepr);

impl ::std::fmt::Display for Fs
Expand Down
2 changes: 1 addition & 1 deletion src/alt_babyjubjub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl JubjubEngine for Bn256 {
type Fs = self::fs::Fs;
type Params = AltJubjubBn256;
}

#[derive(Clone)]
pub struct AltJubjubBn256 {
edwards_d: Fr,
montgomery_a: Fr,
Expand Down
4 changes: 2 additions & 2 deletions src/babyjubjub/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const NEGATIVE_ONE: Fs = Fs(FsRepr([
]));

/// This is the underlying representation of an element of `Fs`.
#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Default, Debug, Hash)]
pub struct FsRepr(pub [u64; 4]);

impl ::rand::Rand for FsRepr {
Expand Down Expand Up @@ -257,7 +257,7 @@ impl PrimeFieldRepr for FsRepr {
}

/// This is an element of the scalar field of the Jubjub curve.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct Fs(FsRepr);

impl ::std::fmt::Display for Fs
Expand Down
2 changes: 1 addition & 1 deletion src/babyjubjub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl JubjubEngine for Bn256 {
type Fs = self::fs::Fs;
type Params = JubjubBn256;
}

#[derive(Clone)]
pub struct JubjubBn256 {
edwards_a: Fr,
edwards_d: Fr,
Expand Down
2 changes: 1 addition & 1 deletion src/circuit/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ impl<E: Engine> AllocatedNum<E> {
a: &Self,
b: &Self,
condition: &Boolean
) -> Result<(Self), SynthesisError>
) -> Result<Self, SynthesisError>
where CS: ConstraintSystem<E>
{
let c = Self::alloc(
Expand Down
2 changes: 1 addition & 1 deletion src/circuit/sprout/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl InputNote {
// Witness into the merkle tree
let mut cur = cm.clone();

for (i, layer) in auth_path.into_iter().enumerate() {
for (i, layer) in auth_path.iter().enumerate() {
let cs = &mut cs.namespace(|| format!("layer {}", i));

let cur_is_right = AllocatedBit::alloc(
Expand Down
4 changes: 2 additions & 2 deletions src/jubjub/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ROOT_OF_UNITY: FsRepr = FsRepr([0xaa9f02ab1d6124de, 0xb3524a6466112932, 0x
const NEGATIVE_ONE: Fs = Fs(FsRepr([0xaa9f02ab1d6124de, 0xb3524a6466112932, 0x7342261215ac260b, 0x4d6b87b1da259e2]));

/// This is the underlying representation of an element of `Fs`.
#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Default, Debug, Hash)]
pub struct FsRepr(pub [u64; 4]);

impl ::rand::Rand for FsRepr {
Expand Down Expand Up @@ -227,7 +227,7 @@ impl PrimeFieldRepr for FsRepr {
}

/// This is an element of the scalar field of the Jubjub curve.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct Fs(FsRepr);

impl ::std::fmt::Display for Fs
Expand Down
4 changes: 2 additions & 2 deletions src/jubjub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub trait JubjubEngine: Engine {

/// The pre-computed parameters for Jubjub, including curve
/// constants and various limits and window tables.
pub trait JubjubParams<E: JubjubEngine>: Sized {
pub trait JubjubParams<E: JubjubEngine>: Sized + Send + Sync + Clone {
/// The `d` constant of the twisted Edwards curve.
fn edwards_d(&self) -> &E::Fr;
/// The `A` constant of the birationally equivalent Montgomery curve.
Expand Down Expand Up @@ -141,7 +141,7 @@ impl JubjubEngine for Bls12 {
type Fs = self::fs::Fs;
type Params = JubjubBls12;
}

#[derive(Clone)]
pub struct JubjubBls12 {
edwards_d: Fr,
montgomery_a: Fr,
Expand Down

0 comments on commit d840fd9

Please sign in to comment.