From 5623e02a7c1d8ccf5693be724bec6ee2a14bfe2b Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 26 Jan 2021 22:48:11 +0000 Subject: [PATCH] Migrate to ff 0.9 et al. --- components/zcash_note_encryption/Cargo.toml | 8 ++++---- zcash_client_backend/Cargo.toml | 13 ++++++------- zcash_client_sqlite/Cargo.toml | 9 ++++----- zcash_extensions/Cargo.toml | 6 +++--- zcash_primitives/Cargo.toml | 14 +++++++------- zcash_proofs/Cargo.toml | 14 +++++++------- zcash_proofs/src/circuit/ecc.rs | 8 ++++---- zcash_proofs/src/circuit/sapling.rs | 20 ++++++++++++++------ 8 files changed, 49 insertions(+), 43 deletions(-) diff --git a/components/zcash_note_encryption/Cargo.toml b/components/zcash_note_encryption/Cargo.toml index bed67dafe..5ddfac7c3 100644 --- a/components/zcash_note_encryption/Cargo.toml +++ b/components/zcash_note_encryption/Cargo.toml @@ -15,11 +15,11 @@ edition = "2018" blake2b_simd = "0.5" byteorder = "1" crypto_api_chachapoly = "0.4" -ff = "0.8" -group = "0.8" -rand_core = "0.5.1" +ff = "0.9" +group = "0.9" +rand_core = "0.6" subtle = "2.2.3" [dev-dependencies] zcash_primitives = { version = "0.5", path = "../../zcash_primitives" } -jubjub = "0.5.1" +jubjub = "0.6" diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index da0518aa7..ef1e450a1 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -14,18 +14,18 @@ edition = "2018" [dependencies] bech32 = "0.8" -bls12_381 = "0.3.1" +bls12_381 = "0.4" bs58 = { version = "0.4", features = ["check"] } base64 = "0.13" -ff = "0.8" -group = "0.8" +ff = "0.9" +group = "0.9" hex = "0.4" -jubjub = "0.5.1" +jubjub = "0.6" nom = "6.1" percent-encoding = "2.1.0" proptest = { version = "0.10.1", optional = true } protobuf = "2.20" -rand_core = "0.5.1" +rand_core = "0.6" subtle = "2.2.3" time = "0.2" zcash_note_encryption = { version = "0.0", path = "../components/zcash_note_encryption" } @@ -36,8 +36,7 @@ protobuf-codegen-pure = "2.20" [dev-dependencies] gumdrop = "0.8" -rand_core = "0.5.1" -rand_xorshift = "0.2" +rand_xorshift = "0.3" tempfile = "3.1.0" zcash_client_sqlite = { version = "0.3", path = "../zcash_client_sqlite" } zcash_proofs = { version = "0.5", path = "../zcash_proofs" } diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index 5e1efe0f6..9aabe07a5 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -15,18 +15,17 @@ edition = "2018" [dependencies] bech32 = "0.8" bs58 = { version = "0.4", features = ["check"] } -ff = "0.8" -group = "0.8" -jubjub = "0.5.1" +ff = "0.9" +group = "0.9" +jubjub = "0.6" protobuf = "2.20" -rand_core = "0.5.1" +rand_core = "0.6" rusqlite = { version = "0.24", features = ["bundled", "time"] } time = "0.2" zcash_client_backend = { version = "0.5", path = "../zcash_client_backend" } zcash_primitives = { version = "0.5", path = "../zcash_primitives" } [dev-dependencies] -rand_core = "0.5.1" tempfile = "3" zcash_proofs = { version = "0.5", path = "../zcash_proofs" } diff --git a/zcash_extensions/Cargo.toml b/zcash_extensions/Cargo.toml index c15fb51d6..30790f09a 100644 --- a/zcash_extensions/Cargo.toml +++ b/zcash_extensions/Cargo.toml @@ -13,7 +13,7 @@ blake2b_simd = "0.5" zcash_primitives = { version = "0.5", path = "../zcash_primitives", features = ["zfuture"] } [dev-dependencies] -ff = "0.8" -jubjub = "0.5.1" -rand_core = "0.5.1" +ff = "0.9" +jubjub = "0.6" +rand_core = "0.6" zcash_proofs = { version = "0.5", path = "../zcash_proofs" } diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index a950331cf..69da0155c 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -20,20 +20,20 @@ aes = "0.6" bitvec = "0.18" blake2b_simd = "0.5" blake2s_simd = "0.5" -bls12_381 = "0.3.1" +bls12_381 = "0.4" byteorder = "1" crypto_api_chachapoly = "0.4" equihash = { version = "0.1", path = "../components/equihash" } -ff = "0.8" +ff = "0.9" fpe = "0.4" -group = "0.8" +group = "0.9" hex = "0.4" -jubjub = "0.5.1" +jubjub = "0.6" lazy_static = "1" log = "0.4" proptest = { version = "0.10.1", optional = true } -rand = "0.7" -rand_core = "0.5.1" +rand = "0.8" +rand_core = "0.6" ripemd160 = { version = "0.9", optional = true } secp256k1 = { version = "0.20", optional = true } sha2 = "0.9" @@ -47,7 +47,7 @@ funty = "=1.1.0" criterion = "0.3" hex-literal = "0.3" proptest = "0.10.1" -rand_xorshift = "0.2" +rand_xorshift = "0.3" [features] transparent-inputs = ["ripemd160", "secp256k1"] diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index 63e8f7c14..83c179de6 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -15,23 +15,23 @@ edition = "2018" all-features = true [dependencies] -bellman = { version = "0.8", default-features = false, features = ["groth16"] } +bellman = { version = "0.9", default-features = false, features = ["groth16"] } blake2b_simd = "0.5" -bls12_381 = "0.3.1" +bls12_381 = "0.4" byteorder = "1" directories = { version = "3", optional = true } -ff = "0.8" -group = "0.8" -jubjub = "0.5.1" +ff = "0.9" +group = "0.9" +jubjub = "0.6" lazy_static = "1" minreq = { version = "2", features = ["https"], optional = true } -rand_core = "0.5.1" +rand_core = "0.6" wagyu-zcash-parameters = { version = "0.2", optional = true } zcash_primitives = { version = "0.5", path = "../zcash_primitives" } [dev-dependencies] criterion = "0.3" -rand_xorshift = "0.2" +rand_xorshift = "0.3" [features] default = ["local-prover", "multicore"] diff --git a/zcash_proofs/src/circuit/ecc.rs b/zcash_proofs/src/circuit/ecc.rs index 5167fa5de..be7960e63 100644 --- a/zcash_proofs/src/circuit/ecc.rs +++ b/zcash_proofs/src/circuit/ecc.rs @@ -737,9 +737,9 @@ mod test { let s_bits = s .to_le_bits() - .into_iter() + .iter() + .by_val() .take(jubjub::Fr::NUM_BITS as usize) - .cloned() .enumerate() .map(|(i, b)| { AllocatedBit::alloc(cs.namespace(|| format!("scalar bit {}", i)), Some(b)) @@ -788,9 +788,9 @@ mod test { let s_bits = s .to_le_bits() - .into_iter() + .iter() + .by_val() .take(jubjub::Fr::NUM_BITS as usize) - .cloned() .enumerate() .map(|(i, b)| { AllocatedBit::alloc(cs.namespace(|| format!("scalar bit {}", i)), Some(b)) diff --git a/zcash_proofs/src/circuit/sapling.rs b/zcash_proofs/src/circuit/sapling.rs index fb00131b8..1c5fe766d 100644 --- a/zcash_proofs/src/circuit/sapling.rs +++ b/zcash_proofs/src/circuit/sapling.rs @@ -591,10 +591,14 @@ fn test_input_circuit_with_bls12_381() { cur = jubjub::ExtendedPoint::from(pedersen_hash::pedersen_hash( pedersen_hash::Personalization::MerkleTree(i), - lhs.into_iter() + lhs.iter() + .by_val() .take(bls12_381::Scalar::NUM_BITS as usize) - .chain(rhs.into_iter().take(bls12_381::Scalar::NUM_BITS as usize)) - .cloned(), + .chain( + rhs.iter() + .by_val() + .take(bls12_381::Scalar::NUM_BITS as usize), + ), )) .to_affine() .get_u(); @@ -765,10 +769,14 @@ fn test_input_circuit_with_bls12_381_external_test_vectors() { cur = jubjub::ExtendedPoint::from(pedersen_hash::pedersen_hash( pedersen_hash::Personalization::MerkleTree(i), - lhs.into_iter() + lhs.iter() + .by_val() .take(bls12_381::Scalar::NUM_BITS as usize) - .chain(rhs.into_iter().take(bls12_381::Scalar::NUM_BITS as usize)) - .cloned(), + .chain( + rhs.iter() + .by_val() + .take(bls12_381::Scalar::NUM_BITS as usize), + ), )) .to_affine() .get_u();