Skip to content

Commit

Permalink
Debug: Fix documentation of mlkem_debug_check_bounds()
Browse files Browse the repository at this point in the history
`mlkem_debug_check_bounds()` and its wrapper macros `BOUNDS()`
etc. are working with _exclusive_ bounds, but the documentation
for `mlkem_debug_check_bounds()` wrongly stated that its bounds
arguments would be inclusive.

This commit fixes the documentation of `mlkem_debug_check_bounds()`
to say that bounds are exclusive.

No change to the code is needed: We only work with the wrapper
macros, and those were already documented and used with exclusive
bounds.

Signed-off-by: Hanno Becker <[email protected]>
  • Loading branch information
hanno-becker committed Oct 31, 2024
1 parent 9c15d6d commit 9203aa8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mlkem/debug/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ void mlkem_debug_assert(const char *file, int line, const char *description,
* - description: Textual description of check
* - ptr: Base of array to be checked
* - len: Number of int16_t in ptr
* - lower_bound_inclusive: Inclusive lower bound
* - upper_bound_inclusive: Inclusive upper bound
* - lower_bound_exclusive: Exclusive lower bound
* - upper_bound_exclusive: Exclusive upper bound
**************************************************/
void mlkem_debug_check_bounds(const char *file, int line,
const char *description, const int16_t *ptr,
unsigned len, int lower_bound_inclusive,
int upper_bound_inclusive);
unsigned len, int lower_bound_exclusive,
int upper_bound_exclusive);

/* Print error message to stderr alongside file and line information */
void mlkem_debug_print_error(const char *file, int line, const char *msg);
Expand Down

0 comments on commit 9203aa8

Please sign in to comment.