Skip to content

Commit

Permalink
Apply ceil_division of bitops
Browse files Browse the repository at this point in the history
  • Loading branch information
FAlbertDev committed Jun 13, 2024
1 parent ff3875f commit 3de8f58
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/lib/pubkey/classic_mceliece/cmce_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ namespace Botan {
struct Classic_McEliece_Big_F_Coefficient;
class Classic_McEliece_Polynomial_Ring;

/**
* @returns ceil(n/d)
* TODO: Remove once LMS is merged
*/
constexpr size_t ceil_div(size_t n, size_t d) {
return (n + d - 1) / d;
}

/**
* Container for all Classic McEliece parameters.
*/
Expand Down Expand Up @@ -222,7 +214,7 @@ class BOTAN_TEST_API Classic_McEliece_Parameters final {
/**
* @brief The output byte size of the encoding algorithm. See ISO 7.3
*/
size_t encode_out_size() const { return ceil_div(m() * t(), 8); }
size_t encode_out_size() const { return ceil_division<size_t>(m() * t(), 8); }

/**
* @brief The byte size of the hash output.
Expand Down

0 comments on commit 3de8f58

Please sign in to comment.