Migrate to bitvec 0.22, ff 0.10, group 0.10, pasta_curves 0.1

This commit is contained in:
Jack Grigg 2021-06-04 20:38:28 +01:00
parent c5aa41e2e4
commit bea8a9b7ff
5 changed files with 13 additions and 16 deletions

View File

@ -21,11 +21,12 @@ rustdoc-args = [ "--html-in-header", "katex-header.html" ]
[dependencies]
aes = "0.6"
arrayvec = "0.7.0"
bitvec = "0.20"
bitvec = "0.22"
blake2b_simd = "0.5"
ff = "0.9"
ff = "0.10"
fpe = "0.4"
group = "0.9"
group = "0.10"
pasta_curves = "0.1"
proptest = { version = "1.0.0", optional = true }
rand = "0.8"
nonempty = "0.6"
@ -36,15 +37,11 @@ plotters = { version = "0.3.0", optional = true }
[dependencies.halo2]
git = "https://github.com/zcash/halo2.git"
rev = "0448584333c1e262e4a7dbaefa6fdd896bdaaefb"
[dependencies.pasta_curves]
git = "https://github.com/zcash/pasta_curves.git"
rev = "b55a6960dfafd7f767e2820ddf1adaa499322f98"
rev = "32cdcfa66fbc4ca3103115518d374f4cfe6c3b7a"
[dependencies.reddsa]
git = "https://github.com/str4d/redjubjub.git"
rev = "daab5355bf8e85289aa37804656bf85182df9eea"
rev = "d5d8c5f3bb704bad8ae88fe4a29ae1f744774cb2"
[dev-dependencies]
criterion = "0.3"

View File

@ -1,4 +1,4 @@
use ff::PrimeField;
use ff::PrimeFieldBits;
use halo2::arithmetic::{CurveAffine, FieldExt};
/// Decompose a scalar into `window_num_bits` bits (little-endian)
@ -9,8 +9,8 @@ use halo2::arithmetic::{CurveAffine, FieldExt};
///
/// We are returning a `Vec<u8>` which means the window size is limited to
/// <= 8 bits.
pub fn decompose_scalar_fixed<C: CurveAffine>(
scalar: C::Scalar,
pub fn decompose_scalar_fixed<F: PrimeFieldBits>(
scalar: F,
scalar_num_bits: usize,
window_num_bits: usize,
) -> Vec<u8> {
@ -65,7 +65,7 @@ mod tests {
window_num_bits in 1u8..9
) {
// Get decomposition into `window_num_bits` bits
let decomposed = decompose_scalar_fixed::<pallas::Affine>(scalar, pallas::Scalar::NUM_BITS as usize, window_num_bits as usize);
let decomposed = decompose_scalar_fixed(scalar, pallas::Scalar::NUM_BITS as usize, window_num_bits as usize);
// Flatten bits
let bits = decomposed

View File

@ -1,7 +1,7 @@
use std::iter;
use bitvec::{array::BitArray, order::Lsb0};
use ff::PrimeField;
use ff::PrimeFieldBits;
use pasta_curves::{arithmetic::FieldExt, pallas};
use subtle::CtOption;

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 Msb0, u8),
next_bit: usize,
_field: PhantomData<F>,
}

View File

@ -3,7 +3,7 @@
use std::iter;
use std::ops::Deref;
use ff::{Field, PrimeField};
use ff::{Field, PrimeField, PrimeFieldBits};
use group::{Curve, Group};
use halo2::arithmetic::{CurveAffine, CurveExt, FieldExt};
use pasta_curves::pallas;