Skip to content

Commit

Permalink
slh-dsa: clippy 1.85 fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo committed Feb 24, 2025
1 parent fd4110d commit 733b105
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion slh-dsa/src/fors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub(crate) trait ForsParams: HypertreeParams {
for j in 0..Self::A::U32 {
adrs.tree_height.set(j + 1);
adrs.tree_index.set(adrs.tree_index.get() >> 1);
if indices[i as usize] >> j & 1 == 0 {
if (indices[i as usize] >> j) & 1 == 0 {
node = Self::h(pk_seed, &adrs, &node, &sig.0[i as usize].auth[j as usize]);
} else {
node = Self::h(pk_seed, &adrs, &sig.0[i as usize].auth[j as usize], &node);
Expand Down
1 change: 0 additions & 1 deletion slh-dsa/src/signature_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use pkcs8::{
/// small devices. The stack representation consumes `P::SigLen` bytes
///
/// There are no invariants maintained by this struct - every field is a hash value
pub struct Signature<P: ParameterSet> {
pub(crate) randomizer: Array<u8, P::N>,
pub(crate) fors_sig: ForsSignature<P>,
Expand Down
4 changes: 2 additions & 2 deletions slh-dsa/tests/known_answer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ where
let sk = SigningKey::<P>::new(&mut seed_rng.unwrap_mut());
let pk = sk.verifying_key();

writeln!(resp, "pk = {}", hex::encode_upper(&pk.to_bytes())).unwrap();
writeln!(resp, "sk = {}", hex::encode_upper(&sk.to_bytes())).unwrap();
writeln!(resp, "pk = {}", hex::encode_upper(pk.to_bytes())).unwrap();
writeln!(resp, "sk = {}", hex::encode_upper(sk.to_bytes())).unwrap();

let mut opt_rand = vec![0; P::VkLen::USIZE / 2];
rng.fill_bytes(opt_rand.as_mut());
Expand Down

0 comments on commit 733b105

Please # to comment.