Skip to content

Commit

Permalink
Better Types
Browse files Browse the repository at this point in the history
  • Loading branch information
FAlbertDev committed Jan 10, 2024
1 parent 1a4a5a9 commit 7f63e04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/pubkey/classic_mceliece/cmce_decaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Classic_McEliece_Polynomial Classic_McEliece_Decryptor::berlekamp_massey(
}

auto mne = GF_Mask::expand(d);
auto mle = GF_Mask(CT::Mask<uint16_t>::is_lte(2 * big_l, big_n));
auto mle = GF_Mask(CT::Mask<uint16_t>::is_lte(uint16_t(2 * big_l), uint16_t(big_n)));
mle &= mne;

big_t = big_c; // Copy
Expand Down
4 changes: 2 additions & 2 deletions src/lib/pubkey/classic_mceliece/cmce_field_ordering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ secure_vector<uint16_t> Classic_McEliece_Field_Ordering::generate_control_bits_i
}

secure_vector<uint16_t> big_f(n);
for(size_t x = 0; x < n; ++x) {
for(uint16_t x = 0; size_t(x) < n; ++x) {
big_f.at(x) = x ^ f.at(x / 2);
}

Expand All @@ -247,7 +247,7 @@ secure_vector<uint16_t> Classic_McEliece_Field_Ordering::generate_control_bits_i
}

secure_vector<uint16_t> big_l(n);
for(size_t y = 0; y < n; ++y) {
for(uint16_t y = 0; size_t(y) < n; ++y) {
big_l.at(y) = y ^ l.at(y / 2);
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils/bitvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ class bitvector_base final {
constexpr bool is_set() const noexcept { return (m_block & m_mask) > 0; }

protected:
BlockT& m_block; // NOLINT(*-non-private-member-variables-in-classes)
size_type m_mask; // NOLINT(*-non-private-member-variables-in-classes)
BlockT& m_block; // NOLINT(*-non-private-member-variables-in-classes)
BlockT m_mask; // NOLINT(*-non-private-member-variables-in-classes)
};

public:
Expand Down

0 comments on commit 7f63e04

Please sign in to comment.