From e943283f2f4741a4c489134dcc389c63c3f4ee32 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Sun, 9 Oct 2022 21:16:51 +0200 Subject: [PATCH] More mbedtls_mpi_bitlen test cases * with leading zero limb * with trailing zero limb * negative Signed-off-by: Gilles Peskine --- tests/suites/test_suite_mpi.data | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/suites/test_suite_mpi.data b/tests/suites/test_suite_mpi.data index 52dee898d..d88ae13cb 100644 --- a/tests/suites/test_suite_mpi.data +++ b/tests/suites/test_suite_mpi.data @@ -447,6 +447,12 @@ mpi_bitlen:"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe70 Test mbedtls_mpi_bitlen 0x18 mpi_bitlen:"18":5 +Test mbedtls_mpi_bitlen 0x18 with leading 0 limb(s) +mpi_bitlen:"00000000000000018":5 + +Test mbedtls_mpi_bitlen 0x18 << 64 +mpi_bitlen:"180000000000000000":69 + Test mbedtls_mpi_bitlen 0x01 mpi_bitlen:"1":1 @@ -465,6 +471,9 @@ mpi_bitlen:"":0 Test mbedtls_mpi_bitlen: 0 (1 limb) mpi_bitlen:"0":0 +Test mbedtls_mpi_bitlen: -0x18 +mpi_bitlen:"-18":5 + Base test mbedtls_mpi_cmp_int #1 mpi_cmp_int:693:693:0