From 01af3ddc82e101974dd1e8b9c45ac909d9032c34 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 4 Oct 2022 16:23:29 +0200 Subject: [PATCH] Fixed confusion between number size and limb size; define limb Signed-off-by: Gilles Peskine --- library/bignum_core.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/bignum_core.h b/library/bignum_core.h index 2274a8a904..c64ce4e866 100644 --- a/library/bignum_core.h +++ b/library/bignum_core.h @@ -7,15 +7,17 @@ * or the legacy bignum interface (bignum.h). * * This module is about processing non-negative integers with a fixed upper - * bound that's of the form 2^#biL-1. Many operations treat these numbers - * as the principal representation of a number modulo 2^#biL or a smaller - * bound. + * bound that's of the form 2^n-1 where n is a multiple of #biL. + * These can be thought of integers written in base 2^#biL with a fixed + * number of digits. Digits in this base are called *limbs*. + * Many operations treat these numbers as the principal representation of + * a number modulo 2^n or a smaller bound. * * The functions in this module obey the following conventions unless * explicitly indicated otherwise: * * - **Overflow**: some functions indicate overflow from the range - * [0, 2^#biL-1] by returning carry parameters, while others operate + * [0, 2^n-1] by returning carry parameters, while others operate * modulo and so cannot overflow. This should be clear from the function * documentation. * - **Bignum parameters**: Bignums are passed as pointers to an array of