From 20ad6fca5e98f330470d5f5ceb9161ea511a87bd Mon Sep 17 00:00:00 2001 From: Gottfried Herold Date: Fri, 17 Mar 2023 21:30:47 +0100 Subject: [PATCH] Document that bit_reversal_permutation does not work for n==1 (#224) --- src/c_kzg_4844.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/c_kzg_4844.c b/src/c_kzg_4844.c index 17b796d..d2a529d 100644 --- a/src/c_kzg_4844.c +++ b/src/c_kzg_4844.c @@ -590,11 +590,12 @@ static uint32_t reverse_bits(uint32_t n) { * @param[in,out] values The array, which is re-ordered in-place * @param[in] size The size in bytes of an element of the array * @param[in] n The length of the array, must be a power of two - * less that 2^32 + * strictly greater than 1 and less than 2^32. */ static C_KZG_RET bit_reversal_permutation( void *values, size_t size, uint64_t n ) { + CHECK(n != 0); CHECK(n >> 32 == 0); CHECK(is_power_of_two(n)); CHECK(log2_pow2(n) != 0);