Fix a couple more lints.
This commit is contained in:
parent
98530184c0
commit
3423b03c6d
|
@ -1,4 +1,3 @@
|
||||||
#![allow(clippy::assertions_on_constants)]
|
|
||||||
//! Implementation of [group hashing into Jubjub][grouphash].
|
//! Implementation of [group hashing into Jubjub][grouphash].
|
||||||
//!
|
//!
|
||||||
//! [grouphash]: https://zips.z.cash/protocol/protocol.pdf#concretegrouphashjubjub
|
//! [grouphash]: https://zips.z.cash/protocol/protocol.pdf#concretegrouphashjubjub
|
||||||
|
@ -12,6 +11,7 @@ use blake2s_simd::Params;
|
||||||
/// Produces a random point in the Jubjub curve.
|
/// Produces a random point in the Jubjub curve.
|
||||||
/// The point is guaranteed to be prime order
|
/// The point is guaranteed to be prime order
|
||||||
/// and not the identity.
|
/// and not the identity.
|
||||||
|
#[allow(clippy::assertions_on_constants)]
|
||||||
pub fn group_hash(tag: &[u8], personalization: &[u8]) -> Option<jubjub::SubgroupPoint> {
|
pub fn group_hash(tag: &[u8], personalization: &[u8]) -> Option<jubjub::SubgroupPoint> {
|
||||||
assert_eq!(personalization.len(), 8);
|
assert_eq!(personalization.len(), 8);
|
||||||
|
|
||||||
|
|
|
@ -347,9 +347,8 @@ fn test_sprout_constraints() {
|
||||||
fn get_u256<R: ReadBytesExt>(mut reader: R) -> [u8; 32] {
|
fn get_u256<R: ReadBytesExt>(mut reader: R) -> [u8; 32] {
|
||||||
let mut result = [0u8; 32];
|
let mut result = [0u8; 32];
|
||||||
|
|
||||||
#[allow(clippy::needless_range_loop)]
|
for b in &mut result {
|
||||||
for i in 0..32 {
|
*b = reader.read_u8().unwrap();
|
||||||
result[i] = reader.read_u8().unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result
|
result
|
||||||
|
@ -375,9 +374,8 @@ fn test_sprout_constraints() {
|
||||||
auth_path[i] = Some((sibling, false));
|
auth_path[i] = Some((sibling, false));
|
||||||
}
|
}
|
||||||
let mut position = test_vector.read_u64::<LittleEndian>().unwrap();
|
let mut position = test_vector.read_u64::<LittleEndian>().unwrap();
|
||||||
#[allow(clippy::needless_range_loop)]
|
for sibling in &mut auth_path {
|
||||||
for i in 0..TREE_DEPTH {
|
if let Some(p) = sibling {
|
||||||
if let Some(p) = auth_path[i].as_mut() {
|
|
||||||
p.1 = (position & 1) == 1;
|
p.1 = (position & 1) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue