Migrate to `ff 0.12`

This commit is contained in:
Jack Grigg 2022-05-04 23:36:18 +00:00
parent 1ccef3b30a
commit e04c8bfb4b
10 changed files with 21 additions and 18 deletions

View File

@ -1,7 +1,7 @@
//! # halo2
#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(broken_intra_doc_links)]
#![deny(rustdoc::broken_intra_doc_links)]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(unsafe_code)]

View File

@ -23,12 +23,12 @@ rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "katex-header.html"]
[dependencies]
arrayvec = "0.7.0"
bitvec = "0.22"
ff = "0.11"
group = "0.11"
bitvec = "1"
ff = "0.12"
group = "0.12"
halo2_proofs = { version = "=0.1.0-beta.4", path = "../halo2_proofs" }
lazy_static = "1"
pasta_curves = "0.3"
pasta_curves = "0.4"
proptest = { version = "1.0.0", optional = true }
rand = "0.8"
subtle = "2.3"

View File

@ -4,7 +4,7 @@
// Temporary until we have more of the crate implemented.
#![allow(dead_code)]
// Catch documentation errors caused by code changes.
#![deny(broken_intra_doc_links)]
#![deny(rustdoc::broken_intra_doc_links)]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(unsafe_code)]

View File

@ -44,7 +44,7 @@ impl SboxType {
}
pub(super) struct Grain<F: FieldExt> {
state: BitArr!(for 80, in Msb0, u8),
state: BitArr!(for 80, in u8, Msb0),
next_bit: usize,
_field: PhantomData<F>,
}
@ -52,7 +52,7 @@ pub(super) struct Grain<F: FieldExt> {
impl<F: FieldExt> Grain<F> {
pub(super) fn new(sbox: SboxType, t: u16, r_f: u16, r_p: u16) -> Self {
// Initialize the LFSR state.
let mut state = bitarr![Msb0, u8; 1; STATE];
let mut state = bitarr![u8, Msb0; 1; STATE];
let mut set_bits = |offset: usize, len, value| {
// Poseidon reference impl sets initial state bits in MSB order.
for i in 0..len {

View File

@ -249,7 +249,10 @@ mod tests {
#[test]
fn pad() {
assert_eq!(Pad::new([].iter().cloned()).collect::<Vec<_>>(), vec![]);
assert_eq!(
Pad::new([].iter().cloned()).collect::<Vec<_>>(),
vec![false; 0]
);
assert_eq!(
Pad::new([true].iter().cloned()).collect::<Vec<_>>(),
vec![true, false, false, false, false, false, false, false, false, false]

View File

@ -318,14 +318,14 @@ pub mod tests {
.chain(
left.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(pallas::Base::NUM_BITS as usize),
)
.chain(
right
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(pallas::Base::NUM_BITS as usize),
),
)

View File

@ -360,13 +360,13 @@ where
let left: Vec<_> = left
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(pallas::Base::NUM_BITS as usize)
.collect();
let right: Vec<_> = right
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(pallas::Base::NUM_BITS as usize)
.collect();
let merkle_crh = HashDomain::from_Q(Q.into());

View File

@ -94,7 +94,7 @@ pub fn bitrange_subset<F: PrimeFieldBits>(field_elem: &F, bitrange: Range<usize>
field_elem
.to_le_bits()
.iter()
.by_val()
.by_vals()
.skip(bitrange.start)
.take(bitrange.end - bitrange.start)
.rev()

View File

@ -427,7 +427,7 @@ mod tests {
element
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(num_words * K)
.collect::<Vec<_>>()
.chunks_exact(K)

View File

@ -46,9 +46,9 @@ harness = false
[dependencies]
backtrace = { version = "0.3", optional = true }
rayon = "1.5.1"
ff = "0.11"
group = "0.11"
pasta_curves = "0.3"
ff = "0.12"
group = "0.12"
pasta_curves = "0.4"
rand_core = { version = "0.6", default-features = false }
blake2b_simd = "1"