Skip to content

Commit

Permalink
fix some clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
FAlbertDev committed Sep 27, 2023
1 parent 61a7662 commit 0232dba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/pubkey/hss_lms/hss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ std::vector<LMS_Tree_Node_Idx> derive_lms_leaf_indices_from_hss_index(HSS_Sig_Id
HSS_Level layer(layer_ctr);
const HSS_LMS_Params::LMS_LMOTS_Params_Pair& layer_params = hss_params.params_at_level(layer);
size_t layer_h = layer_params.lms_params().h();
q.at(layer.get()) = LMS_Tree_Node_Idx(hss_idx.get() % (1ULL << layer_h));
q.at(layer.get()) = LMS_Tree_Node_Idx(hss_idx.get() % (1UL << layer_h));
hss_idx = hss_idx >> layer_h;
}
BOTAN_ARG_CHECK(hss_idx == HSS_Sig_Idx(0), "HSS Tree is exhausted");
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pubkey/hss_lms/lms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using LMS_TreeLayerIndex = Strong<uint32_t, struct LMS_TreeLayerIndex_, EnableAr

class TreeAddress final {
public:
explicit TreeAddress(uint32_t total_tree_height) : m_h(total_tree_height) {
explicit TreeAddress(uint32_t total_tree_height) : m_h(total_tree_height), m_r(0) {
BOTAN_ARG_CHECK(total_tree_height > 0 && total_tree_height < 32, "Invalid tree hight");
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/tree_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ inline void compute_root(
concepts::tree_hash_node_pair<TreeNodeIndex, TreeLayerIndex, Address, StrongSpan<TreeNode>> auto node_pair_hash,
Address& tree_address) {
BOTAN_ASSERT_NOMSG(out_root.size() == node_size);
BOTAN_ASSERT_NOMSG(authentication_path.size() == node_size * total_tree_height);
BOTAN_ASSERT_NOMSG(authentication_path.size() == node_size * static_cast<size_t>(total_tree_height.get()));
BOTAN_ASSERT_NOMSG(leaf.size() == node_size);

// Use the `out` parameter as intermediate buffer for left/right nodes
Expand Down

0 comments on commit 0232dba

Please sign in to comment.