Skip to content

Commit

Permalink
Fix uint16_t
Browse files Browse the repository at this point in the history
  • Loading branch information
FAlbertDev committed Jan 10, 2024
1 parent d9a3629 commit 5532a3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/pubkey/classic_mceliece/cmce_poly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ secure_vector<uint8_t> Classic_McEliece_Minimal_Polynomial::serialize() const {
BOTAN_ASSERT_NOMSG(!coef().empty());
auto& all_coeffs = coef();
auto coeffs_to_store = std::span(all_coeffs).subspan(0, all_coeffs.size() - 1);
secure_vector<uint8_t> bytes(sizeof(u_int16_t) * coeffs_to_store.size());
secure_vector<uint8_t> bytes(sizeof(uint16_t) * coeffs_to_store.size());
BufferStuffer bytes_stuf(bytes);
for(auto& coef : coeffs_to_store) {
store_le(coef.elem(), bytes_stuf.next(sizeof(u_int16_t)).data());
store_le(coef.elem(), bytes_stuf.next(sizeof(uint16_t)).data());
}
BOTAN_ASSERT_NOMSG(bytes_stuf.full());
return bytes;
Expand Down

0 comments on commit 5532a3f

Please sign in to comment.