linux/lib/crypto/mpi
David Laight 80b61046b6 crypto: lib/mpi - use min() instead of min_t()
min_t(unsigned int, a, b) casts an 'unsigned long' to 'unsigned int'.
Use min(a, b) instead as it promotes any 'unsigned int' to 'unsigned long'
and so cannot discard significant bits.

In this case the 'unsigned long' value is small enough that the result
is ok.

Detected by an extra check added to min_t().

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-11-24 17:44:14 +08:00
..
Makefile Revert "lib/mpi: Extend the MPI library" 2024-08-17 13:55:50 +08:00
generic_mpih-add1.c
generic_mpih-lshift.c
generic_mpih-mul1.c
generic_mpih-mul2.c
generic_mpih-mul3.c
generic_mpih-rshift.c
generic_mpih-sub1.c
longlong.h
mpi-add.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
mpi-bit.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
mpi-cmp.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
mpi-div.c crypto: lib/mpi - Add error checks to extension 2024-08-17 13:55:50 +08:00
mpi-inline.h
mpi-internal.h crypto: lib/mpi - Add error checks to extension 2024-08-17 13:55:50 +08:00
mpi-mod.c crypto: lib/mpi - Add error checks to extension 2024-08-17 13:55:50 +08:00
mpi-mul.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
mpi-pow.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
mpi-sub-ui.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
mpicoder.c crypto: lib/mpi - use min() instead of min_t() 2025-11-24 17:44:14 +08:00
mpih-cmp.c
mpih-div.c
mpih-mul.c Revert "lib/mpi: Extend the MPI library" 2024-08-17 13:55:50 +08:00
mpiutil.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00