Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FAlbertDev committed Jan 10, 2024
1 parent 5a67cec commit 3fcc74d
Show file tree
Hide file tree
Showing 5 changed files with 6 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 @@ -162,4 +162,4 @@ void Classic_McEliece_Decryptor::kem_decrypt(std::span<uint8_t> out_shared_key,
hash_func->final(out_shared_key);
}

} // namespace Botan
} // namespace Botan
2 changes: 1 addition & 1 deletion src/lib/pubkey/classic_mceliece/cmce_decaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ class BOTAN_TEST_API Classic_McEliece_Decryptor final : public PK_Ops::KEM_Decry

} // namespace Botan

#endif // BOTAN_CMCE_DECAPS_H_
#endif // BOTAN_CMCE_DECAPS_H_
2 changes: 1 addition & 1 deletion src/lib/pubkey/classic_mceliece/cmce_encaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ void Classic_McEliece_Encryptor::kem_encrypt(std::span<uint8_t> out_encapsulated
std::ranges::copy(big_k, out_shared_key.begin());
}

} // namespace Botan
} // namespace Botan
2 changes: 1 addition & 1 deletion src/lib/pubkey/classic_mceliece/cmce_encaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ class BOTAN_TEST_API Classic_McEliece_Encryptor final : public PK_Ops::KEM_Encry

} // namespace Botan

#endif // BOTAN_CMCE_ENCAPS_H_
#endif // BOTAN_CMCE_ENCAPS_H_
3 changes: 2 additions & 1 deletion src/lib/pubkey/classic_mceliece/cmce_poly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ std::optional<Classic_McEliece_Minimal_Polynomial> Classic_McEliece_Polynomial_R

secure_vector<uint8_t> Classic_McEliece_Minimal_Polynomial::serialize() const {
BOTAN_ASSERT_NOMSG(!coef().empty());
auto coeffs_to_store = std::ranges::subrange(coef().begin(), coef().end() - 1);
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());
BufferStuffer bytes_stuf(bytes);
for(auto& coef : coeffs_to_store) {
Expand Down

0 comments on commit 3fcc74d

Please sign in to comment.