Merge pull request #322 from zcash/ff-0.12

Migrate to `ff 0.12`
This commit is contained in:
ebfull 2022-05-05 13:08:45 -06:00 committed by GitHub
commit 7929ac5af7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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] ## [Unreleased]
### Changed ### Changed
- Bumped dependencies to `bitvec 1`, `ff 0.12`, `group 0.12`, `pasta_curves 0.4`.
- `orchard::bundle`: - `orchard::bundle`:
- `Action` has been moved to `orchard::Action`. - `Action` has been moved to `orchard::Action`.
- `Bundle::{try_}authorize` have been renamed to - `Bundle::{try_}authorize` have been renamed to

View File

@ -24,17 +24,17 @@ rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "katex-header.html"]
[dependencies] [dependencies]
aes = "0.7" aes = "0.7"
bitvec = "0.22" bitvec = "1"
blake2b_simd = "1" blake2b_simd = "1"
ff = "0.11" ff = "0.12"
fpe = "0.5" fpe = "0.5"
group = "0.11" group = "0.12"
halo2_gadgets = "=0.1.0-beta.3" halo2_gadgets = "=0.1.0-beta.3"
halo2_proofs = "=0.1.0-beta.4" halo2_proofs = "=0.1.0-beta.4"
hex = "0.4" hex = "0.4"
lazy_static = "1" lazy_static = "1"
memuse = { version = "0.2", features = ["nonempty"] } memuse = { version = "0.2", features = ["nonempty"] }
pasta_curves = "0.3" pasta_curves = "0.4"
proptest = { version = "1.0.0", optional = true } proptest = { version = "1.0.0", optional = true }
rand = "0.8" rand = "0.8"
reddsa = "0.2" reddsa = "0.2"
@ -82,6 +82,7 @@ debug = true
debug = true debug = true
[patch.crates-io] [patch.crates-io]
halo2_gadgets = { 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 = "3800de59188a73b4e04f689c8bcc855a2fc7fdcf" } halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "72ff677776504c288f4927a6ce8d3c273ebd588d" }
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree.git", rev = "f23e3d89507849a24543121839eea6f40b141aff" } 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() .unwrap()
.to_le_bits() .to_le_bits()
.iter() .iter()
.by_val() .by_vals()
.take(L_ORCHARD_BASE), .take(L_ORCHARD_BASE),
) )
.chain( .chain(
@ -819,7 +819,7 @@ mod tests {
.unwrap() .unwrap()
.to_le_bits() .to_le_bits()
.iter() .iter()
.by_val() .by_vals()
.take(L_ORCHARD_BASE), .take(L_ORCHARD_BASE),
), ),
&rivk, &rivk,

View File

@ -2240,7 +2240,7 @@ mod tests {
.unwrap() .unwrap()
.to_le_bits() .to_le_bits()
.iter() .iter()
.by_val() .by_vals()
.take(L_ORCHARD_BASE), .take(L_ORCHARD_BASE),
) )
.chain(Some(lsb(self.gd_y_lsb.unwrap()))) .chain(Some(lsb(self.gd_y_lsb.unwrap())))
@ -2249,17 +2249,17 @@ mod tests {
.unwrap() .unwrap()
.to_le_bits() .to_le_bits()
.iter() .iter()
.by_val() .by_vals()
.take(L_ORCHARD_BASE), .take(L_ORCHARD_BASE),
) )
.chain(Some(lsb(self.pkd_y_lsb.unwrap()))) .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( .chain(
self.rho self.rho
.unwrap() .unwrap()
.to_le_bits() .to_le_bits()
.iter() .iter()
.by_val() .by_vals()
.take(L_ORCHARD_BASE), .take(L_ORCHARD_BASE),
) )
.chain( .chain(
@ -2267,7 +2267,7 @@ mod tests {
.unwrap() .unwrap()
.to_le_bits() .to_le_bits()
.iter() .iter()
.by_val() .by_vals()
.take(L_ORCHARD_BASE), .take(L_ORCHARD_BASE),
), ),
&rcm, &rcm,

View File

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

View File

@ -179,8 +179,8 @@ pub(crate) fn commit_ivk(
let domain = sinsemilla::CommitDomain::new(COMMIT_IVK_PERSONALIZATION); let domain = sinsemilla::CommitDomain::new(COMMIT_IVK_PERSONALIZATION);
domain.short_commit( domain.short_commit(
iter::empty() iter::empty()
.chain(ak.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_val().take(L_ORCHARD_BASE)), .chain(nk.to_le_bits().iter().by_vals().take(L_ORCHARD_BASE)),
rivk, rivk,
) )
} }

View File

@ -213,8 +213,8 @@ impl Hashable for MerkleHashOrchard {
.hash( .hash(
iter::empty() iter::empty()
.chain(i2lebsp_k(altitude.into()).iter().copied()) .chain(i2lebsp_k(altitude.into()).iter().copied())
.chain(left.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_val().take(L_ORCHARD_MERKLE)), .chain(right.0.to_le_bits().iter().by_vals().take(L_ORCHARD_MERKLE)),
) )
.unwrap_or(pallas::Base::zero()), .unwrap_or(pallas::Base::zero()),
) )

View File

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