Merge pull request #662 from str4d/remove-direct-ff-dep

Remove direct `ff` dependency
This commit is contained in:
Kris Nuttycombe 2022-10-02 17:14:06 -06:00 committed by GitHub
commit 3b283ca445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 28 additions and 35 deletions

View File

@ -20,7 +20,6 @@ bls12_381 = "0.7"
bs58 = { version = "0.4", features = ["check"] }
byteorder = { version = "1", optional = true }
crossbeam-channel = "0.5"
ff = "0.12"
group = "0.12"
hex = "0.4"
hdwallet = { version = "0.3.1", optional = true }

View File

@ -1,6 +1,6 @@
//! Generated code for handling light client protobuf structs.
use ff::PrimeField;
use group::ff::PrimeField;
use zcash_primitives::{
block::{BlockHash, BlockHeader},

View File

@ -1,8 +1,9 @@
//! Tools for scanning a compact representation of the Zcash block chain.
use ff::PrimeField;
use std::collections::{HashMap, HashSet};
use std::convert::TryFrom;
use group::ff::PrimeField;
use subtle::{ConditionallySelectable, ConstantTimeEq, CtOption};
use zcash_note_encryption::batch;
use zcash_primitives::{
@ -411,8 +412,10 @@ pub(crate) fn scan_block_with_runner<
#[cfg(test)]
mod tests {
use ff::{Field, PrimeField};
use group::GroupEncoding;
use group::{
ff::{Field, PrimeField},
GroupEncoding,
};
use rand_core::{OsRng, RngCore};
use zcash_primitives::{
consensus::{BlockHeight, Network},

View File

@ -16,7 +16,6 @@ rust-version = "1.56.1"
[dependencies]
bech32 = "0.8"
bs58 = { version = "0.4", features = ["check"] }
ff = "0.12"
group = "0.12"
hdwallet = { version = "0.3.1", optional = true }
jubjub = "0.9"

View File

@ -887,8 +887,7 @@ impl BlockSource for FsBlockDb {
#[cfg(test)]
#[allow(deprecated)]
mod tests {
use ff::PrimeField;
use group::GroupEncoding;
use group::{ff::PrimeField, GroupEncoding};
use protobuf::Message;
use rand_core::{OsRng, RngCore};
use rusqlite::params;

View File

@ -7,7 +7,7 @@
//! [`WalletRead`]: zcash_client_backend::data_api::WalletRead
//! [`WalletWrite`]: zcash_client_backend::data_api::WalletWrite
use ff::PrimeField;
use group::ff::PrimeField;
use rusqlite::{OptionalExtension, ToSql, NO_PARAMS};
use std::collections::HashMap;
use std::convert::TryFrom;

View File

@ -2,7 +2,7 @@
//!
use rusqlite::{named_params, Row};
use ff::PrimeField;
use group::ff::PrimeField;
use zcash_primitives::{
consensus::BlockHeight,

View File

@ -22,7 +22,6 @@ blake2b_simd = "1"
bls12_381 = "0.7"
byteorder = "1"
directories = { version = "4", optional = true }
ff = "0.12"
group = "0.12"
jubjub = "0.9"
lazy_static = "1"

View File

@ -4,8 +4,7 @@ extern crate criterion;
use bellman::groth16::*;
use bls12_381::Bls12;
use criterion::Criterion;
use ff::Field;
use group::Group;
use group::{ff::Field, Group};
use rand_core::{RngCore, SeedableRng};
use rand_xorshift::XorShiftRng;
use zcash_primitives::sapling::{Diversifier, ProofGenerationKey, ValueCommitment};

View File

@ -620,8 +620,10 @@ impl MontgomeryPoint {
#[cfg(test)]
mod test {
use bellman::ConstraintSystem;
use ff::{Field, PrimeField, PrimeFieldBits};
use group::{Curve, Group};
use group::{
ff::{Field, PrimeField, PrimeFieldBits},
Curve, Group,
};
use rand_core::{RngCore, SeedableRng};
use rand_xorshift::XorShiftRng;

View File

@ -107,8 +107,7 @@ mod test {
use super::*;
use bellman::gadgets::boolean::{AllocatedBit, Boolean};
use bellman::gadgets::test::*;
use ff::PrimeField;
use group::Curve;
use group::{ff::PrimeField, Curve};
use rand_core::{RngCore, SeedableRng};
use rand_xorshift::XorShiftRng;
use zcash_primitives::sapling::pedersen_hash;

View File

@ -1,7 +1,6 @@
//! The Sapling circuits.
use ff::PrimeField;
use group::Curve;
use group::{ff::PrimeField, Curve};
use bellman::{Circuit, ConstraintSystem, SynthesisError};
@ -25,7 +24,7 @@ use bellman::gadgets::num;
use bellman::gadgets::Assignment;
#[cfg(test)]
use ff::PrimeFieldBits;
use group::ff::PrimeFieldBits;
pub const TREE_DEPTH: usize = SAPLING_COMMITMENT_TREE_DEPTH;
@ -517,8 +516,7 @@ impl Circuit<bls12_381::Scalar> for Output {
#[test]
fn test_input_circuit_with_bls12_381() {
use bellman::gadgets::test::*;
use ff::Field;
use group::Group;
use group::{ff::Field, Group};
use rand_core::{RngCore, SeedableRng};
use rand_xorshift::XorShiftRng;
use zcash_primitives::sapling::{pedersen_hash, Diversifier, Note, ProofGenerationKey, Rseed};
@ -661,8 +659,7 @@ fn test_input_circuit_with_bls12_381() {
#[test]
fn test_input_circuit_with_bls12_381_external_test_vectors() {
use bellman::gadgets::test::*;
use ff::Field;
use group::Group;
use group::{ff::Field, Group};
use rand_core::{RngCore, SeedableRng};
use rand_xorshift::XorShiftRng;
use zcash_primitives::sapling::{pedersen_hash, Diversifier, Note, ProofGenerationKey, Rseed};
@ -839,8 +836,7 @@ fn test_input_circuit_with_bls12_381_external_test_vectors() {
#[test]
fn test_output_circuit_with_bls12_381() {
use bellman::gadgets::test::*;
use ff::Field;
use group::Group;
use group::{ff::Field, Group};
use rand_core::{RngCore, SeedableRng};
use rand_xorshift::XorShiftRng;
use zcash_primitives::sapling::{Diversifier, ProofGenerationKey, Rseed};

View File

@ -1,7 +1,7 @@
use bellman::gadgets::boolean::Boolean;
use bellman::gadgets::sha256::sha256;
use bellman::{ConstraintSystem, SynthesisError};
use ff::PrimeField;
use group::ff::PrimeField;
pub fn note_comm<Scalar, CS>(
cs: CS,

View File

@ -1,7 +1,7 @@
use bellman::gadgets::boolean::{AllocatedBit, Boolean};
use bellman::gadgets::sha256::sha256_block_no_padding;
use bellman::{ConstraintSystem, SynthesisError};
use ff::PrimeField;
use group::ff::PrimeField;
use super::commitment::note_comm;
use super::prfs::*;

View File

@ -13,7 +13,7 @@
use bellman::gadgets::boolean::{AllocatedBit, Boolean};
use bellman::gadgets::multipack::pack_into_inputs;
use bellman::{Circuit, ConstraintSystem, LinearCombination, SynthesisError};
use ff::PrimeField;
use group::ff::PrimeField;
mod commitment;
mod input;

View File

@ -1,6 +1,6 @@
use bellman::gadgets::boolean::Boolean;
use bellman::{ConstraintSystem, SynthesisError};
use ff::PrimeField;
use group::ff::PrimeField;
use super::commitment::note_comm;
use super::prfs::*;

View File

@ -1,7 +1,7 @@
use bellman::gadgets::boolean::Boolean;
use bellman::gadgets::sha256::sha256_block_no_padding;
use bellman::{ConstraintSystem, SynthesisError};
use ff::PrimeField;
use group::ff::PrimeField;
#[allow(clippy::many_single_char_names)]
fn prf<Scalar, CS>(

View File

@ -1,8 +1,7 @@
//! Various constants used for the Zcash proofs.
use bls12_381::Scalar;
use ff::Field;
use group::{Curve, Group};
use group::{ff::Field, Curve, Group};
use jubjub::ExtendedPoint;
use lazy_static::lazy_static;
use zcash_primitives::constants::{PEDERSEN_HASH_CHUNKS_PER_GENERATOR, PEDERSEN_HASH_GENERATORS};

View File

@ -3,8 +3,7 @@ use bellman::{
groth16::{create_random_proof, verify_proof, Parameters, PreparedVerifyingKey, Proof},
};
use bls12_381::Bls12;
use ff::Field;
use group::{Curve, GroupEncoding};
use group::{ff::Field, Curve, GroupEncoding};
use rand_core::OsRng;
use std::ops::{AddAssign, Neg};
use zcash_primitives::{