Skip to content

Commit

Permalink
FIXUP WIP More throughly use SstExtension and Option
Browse files Browse the repository at this point in the history
  • Loading branch information
aewag committed Sep 6, 2024
1 parent 8027775 commit 9b218f4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/hss/reference_impl_private_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,9 @@ impl<H: HashChain> ReferenceImplPrivateKey<H> {
) -> Result<Self, ()> {
let top_lms_parameter = parameters[0].get_lms_parameter();

let used_leafs_index = if let Some(sst_extension) = &sst_option {
helper::get_sst_first_leaf_idx(top_lms_parameter, sst_extension)
} else {
0
};
let used_leafs_index = sst_option.as_ref().map_or(0, |sst_extension| {
helper::get_sst_first_leaf_idx(top_lms_parameter, &sst_extension)
});

let mut arr: [u32; MAX_ALLOWED_HSS_LEVELS] = [0; MAX_ALLOWED_HSS_LEVELS];
arr[0] = used_leafs_index;
Expand Down

0 comments on commit 9b218f4

Please sign in to comment.