/// fix a bit array to a certain length by remove extra element on the end or
/// pad with zero
fix a bit array to a certain length by remove extra element on the end or
pad with zero
fix a bit array to a certain length by remove extra element on the end or pad with zero
fn fit_bits_to_length<F: PrimeField>(bits: &[Boolean<F>], length: usize) -> Vec<Boolean<F>> {
    if bits.len() < length {
        bits.to_vec()
            .into_iter()
            .chain((0..(length - bits.len())).map(|_| Boolean::FALSE))
            .collect()
    } else {
        (&bits[0..length]).to_vec()
    }
}
fn fit_bits_to_length < F : PrimeField > ( bits : & [ Boolean < F > ] , length : usize ) -> Vec < Boolean < F > > { if bits . len ( ) < length { bits . to_vec ( ) . into_iter ( ) . chain ( ( 0 .. ( length - bits . len ( ) ) ) . map ( | _ | Boolean :: FALSE ) ) . collect ( ) } else { ( & bits [ 0 .. length ] ) . to_vec ( ) } }
fix a bit array to a certain length by remove extra element on the end or
pad with zero
fix a bit array to a certain length by remove extra element on the end or pad with zero
bits
&[Boolean<F>]
length
usize