Skip to content

Commit

Permalink
fix last parent pull in parent_hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
birarda committed Aug 20, 2024
1 parent 3c8ad5c commit c3b564a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/treekem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ TreeKEMPublicKey::parent_hashes(
// excluding root, including leaf
auto from_node = NodeIndex(from);
auto dp = fdp;
auto [last, _res_last] = dp.back();
dp.pop_back();
dp.insert(dp.begin(), { from_node, {} });

Expand All @@ -914,7 +915,6 @@ TreeKEMPublicKey::parent_hashes(
}

// Parent hash for all the parents, starting from the root
auto last = NodeIndex::root(size);
auto last_hash = bytes{};
auto ph = std::vector<bytes>(dp.size());
for (int i = static_cast<int>(dp.size()) - 1; i >= 0; i--) {
Expand Down

0 comments on commit c3b564a

Please sign in to comment.