Skip to content

Commit

Permalink
FIXUP Add SST impl
Browse files Browse the repository at this point in the history
  • Loading branch information
aewag committed Sep 6, 2024
1 parent b90d6a8 commit 10737c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hss/reference_impl_private_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@ impl CompressedUsedLeafsIndexes {
}

pub fn from<H: HashChain>(
used_leafs_array: &[u32; MAX_ALLOWED_HSS_LEVELS],
hss_params: &[HssParameter<H>],
used_leafs_indexes: &[u32; MAX_ALLOWED_HSS_LEVELS],
parameters: &[HssParameter<H>],
) -> Self {
let mut compressed_used_leafs_indexes: u64 = 0;

for (i, parameter) in hss_params.iter().enumerate() {
for (i, parameter) in parameters.iter().enumerate() {
let shift: u32 = parameter.get_lms_parameter().get_tree_height().into();
compressed_used_leafs_indexes <<= shift;
compressed_used_leafs_indexes |= used_leafs_array[i] as u64;
compressed_used_leafs_indexes |= used_leafs_indexes[i] as u64;
}

CompressedUsedLeafsIndexes {
Expand Down

0 comments on commit 10737c2

Please sign in to comment.