From c3b564ad7cf8f3816f6dcbf431d0e840dd217ca9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 20 Aug 2024 17:32:49 +0000 Subject: [PATCH] fix last parent pull in parent_hashes --- src/treekem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/treekem.cpp b/src/treekem.cpp index 53aeea1c..b9cefa00 100644 --- a/src/treekem.cpp +++ b/src/treekem.cpp @@ -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, {} }); @@ -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(dp.size()); for (int i = static_cast(dp.size()) - 1; i >= 0; i--) {