1 #include "tommath_private.h"
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
8 * This is used to ensure that leading zero digits are
9 * trimmed and the leading "used" digit will be non-zero
10 * Typically very fast. Also fixes the sign if there
11 * are no more leading digits
13 void mp_clamp(mp_int
*a
)
15 /* decrease used while the most significant digit is
18 while ((a
->used
> 0) && (a
->dp
[a
->used
- 1] == 0u)) {
22 /* reset the sign flag if zero */