diff --git a/Cargo.toml b/Cargo.toml index 25c9445..0ad9658 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,14 +36,12 @@ harness = false [dependencies] backtrace = { version = "0.3", optional = true } -bitvec = "0.18" subtle = "2.3" -crossbeam-utils = "0.7" -ff = "0.8" -metrics = "=0.13.0-alpha.13" -metrics-macros = "=0.1.0-alpha.9" +crossbeam-utils = "0.8" +ff = "0.9" +metrics = "0.14.2" num_cpus = "1.13" -rand = "0.7" +rand = "0.8" blake2b_simd = "0.5" lazy_static = "1.4.0" static_assertions = "1.1.0" diff --git a/src/pasta/fields/fp.rs b/src/pasta/fields/fp.rs index 665bc5c..4e876cf 100644 --- a/src/pasta/fields/fp.rs +++ b/src/pasta/fields/fp.rs @@ -1,7 +1,7 @@ -use bitvec::{array::BitArray, order::Lsb0}; use core::convert::TryInto; use core::fmt; use core::ops::{Add, Mul, Neg, Sub}; +use ff::FieldBits; use lazy_static::lazy_static; use rand::RngCore; use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}; @@ -550,7 +550,7 @@ impl ff::PrimeField for Fp { self.to_bytes() } - fn to_le_bits(&self) -> BitArray { + fn to_le_bits(&self) -> FieldBits { let bytes = self.to_bytes(); #[cfg(not(target_pointer_width = "64"))] @@ -573,21 +573,21 @@ impl ff::PrimeField for Fp { u64::from_le_bytes(bytes[24..32].try_into().unwrap()), ]; - BitArray::new(limbs) + FieldBits::new(limbs) } fn is_odd(&self) -> bool { self.to_bytes()[0] & 1 == 1 } - fn char_le_bits() -> BitArray { + fn char_le_bits() -> FieldBits { #[cfg(not(target_pointer_width = "64"))] { - BitArray::new(MODULUS_LIMBS_32) + FieldBits::new(MODULUS_LIMBS_32) } #[cfg(target_pointer_width = "64")] - BitArray::new(MODULUS.0) + FieldBits::new(MODULUS.0) } fn multiplicative_generator() -> Self { diff --git a/src/pasta/fields/fq.rs b/src/pasta/fields/fq.rs index 79791d1..61deaa1 100644 --- a/src/pasta/fields/fq.rs +++ b/src/pasta/fields/fq.rs @@ -1,7 +1,7 @@ -use bitvec::{array::BitArray, order::Lsb0}; use core::convert::TryInto; use core::fmt; use core::ops::{Add, Mul, Neg, Sub}; +use ff::FieldBits; use lazy_static::lazy_static; use rand::RngCore; use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}; @@ -550,7 +550,7 @@ impl ff::PrimeField for Fq { self.to_bytes() } - fn to_le_bits(&self) -> BitArray { + fn to_le_bits(&self) -> FieldBits { let bytes = self.to_bytes(); #[cfg(not(target_pointer_width = "64"))] @@ -573,21 +573,21 @@ impl ff::PrimeField for Fq { u64::from_le_bytes(bytes[24..32].try_into().unwrap()), ]; - BitArray::new(limbs) + FieldBits::new(limbs) } fn is_odd(&self) -> bool { self.to_bytes()[0] & 1 == 1 } - fn char_le_bits() -> BitArray { + fn char_le_bits() -> FieldBits { #[cfg(not(target_pointer_width = "64"))] { - BitArray::new(MODULUS_LIMBS_32) + FieldBits::new(MODULUS_LIMBS_32) } #[cfg(target_pointer_width = "64")] - BitArray::new(MODULUS.0) + FieldBits::new(MODULUS.0) } fn multiplicative_generator() -> Self {