Migrate to `ff 0.12`

This commit is contained in:
Jack Grigg 2022-05-05 16:47:56 +00:00
parent 93ad4a6952
commit 706cee42f5
8 changed files with 26 additions and 24 deletions

View File

@ -7,6 +7,7 @@ and this project adheres to Rust's notion of
## [Unreleased]
### Changed
- Bumped dependencies to `bitvec 1`, `ff 0.12`, `group 0.12`, `pasta_curves 0.4`.
- `orchard::bundle`:
- `Action` has been moved to `orchard::Action`.
- `Bundle::{try_}authorize` have been renamed to

View File

@ -24,17 +24,17 @@ rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "katex-header.html"]
[dependencies]
aes = "0.7"
bitvec = "0.22"
bitvec = "1"
blake2b_simd = "1"
ff = "0.11"
ff = "0.12"
fpe = "0.5"
group = "0.11"
group = "0.12"
halo2_gadgets = "=0.1.0-beta.3"
halo2_proofs = "=0.1.0-beta.4"
hex = "0.4"
lazy_static = "1"
memuse = { version = "0.2", features = ["nonempty"] }
pasta_curves = "0.3"
pasta_curves = "0.4"
proptest = { version = "1.0.0", optional = true }
rand = "0.8"
reddsa = "0.2"
@ -82,6 +82,7 @@ debug = true
debug = true
[patch.crates-io]
halo2_gadgets = { git = "https://github.com/zcash/halo2.git", rev = "3800de59188a73b4e04f689c8bcc855a2fc7fdcf" }
halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "3800de59188a73b4e04f689c8bcc855a2fc7fdcf" }
halo2_gadgets = { git = "https://github.com/zcash/halo2.git", rev = "72ff677776504c288f4927a6ce8d3c273ebd588d" }
halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "72ff677776504c288f4927a6ce8d3c273ebd588d" }
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree.git", rev = "f23e3d89507849a24543121839eea6f40b141aff" }
reddsa = { git = "https://github.com/ZcashFoundation/reddsa.git", rev = "f711bfa4931a3b80b216e642a453426ceb727143" }

View File

@ -811,7 +811,7 @@ mod tests {
.unwrap()
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(L_ORCHARD_BASE),
)
.chain(
@ -819,7 +819,7 @@ mod tests {
.unwrap()
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(L_ORCHARD_BASE),
),
&rivk,

View File

@ -2240,7 +2240,7 @@ mod tests {
.unwrap()
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(L_ORCHARD_BASE),
)
.chain(Some(lsb(self.gd_y_lsb.unwrap())))
@ -2249,17 +2249,17 @@ mod tests {
.unwrap()
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(L_ORCHARD_BASE),
)
.chain(Some(lsb(self.pkd_y_lsb.unwrap())))
.chain(value.to_le_bits().iter().by_val().take(L_VALUE))
.chain(value.to_le_bits().iter().by_vals().take(L_VALUE))
.chain(
self.rho
.unwrap()
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(L_ORCHARD_BASE),
)
.chain(
@ -2267,7 +2267,7 @@ mod tests {
.unwrap()
.to_le_bits()
.iter()
.by_val()
.by_vals()
.take(L_ORCHARD_BASE),
),
&rcm,

View File

@ -49,11 +49,11 @@ impl NoteCommitment {
domain
.commit(
iter::empty()
.chain(BitArray::<Lsb0, _>::new(g_d).iter().by_val())
.chain(BitArray::<Lsb0, _>::new(pk_d).iter().by_val())
.chain(v.to_le_bits().iter().by_val())
.chain(rho.to_le_bits().iter().by_val().take(L_ORCHARD_BASE))
.chain(psi.to_le_bits().iter().by_val().take(L_ORCHARD_BASE)),
.chain(BitArray::<_, Lsb0>::new(g_d).iter().by_vals())
.chain(BitArray::<_, Lsb0>::new(pk_d).iter().by_vals())
.chain(v.to_le_bits().iter().by_vals())
.chain(rho.to_le_bits().iter().by_vals().take(L_ORCHARD_BASE))
.chain(psi.to_le_bits().iter().by_vals().take(L_ORCHARD_BASE)),
&rcm.0,
)
.map(NoteCommitment)

View File

@ -179,8 +179,8 @@ pub(crate) fn commit_ivk(
let domain = sinsemilla::CommitDomain::new(COMMIT_IVK_PERSONALIZATION);
domain.short_commit(
iter::empty()
.chain(ak.to_le_bits().iter().by_val().take(L_ORCHARD_BASE))
.chain(nk.to_le_bits().iter().by_val().take(L_ORCHARD_BASE)),
.chain(ak.to_le_bits().iter().by_vals().take(L_ORCHARD_BASE))
.chain(nk.to_le_bits().iter().by_vals().take(L_ORCHARD_BASE)),
rivk,
)
}

View File

@ -213,8 +213,8 @@ impl Hashable for MerkleHashOrchard {
.hash(
iter::empty()
.chain(i2lebsp_k(altitude.into()).iter().copied())
.chain(left.0.to_le_bits().iter().by_val().take(L_ORCHARD_MERKLE))
.chain(right.0.to_le_bits().iter().by_val().take(L_ORCHARD_MERKLE)),
.chain(left.0.to_le_bits().iter().by_vals().take(L_ORCHARD_MERKLE))
.chain(right.0.to_le_bits().iter().by_vals().take(L_ORCHARD_MERKLE)),
)
.unwrap_or(pallas::Base::zero()),
)

View File

@ -111,8 +111,8 @@ impl NoteValue {
self.0.to_le_bytes()
}
pub(crate) fn to_le_bits(self) -> BitArray<Lsb0, [u8; 8]> {
BitArray::<Lsb0, _>::new(self.0.to_le_bytes())
pub(crate) fn to_le_bits(self) -> BitArray<[u8; 8], Lsb0> {
BitArray::<_, Lsb0>::new(self.0.to_le_bytes())
}
}