Skip to content

Commit f17c800

Browse files
committed
mbedtls_mpi_lt_mpi_ct: add tests for 32 bit limbs
The corner case tests were designed for 64 bit limbs and failed on 32 bit platforms because the numbers in the test ended up being stored in a different number of limbs and the function (correctly) returnd an error upon receiving them.
1 parent c50e6d5 commit f17c800

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

tests/suites/test_suite_mpi.data

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,46 @@ mbedtls_mpi_lt_mpi_ct:3:"2B5":2:"2B5":0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA
208208
Base test mbedtls_mpi_lt_mpi_ct (Y is longer in storage) #8
209209
mbedtls_mpi_lt_mpi_ct:3:"2B5":4:"2B5":0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA
210210

211-
Base test mbedtls_mpi_lt_mpi_ct (corner case) #1
211+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #1
212+
depends_on:MBEDTLS_HAVE_INT64
212213
mbedtls_mpi_lt_mpi_ct:1:"7FFFFFFFFFFFFFFF":1:"FF":0:0
213214

214-
Base test mbedtls_mpi_lt_mpi_ct (corner case) #2
215+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #2
216+
depends_on:MBEDTLS_HAVE_INT64
215217
mbedtls_mpi_lt_mpi_ct:1:"8000000000000000":1:"7FFFFFFFFFFFFFFF":0:0
216218

217-
Base test mbedtls_mpi_lt_mpi_ct (corner case) #2
219+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #3
220+
depends_on:MBEDTLS_HAVE_INT64
218221
mbedtls_mpi_lt_mpi_ct:1:"8000000000000000":1:"1":0:0
219222

220-
Base test mbedtls_mpi_lt_mpi_ct (corner case) #2
223+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #4
224+
depends_on:MBEDTLS_HAVE_INT64
221225
mbedtls_mpi_lt_mpi_ct:1:"8000000000000000":1:"0":0:0
222226

223-
Base test mbedtls_mpi_lt_mpi_ct (corner case) #3
227+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #5
228+
depends_on:MBEDTLS_HAVE_INT64
224229
mbedtls_mpi_lt_mpi_ct:1:"FFFFFFFFFFFFFFFF":1:"FF":0:0
225230

231+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #1
232+
depends_on:MBEDTLS_HAVE_INT32
233+
mbedtls_mpi_lt_mpi_ct:1:"7FFFFFFF":1:"FF":0:0
234+
235+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #2
236+
depends_on:MBEDTLS_HAVE_INT32
237+
mbedtls_mpi_lt_mpi_ct:1:"80000000":1:"7FFFFFFF":0:0
238+
239+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #3
240+
depends_on:MBEDTLS_HAVE_INT32
241+
mbedtls_mpi_lt_mpi_ct:1:"80000000":1:"1":0:0
242+
243+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #4
244+
depends_on:MBEDTLS_HAVE_INT32
245+
mbedtls_mpi_lt_mpi_ct:1:"80000000":1:"0":0:0
246+
247+
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #5
248+
depends_on:MBEDTLS_HAVE_INT32
249+
mbedtls_mpi_lt_mpi_ct:1:"FFFFFFFF":1:"FF":0:0
250+
226251
Multi-limb mbedtls_mpi_lt_mpi_ct (X<Y, zero vs non-zero MS limb) #1
227252
mbedtls_mpi_lt_mpi_ct:2:"0FFFFFFFFFFFFFFFF":2:"1FFFFFFFFFFFFFFFF":1:0
228253

0 commit comments

Comments
 (0)