Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Clang 13 on Mac OS - mpi does not pass tests #5052

Closed
LeviSchuck opened this issue Oct 9, 2021 · 5 comments
Closed

Apple Clang 13 on Mac OS - mpi does not pass tests #5052

LeviSchuck opened this issue Oct 9, 2021 · 5 comments
Assignees

Comments

@LeviSchuck
Copy link

LeviSchuck commented Oct 9, 2021

Summary

Mbedtls when compiled with the apple clang compiler on aarch64 and x86_64 architectures does not have functioning mod-exponentiation or prime checking. It does work however with GCC as expected and without source modification. It does work with an older version of apple clang from xcode 12. Xcode 13 was released on September 20, 2021.

The development work has already been done on the development and development_2.x branches to fix this issue. There's just not tagged release with these fixes included at this time.

System information

Mbed TLS version (number or commit id):

Operating system and version: macOS Big Sur Version 11.6

  • Darwin Mac-mini 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101 arm64
  • Darwin Mac-Mini 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Configuration (if not default, please attach mbedtls_config.h): default
Compiler and options (if you used a pre-built binary, please indicate how you obtained it):
Default options

clang -v
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

On another machine for x86

cc -v
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Additional environment information:

Expected behavior

I expect the tests to pass and for linked applications to be able to generate rsa keys among other useful mpi capabilities.

Actual behavior

Generating an RSA key stalls forever because mod exponentiation and prime checks appear broken.
When I run make test with the default configuration it stalls on the MPI test suite, the CPU for this process is at 100%.

When I run just the mpi test suite directly, here is the following output.

MPI - Valid parameters ............................................ PASS
MPI - Invalid parameters .......................................... ----
Arguments with no value ........................................... PASS
Base test mpi_read_write_string #1 ................................ PASS
Base test mpi_read_write_string #1 (Leading 0) .................... PASS
Base test mpi_read_write_string #2 ................................ PASS
Base test mpi_read_write_string #3 (Read zero decimal) ............ PASS
Base test mpi_read_write_string #3 (Read zero hex) ................ PASS
Base test mpi_read_write_string #3 (Read minus zero decimal) ...... PASS
Base test mpi_read_write_string #3 (Read minus zero hex) .......... PASS
Base test mpi_read_write_string #3 (Negative decimal) ............. PASS
Base test mpi_read_write_string #3 (Negative decimal, leading 0) .. PASS
Base test mpi_read_write_string #3 (Negative hex -> decimal) ...... PASS
Base test mpi_read_write_string #3 (Negative hex) ................. PASS
Base test mpi_read_write_string #3 (Negative hex, leading 0) ...... PASS
Base test mpi_read_write_string #4 (Buffer just fits) ............. PASS
Test mpi_read_write_string #1 (Invalid character) ................. PASS
Test mpi_read_write_string #2 (Illegal input radix) ............... PASS
Test mpi_read_write_string #3 (Buffer just fits) .................. PASS
Test mpi_read_write_string #4 (Buffer too small) .................. PASS
Test mpi_read_write_string #5 (Illegal output radix) .............. PASS
Test mpi_read_write_string #6 (Output radix of 15) ................ PASS
Test mpi_read_write_string #7 ..................................... PASS
Test mpi_read_write_string #8 (Empty MPI hex -> hex) .............. PASS
Test mpi_read_write_string #9 (Empty MPI hex -> dec) .............. PASS
Test mpi_read_write_string #8 (Empty MPI dec -> hex) .............. PASS
Test mpi_read_write_string #9 (Empty MPI dec -> dec) .............. PASS
Test mpi_write_string #10 (Negative hex with odd number of digits)  PASS
Base test mbedtls_mpi_read_binary #1 .............................. PASS
Base test mbedtls_mpi_read_binary_le #1 ........................... PASS
Base test mbedtls_mpi_write_binary #1 ............................. PASS
Test mbedtls_mpi_write_binary #1 (Buffer just fits) ............... PASS
Test mbedtls_mpi_write_binary #2 (Buffer too small) ............... PASS
Base test mbedtls_mpi_write_binary_le #1 .......................... PASS
Test mbedtls_mpi_write_binary_le #1 (Buffer just fits) ............ PASS
Test mbedtls_mpi_write_binary_le #2 (Buffer too small) ............ PASS
Base test mbedtls_mpi_read_file #1 ................................ PASS
Test mbedtls_mpi_read_file #1 (Empty file) ........................ PASS
Test mbedtls_mpi_read_file #2 (Illegal input) ..................... PASS
Test mbedtls_mpi_read_file #3 (Input too big) ..................... PASS
Base test mbedtls_mpi_write_file #1 ............................... PASS
Test mbedtls_mpi_lsb: 0 (null) .................................... PASS
Test mbedtls_mpi_lsb: 0 (1 limb) .................................. PASS
Base test mbedtls_mpi_lsb #1 ...................................... PASS
Base test mbedtls_mpi_lsb #2 ...................................... PASS
Base test mbedtls_mpi_lsb #3 ...................................... PASS
Base test mbedtls_mpi_lsb #4 ...................................... PASS
Base test mbedtls_mpi_bitlen #1 ................................... PASS
Base test mbedtls_mpi_bitlen #2 ................................... PASS
Base test mbedtls_mpi_bitlen #3 ................................... PASS
Base test mbedtls_mpi_bitlen #4 ................................... PASS
Base test mbedtls_mpi_bitlen #5 ................................... PASS
Base test mbedtls_mpi_bitlen #6 ................................... PASS
Base test mbedtls_mpi_bitlen: 0 (null) ............................ PASS
Base test mbedtls_mpi_bitlen: 0 (1 limb) .......................... PASS
Base test mbedtls_mpi_cmp_int #1 .................................. PASS
Base test mbedtls_mpi_cmp_int #2 .................................. PASS
Base test mbedtls_mpi_cmp_int #3 .................................. PASS
Base test mbedtls_mpi_cmp_int (Negative values) #1 ................ PASS
Base test mbedtls_mpi_cmp_int (Negative values) #2 ................ PASS
Base test mbedtls_mpi_cmp_int (Negative values) #3 ................ PASS
Base test mbedtls_mpi_cmp_mpi #1 .................................. PASS
Base test mbedtls_mpi_cmp_mpi #2 .................................. PASS
Base test mbedtls_mpi_cmp_mpi #3 .................................. PASS
Base test mbedtls_mpi_cmp_mpi (Negative values) #1 ................ PASS
Base test mbedtls_mpi_cmp_mpi (Negative values) #2 ................ PASS
Base test mbedtls_mpi_cmp_mpi (Negative values) #3 ................ PASS
Base test mbedtls_mpi_cmp_mpi (Mixed values) #4 ................... PASS
Base test mbedtls_mpi_cmp_mpi (Mixed values) #5 ................... PASS
Base test mbedtls_mpi_cmp_mpi (Mixed values) #6 ................... PASS
Test mbedtls_mpi_cmp_mpi: 0 (null) = 0 (null) ..................... PASS
Test mbedtls_mpi_cmp_mpi: 0 (null) = 0 (1 limb) ................... PASS
Test mbedtls_mpi_cmp_mpi: 0 (1 limb) = 0 (null) ................... PASS
Test mbedtls_mpi_cmp_mpi: 0 (1 limb) = 0 (1 limb) ................. PASS
Test mbedtls_mpi_cmp_mpi: 0 (null) < positive ..................... PASS
Test mbedtls_mpi_cmp_mpi: 0 (1 limb) < positive ................... PASS
Test mbedtls_mpi_cmp_mpi: 0 (null) > negative ..................... PASS
Test mbedtls_mpi_cmp_mpi: 0 (1 limb) > negative ................... PASS
Test mbedtls_mpi_cmp_mpi: positive > 0 (null) ..................... PASS
Test mbedtls_mpi_cmp_mpi: positive > 0 (1 limb) ................... PASS
Test mbedtls_mpi_cmp_mpi: negative < 0 (null) ..................... PASS
Test mbedtls_mpi_cmp_mpi: negative < 0 (1 limb) ................... PASS
Test mbedtls_mpi_cmp_mpi: 0 (null) < positive with leading zero li  PASS
Test mbedtls_mpi_cmp_mpi: 0 (1 limb) < positive with leading zero   PASS
Test mbedtls_mpi_cmp_mpi: 0 (null) > negative with leading zero li  PASS
Test mbedtls_mpi_cmp_mpi: 0 (1 limb) > negative with leading zero   PASS
Test mbedtls_mpi_cmp_mpi: positive with leading zero limb > 0 (nul  PASS
Test mbedtls_mpi_cmp_mpi: positive with leading zero limb > 0 (1 l  PASS
Test mbedtls_mpi_cmp_mpi: negative with leading zero limb < 0 (nul  PASS
Test mbedtls_mpi_cmp_mpi: negative with leading zero limb < 0 (1 l  PASS
Test mbedtls_mpi_cmp_mpi: 0 (null) < large positive ............... PASS
Test mbedtls_mpi_cmp_mpi: 0 (1 limb) < large positive ............. PASS
Test mbedtls_mpi_cmp_mpi: 0 (null) > large negative ............... PASS
Test mbedtls_mpi_cmp_mpi: 0 (1 limb) > large negative ............. PASS
Test mbedtls_mpi_cmp_mpi: large positive > 0 (null) ............... PASS
Test mbedtls_mpi_cmp_mpi: large positive > 0 (1 limb) ............. PASS
Test mbedtls_mpi_cmp_mpi: large negative < 0 (null) ............... PASS
Test mbedtls_mpi_cmp_mpi: large negative < 0 (1 limb) ............. PASS
Base test mbedtls_mpi_lt_mpi_ct #1 ................................ PASS
Base test mbedtls_mpi_lt_mpi_ct #2 ................................ PASS
Base test mbedtls_mpi_lt_mpi_ct #3 ................................ PASS
Base test mbedtls_mpi_lt_mpi_ct (Negative values) #1 .............. PASS
Base test mbedtls_mpi_lt_mpi_ct (Negative values) #2 .............. PASS
Base test mbedtls_mpi_lt_mpi_ct (Negative values) #3 .............. PASS
Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #1 ................. PASS
Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #2 ................. PASS
Base test mbedtls_mpi_lt_mpi_ct (Mixed values) #3 ................. PASS
Base test mbedtls_mpi_lt_mpi_ct (X is longer in storage) .......... PASS
Base test mbedtls_mpi_lt_mpi_ct (Y is longer in storage) .......... PASS
Base test mbedtls_mpi_lt_mpi_ct (length=0) ........................ PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #1 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #2 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #3 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #4 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 64 bit) #5 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #1 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #2 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #3 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #4 ......... PASS
Base test mbedtls_mpi_lt_mpi_ct (corner case - 32 bit) #5 ......... PASS
Multi-limb mbedtls_mpi_lt_mpi_ct (X<Y, zero vs non-zero MS limb) .. PASS
Multi-limb mbedtls_mpi_lt_mpi_ct (X>Y, equal MS limbs) ............ PASS
Multi-limb mbedtls_mpi_lt_mpi_ct (X=Y) ............................ PASS
Multi-limb mbedtls_mpi_lt_mpi_ct (X=-Y) ........................... PASS
Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #1 ........... PASS
Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #2 ........... PASS
Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #3 ........... PASS
Multi-limb mbedtls_mpi_lt_mpi_ct (Alternating limbs) #4 ........... PASS
Base test mbedtls_mpi_cmp_abs #1 .................................. PASS
Base test mbedtls_mpi_cmp_abs #2 .................................. PASS
Base test mbedtls_mpi_cmp_abs #3 .................................. PASS
Base test mbedtls_mpi_cmp_abs (Negative values) #1 ................ PASS
Base test mbedtls_mpi_cmp_abs (Negative values) #2 ................ PASS
Base test mbedtls_mpi_cmp_abs (Negative values) #3 ................ PASS
Test mbedtls_mpi_cmp_abs: 0 (null) = 0 (null) ..................... PASS
Test mbedtls_mpi_cmp_abs: 0 (null) = 0 (1 limb) ................... PASS
Test mbedtls_mpi_cmp_abs: 0 (1 limb) = 0 (null) ................... PASS
Test mbedtls_mpi_cmp_abs: 0 (1 limb) = 0 (1 limb) ................. PASS
Base test mbedtls_mpi_cmp_abs (Mix values) #1 ..................... PASS
Base test mbedtls_mpi_cmp_abs (Mix values) #2 ..................... PASS
Base test mbedtls_mpi_cmp_abs (Mix values) #3 ..................... PASS
Copy large negative to large negative ............................. PASS
Copy large negative to large positive ............................. PASS
Copy large negative to small negative ............................. PASS
Copy large negative to small positive ............................. PASS
Copy large negative to zero (1 limb) .............................. PASS
Copy large negative to zero (null) ................................ PASS
Copy large positive to large negative ............................. PASS
Copy large positive to large positive ............................. PASS
Copy large positive to small negative ............................. PASS
Copy large positive to small positive ............................. PASS
Copy large positive to zero (1 limb) .............................. PASS
Copy large positive to zero (null) ................................ PASS
Copy small negative to large negative ............................. PASS
Copy small negative to large positive ............................. PASS
Copy small negative to small negative ............................. PASS
Copy small negative to small positive ............................. PASS
Copy small negative to zero (1 limb) .............................. PASS
Copy small negative to zero (null) ................................ PASS
Copy small positive to large negative ............................. PASS
Copy small positive to large positive ............................. PASS
Copy small positive to small negative ............................. PASS
Copy small positive to small positive ............................. PASS
Copy small positive to zero (1 limb) .............................. PASS
Copy small positive to zero (null) ................................ PASS
Copy zero (1 limb) to large negative .............................. PASS
Copy zero (1 limb) to large positive .............................. PASS
Copy zero (1 limb) to small negative .............................. PASS
Copy zero (1 limb) to small positive .............................. PASS
Copy zero (1 limb) to zero (1 limb) ............................... PASS
Copy zero (1 limb) to zero (null) ................................. PASS
Copy zero (null) to large negative ................................ PASS
Copy zero (null) to large positive ................................ PASS
Copy zero (null) to small negative ................................ PASS
Copy zero (null) to small positive ................................ PASS
Copy zero (null) to zero (1 limb) ................................. PASS
Copy zero (null) to zero (null) ................................... PASS
Copy self: large negative ......................................... PASS
Copy self: large positive ......................................... PASS
Copy self: small negative ......................................... PASS
Copy self: small positive ......................................... PASS
Copy self: zero (1 limb) .......................................... PASS
Copy self: zero (null) ............................................ PASS
Swap large negative with large negative ........................... PASS
Swap large negative with large positive ........................... PASS
Swap large negative with small negative ........................... PASS
Swap large negative with small positive ........................... PASS
Swap large negative with zero (1 limb) ............................ PASS
Swap large negative with zero (null) .............................. PASS
Swap large positive with large negative ........................... PASS
Swap large positive with large positive ........................... PASS
Swap large positive with small negative ........................... PASS
Swap large positive with small positive ........................... PASS
Swap large positive with zero (1 limb) ............................ PASS
Swap large positive with zero (null) .............................. PASS
Swap small negative with large negative ........................... PASS
Swap small negative with large positive ........................... PASS
Swap small negative with small negative ........................... PASS
Swap small negative with small positive ........................... PASS
Swap small negative with zero (1 limb) ............................ PASS
Swap small negative with zero (null) .............................. PASS
Swap small positive with large negative ........................... PASS
Swap small positive with large positive ........................... PASS
Swap small positive with small negative ........................... PASS
Swap small positive with small positive ........................... PASS
Swap small positive with zero (1 limb) ............................ PASS
Swap small positive with zero (null) .............................. PASS
Swap zero (1 limb) with large negative ............................ PASS
Swap zero (1 limb) with large positive ............................ PASS
Swap zero (1 limb) with small negative ............................ PASS
Swap zero (1 limb) with small positive ............................ PASS
Swap zero (1 limb) with zero (1 limb) ............................. PASS
Swap zero (1 limb) with zero (null) ............................... PASS
Swap zero (null) with large negative .............................. PASS
Swap zero (null) with large positive .............................. PASS
Swap zero (null) with small negative .............................. PASS
Swap zero (null) with small positive .............................. PASS
Swap zero (null) with zero (1 limb) ............................... PASS
Swap zero (null) with zero (null) ................................. PASS
Swap self: large negative ......................................... PASS
Swap self: large positive ......................................... PASS
Swap self: small negative ......................................... PASS
Swap self: small positive ......................................... PASS
Swap self: zero (1 limb) .......................................... PASS
Swap self: zero (null) ............................................ PASS
Shrink 0 limbs in a buffer of size 0 to 0 ......................... PASS
Shrink 2 limbs in a buffer of size 2 to 4 ......................... PASS
Shrink 2 limbs in a buffer of size 4 to 4 ......................... PASS
Shrink 2 limbs in a buffer of size 8 to 4 ......................... PASS
Shrink 4 limbs in a buffer of size 8 to 4 ......................... PASS
Shrink 6 limbs in a buffer of size 8 to 4 yielding 6 .............. PASS
Shrink 2 limbs in a buffer of size 4 to 0 yielding 2 .............. PASS
Shrink 1 limbs in a buffer of size 4 to 0 yielding 1 .............. PASS
Shrink 0 limbs in a buffer of size 4 to 0 yielding 1 .............. PASS
Base test mbedtls_mpi_add_abs #1 .................................. PASS
Base test mbedtls_mpi_add_abs #2 .................................. PASS
Base test mbedtls_mpi_add_abs #3 .................................. PASS
Base test mbedtls_mpi_add_abs #4 .................................. PASS
Test mbedtls_mpi_add_abs: 0 (null) + 0 (null) ..................... PASS
Test mbedtls_mpi_add_abs: 0 (null) + 1 ............................ PASS
Test mbedtls_mpi_add_abs: 1 + 0 (null) ............................ PASS
Test mbedtls_mpi_add_abs #1 ....................................... PASS
Regression mbedtls_mpi_add_abs (add small to very large MPI with c  PASS
Regression mbedtls_mpi_add_abs (add small to very large MPI with c  PASS
Base test mbedtls_mpi_add_mpi #1 .................................. PASS
Base test mbedtls_mpi_add_mpi #2 .................................. PASS
Base test mbedtls_mpi_add_mpi #3 .................................. PASS
Base test mbedtls_mpi_add_mpi #4 .................................. PASS
Test mbedtls_mpi_add_mpi: 0 (null) + 0 (null) ..................... PASS
Test mbedtls_mpi_add_mpi: 0 (null) + 1 ............................ PASS
Test mbedtls_mpi_add_mpi: 1 + 0 (null) ............................ PASS
Test mbedtls_mpi_add_mpi: 0 (null) + -1 ........................... PASS
Test mbedtls_mpi_add_mpi: -1 + 0 (null) ........................... PASS
Test mbedtls_mpi_add_mpi #1 ....................................... PASS
Test mbedtls_mpi_add_mpi #2 ....................................... PASS
Base test mbedtls_mpi_add_mpi inplace #1 .......................... PASS
Test mbedtls_mpi_add_mpi inplace #2 ............................... PASS
Test mbedtls_mpi_add_mpi inplace #3 ............................... PASS
Test mbedtls_mpi_add_int #1 ....................................... PASS
Test mbedtls_mpi_add_int #2 ....................................... PASS
Test mbedtls_mpi_add_int: 0 (null) + 0 ............................ PASS
Test mbedtls_mpi_add_int: 0 (null) + 1 ............................ PASS
Base test mbedtls_mpi_sub_abs #1 (|B| > |A|) ...................... PASS
Base test mbedtls_mpi_sub_abs #2 (|B| > |A|) ...................... PASS
Base test mbedtls_mpi_sub_abs #3 (|B| > |A|) ...................... PASS
Base test mbedtls_mpi_sub_abs #4 (|B| > |A|) ...................... PASS
Base test mbedtls_mpi_sub_abs #1 (|B| >> |A| with more limbs) ..... PASS
Base test mbedtls_mpi_sub_abs #2 (|B| >> |A| with more limbs) ..... PASS
Base test mbedtls_mpi_sub_abs #3 (|B| >> |A| with more limbs) ..... PASS
Base test mbedtls_mpi_sub_abs #4 (|B| >> |A| with more limbs) ..... PASS
Base test mbedtls_mpi_sub_abs #1 .................................. PASS
Base test mbedtls_mpi_sub_abs #2 .................................. PASS
Base test mbedtls_mpi_sub_abs #3 .................................. PASS
Base test mbedtls_mpi_sub_abs #4 .................................. PASS
Test mbedtls_mpi_sub_abs: 0 (null) - 0 (null) ..................... PASS
Test mbedtls_mpi_sub_abs: 0 (null) - 0 (1 limb) ................... PASS
Test mbedtls_mpi_sub_abs: 0 (1 limb) - 0 (null) ................... PASS
Test mbedtls_mpi_sub_abs: 0 (1 limb) - 0 (1 limb) ................. PASS
Test mbedtls_mpi_sub_abs: 1 - 0 (null) ............................ PASS
Test mbedtls_mpi_sub_abs: 0 (null) - 1 ............................ PASS
Test mbedtls_mpi_sub_abs #1 ....................................... PASS
Test mbedtls_mpi_sub_abs #2 ....................................... PASS
Test mbedtls_mpi_sub_abs #3 ....................................... PASS
Test mbedtls_mpi_sub_abs #4 ....................................... PASS
Base test mbedtls_mpi_sub_mpi #1 (Test with negative result) ...... PASS
Base test mbedtls_mpi_sub_mpi #2 (Test with negative inputs) ...... PASS
Base test mbedtls_mpi_sub_mpi #3 (Test with negative base) ........ PASS
Base test mbedtls_mpi_sub_mpi #4 (Test with negative subtraction) . PASS
Test mbedtls_mpi_sub_mpi: 0 (null) - 0 (null) ..................... PASS
Test mbedtls_mpi_sub_mpi: 0 (null) - 0 (1 limb) ................... PASS
Test mbedtls_mpi_sub_mpi: 0 (null) - 1 ............................ PASS
Test mbedtls_mpi_sub_mpi: 0 (null) - -1 ........................... PASS
Test mbedtls_mpi_sub_mpi: 0 (1 limb) - 0 (null) ................... PASS
Test mbedtls_mpi_sub_mpi: 1 - 0 (null) ............................ PASS
Test mbedtls_mpi_sub_mpi: -1 - 0 (null) ........................... PASS
Test mbedtls_mpi_sub_mpi #1 ....................................... PASS
Test mbedtls_mpi_sub_mpi #2 (Test for negative result) ............ PASS
Test mbedtls_mpi_sub_int #1 ....................................... PASS
Test mbedtls_mpi_sub_int #2 ....................................... PASS
Test mbedtls_mpi_sub_int: 0 (null) - 0 ............................ PASS
Test mbedtls_mpi_sub_int: 0 (null) - 1 ............................ PASS
Test mbedtls_mpi_sub_int: 0 (null) - -1 ........................... PASS
Test mbedtls_mpi_shift_l #1 ....................................... PASS
Test mbedtls_mpi_shift_l #2 ....................................... PASS
Test mbedtls_mpi_shift_l: 0 (null) <<= 0 .......................... PASS
Test mbedtls_mpi_shift_l: 0 (null) <<= 1 .......................... PASS
Test mbedtls_mpi_shift_l: 0 (null) <<= 64 ......................... PASS
Test mbedtls_mpi_shift_r #1 ....................................... PASS
Test mbedtls_mpi_shift_r #2 ....................................... PASS
Test mbedtls_mpi_shift_r #4 [#1] .................................. PASS
Test mbedtls_mpi_shift_r #4 [#2] .................................. PASS
Test mbedtls_mpi_shift_r #6 ....................................... PASS
Test mbedtls_mpi_shift_r #7 ....................................... PASS
Test mbedtls_mpi_shift_r: 0 (null) >>= 0 .......................... PASS
Test mbedtls_mpi_shift_r: 0 (null) >>= 1 .......................... PASS
Test mbedtls_mpi_shift_r: 0 (null) >>= 64 ......................... PASS
Base test mbedtls_mpi_mul_mpi #1 .................................. PASS
Base test mbedtls_mpi_mul_mpi #2 .................................. PASS
Base test mbedtls_mpi_mul_mpi #3 .................................. PASS
Base test mbedtls_mpi_mul_mpi #4 .................................. PASS
Test mbedtls_mpi_mul_mpi: 0 (null) * 0 (null) ..................... PASS
Test mbedtls_mpi_mul_mpi: 0 (null) * 0 (1 limb) ................... PASS
Test mbedtls_mpi_mul_mpi: 0 (null) * 1 ............................ PASS
Test mbedtls_mpi_mul_mpi: 0 (null) * -1 ........................... PASS
Test mbedtls_mpi_mul_mpi: 0 (1 limb) * -1 ......................... PASS
Test mbedtls_mpi_mul_mpi: 0 (1 limb) * 0 (null) ................... PASS
Test mbedtls_mpi_mul_mpi: 1 * 0 (null) ............................ PASS
Test mbedtls_mpi_mul_mpi: -1 * 0 (null) ........................... PASS
Test mbedtls_mpi_mul_mpi: -1 * 0 (1 limb) ......................... PASS
Test mbedtls_mpi_mul_mpi #1 ....................................... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in B .................. PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in B, A < 0 ........... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in B, B < 0 ........... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in B, A < 0, B < 0 .... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A .................. PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A, A < 0 ........... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A, B < 0 ........... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A, A < 0, B < 0 .... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A and B ............ PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A and B, A < 0 ..... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A and B, B < 0 ..... PASS
Test mbedtls_mpi_mul_mpi #1, leading 0 limb in A and B, A < 0, B <  PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A ................. PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A, A < 0 .......... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A, B < 0 .......... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A, A < 0, B < 0 ... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in B ................. PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in B, A < 0 .......... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in B, B < 0 .......... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in B, A < 0, B < 0 ... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A and B ........... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A and B, A < 0 .... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A and B, B < 0 .... PASS
Test mbedtls_mpi_mul_mpi #2, trailing 0 limb in A and B, A < 0, B   PASS
Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in A ................ PASS
Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in A, A < 0 ......... PASS
Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in A, B < 0 ......... PASS
Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in A, A < 0, B < 0 .. PASS
Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in B ................ PASS
Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in B, A < 0 ......... PASS
Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in B, B < 0 ......... PASS
Test mbedtls_mpi_mul_mpi #3, trailing 0 limbs in B, A < 0, B < 0 .. PASS
Test mbedtls_mpi_mul_int #1 ....................................... PASS
Test mbedtls_mpi_mul_int #2 (Unsigned, thus failure) .............. PASS
Test mbedtls_mpi_mul_int #3 ....................................... PASS
Test mbedtls_mpi_mul_int #4 (Unsigned, thus failure) .............. PASS
Test mbedtls_mpi_mul_int: 0 (null) * 0 ............................ PASS
Test mbedtls_mpi_mul_int: 0 (null) * 1 ............................ PASS
Test mbedtls_mpi_mul_int: 0 (null) * 0x1234 ....................... PASS
Base test mbedtls_mpi_div_mpi #1 .................................. PASS
Base test mbedtls_mpi_div_mpi #2 (Divide by zero (1 limb)) ........ PASS
Base test mbedtls_mpi_div_mpi #2 (Divide by zero (null)) .......... PASS
Base test mbedtls_mpi_div_mpi #3 .................................. PASS
Test mbedtls_mpi_div_mpi: 0 (null) / 0 (null) ..................... PASS
Test mbedtls_mpi_div_mpi: 0 (null) / 0 (1 limb) ................... PASS
Test mbedtls_mpi_div_mpi: 0 (1 limb) / 0 (null) ................... PASS
Test mbedtls_mpi_div_mpi: 0 (1 limb) / 0 (1 limb) ................. PASS
Test mbedtls_mpi_div_mpi: 0 (null) / 1 ............................ PASS
Test mbedtls_mpi_div_mpi: 0 (null) / -1 ........................... PASS
Test mbedtls_mpi_div_mpi #1 ....................................... PASS
Test mbedtls_mpi_div_mpi #2 ....................................... PASS
Test mbedtls_mpi_div_mpi #3 ....................................... PASS
Test mbedtls_mpi_div_mpi #4 ....................................... PASS
Base test mbedtls_mpi_div_int #1 .................................. PASS
Base test mbedtls_mpi_div_int #2 (Divide by zero) ................. PASS
Base test mbedtls_mpi_div_int #3 .................................. PASS
Test mbedtls_mpi_div_int #1 ....................................... PASS
Test mbedtls_mpi_div_int #2 ....................................... PASS
Test mbedtls_mpi_div_int: 0 (null) / 0 ............................ PASS
Test mbedtls_mpi_div_int: 0 (1 limb) / 0 .......................... PASS
Test mbedtls_mpi_div_int: 0 (null) / 1 ............................ PASS
Base test mbedtls_mpi_mod_mpi #1 .................................. PASS
Base test mbedtls_mpi_mod_mpi #2 (Divide by zero (null)) .......... PASS
Base test mbedtls_mpi_mod_mpi #2 (Divide by zero (1 limb)) ........ PASS
Base test mbedtls_mpi_mod_mpi #3 .................................. PASS
Base test mbedtls_mpi_mod_mpi #4 (Negative modulo) ................ PASS
Base test mbedtls_mpi_mod_mpi #5 (Negative modulo) ................ PASS
Test mbedtls_mpi_mod_mpi: 0 (null) % 1 ............................ PASS
Test mbedtls_mpi_mod_mpi: 0 (null) % -1 ........................... PASS
Base test mbedtls_mpi_mod_int #1 .................................. PASS
Base test mbedtls_mpi_mod_int #2 (Divide by zero) ................. PASS
Base test mbedtls_mpi_mod_int #3 .................................. PASS
Base test mbedtls_mpi_mod_int #4 (Negative modulo) ................ PASS
Base test mbedtls_mpi_mod_int #5 (Negative modulo) ................ PASS
Base test mbedtls_mpi_mod_int #6 (By 1) ........................... PASS
Base test mbedtls_mpi_mod_int #7 (By 2) ........................... PASS
Base test mbedtls_mpi_mod_int #8 (By 2) ........................... PASS
Test mbedtls_mpi_mod_int: 0 (null) % 1 ............................ PASS
Test mbedtls_mpi_mod_int: 0 (null) % -1 ........................... PASS
Base test mbedtls_mpi_exp_mod #1 .................................. FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Base test mbedtls_mpi_exp_mod #2 (Even N) ......................... PASS
Base test mbedtls_mpi_exp_mod #2 (N = 0 (null)) ................... PASS
Base test mbedtls_mpi_exp_mod #3 (Negative N) ..................... PASS
Base test mbedtls_mpi_exp_mod #4 (Negative base) .................. FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Base test mbedtls_mpi_exp_mod #5 (Negative exponent) .............. PASS
Base test mbedtls_mpi_exp_mod #6 (Negative base + exponent) ....... PASS
Test mbedtls_mpi_exp_mod: 0 (null) ^ 0 (null) mod 9 ............... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 0 (null) ^ 0 (1 limb) mod 9 ............. FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 0 (null) ^ 1 mod 9 ...................... PASS
Test mbedtls_mpi_exp_mod: 0 (null) ^ 2 mod 9 ...................... PASS
Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 0 (null) mod 9 ............. FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 0 (1 limb) mod 9 ........... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 1 mod 9 .................... PASS
Test mbedtls_mpi_exp_mod: 0 (1 limb) ^ 2 mod 9 .................... PASS
Test mbedtls_mpi_exp_mod: 1 ^ 0 (null) mod 9 ...................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 4 ^ 0 (null) mod 9 ...................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 10 ^ 0 (null) mod 9 ..................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 1 ^ 0 (1 limb) mod 9 .................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 4 ^ 0 (1 limb) mod 9 .................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: 10 ^ 0 (1 limb) mod 9 ................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod: MAX_SIZE exponent ....................... PASS
Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 exponent ................... PASS
Test mbedtls_mpi_exp_mod: MAX_SIZE modulus ........................ PASS
Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 modulus .................... PASS
Test mbedtls_mpi_exp_mod: MAX_SIZE exponent and modulus ........... PASS
Test mbedtls_mpi_exp_mod: MAX_SIZE + 1 exponent and modulus ....... PASS
Test mbedtls_mpi_exp_mod #1 ....................................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod (Negative base) [#1] ..................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Test mbedtls_mpi_exp_mod (Negative base) [#2] ..................... FAILED
  mbedtls_mpi_cmp_mpi( &Z, &X ) == 0
  at line 1224, suites/test_suite_mpi.function
Base test GCD #1 .................................................. PASS
Base test GCD #2 .................................................. PASS
Base test GCD #3 .................................................. PASS
Test GCD: 0 (null), 0 (null) ...................................... PASS
Test GCD: 0 (null), 0 (1 limb) .................................... PASS
Test GCD: 0 (null), 3 ............................................. PASS
Test GCD: 0 (null), 6 ............................................. PASS
Test GCD: 0 (1 limb), 0 (null) .................................... PASS
Test GCD: 0 (1 limb), 3 ........................................... PASS
Test GCD: 0 (1 limb), 6 ........................................... PASS
Test GCD: 3, 0 (null) ............................................. PASS
Test GCD: 3, 0 (1 limb) ........................................... PASS
Test GCD: 6, 0 (null) ............................................. PASS
Test GCD: 6, 0 (1 limb) ........................................... PASS
Test GCD: gcd=1, 0 < A < B ........................................ PASS
Test GCD: gcd=1, 0 < B < A ........................................ PASS
Test GCD: gcd=1, A > 0, B < 0 ..................................... PASS
Test GCD: gcd=1, A < 0 < B, |A| < |B| ............................. PASS
Test GCD: gcd=1, B < A < 0 ........................................ PASS
Test GCD: gcd=2, 0 < A < B ........................................ PASS
Test GCD: gcd=2, 0 < B < A ........................................ PASS
Test GCD: gcd=3, 0 < A < B ........................................ PASS
Test GCD: gcd=3, 0 < B < A ........................................ PASS
Test GCD: gcd=4, 0 < A < B ........................................ PASS
Test GCD: gcd=4, 0 < B < A ........................................ PASS
Test GCD: gcd=6, 0 < A < B ........................................ PASS
Test GCD: gcd=6, 0 < B < A ........................................ PASS
Test GCD: 0 < A = B ............................................... PASS
Base test mbedtls_mpi_inv_mod #1 .................................. PASS
Test mbedtls_mpi_inv_mod: mod 0 (null) ............................ PASS
Test mbedtls_mpi_inv_mod: mod 0 (1 limb) .......................... PASS
Test mbedtls_mpi_inv_mod: mod negative ............................ PASS
Test mbedtls_mpi_inv_mod: 2^-1 mod 4 .............................. PASS
Test mbedtls_mpi_inv_mod: mod 1 ................................... PASS
Test mbedtls_mpi_inv_mod: 0 (null) ^-1 ............................ PASS
Test mbedtls_mpi_inv_mod: 0 (1 limb) ^-1 .......................... PASS
Test mbedtls_mpi_inv_mod #1 ....................................... PASS
Base test mbedtls_mpi_is_prime #1 ................................. PASS
Base test mbedtls_mpi_is_prime #2 ................................. PASS
Base test mbedtls_mpi_is_prime #3 ................................. PASS
Base test mbedtls_mpi_is_prime #4 ................................. PASS
Base test mbedtls_mpi_is_prime #5 ................................. PASS
Base test mbedtls_mpi_is_prime #6 ................................. PASS
Base test mbedtls_mpi_is_prime #7 ................................. PASS
Base test mbedtls_mpi_is_prime #8 ................................. PASS
Test mbedtls_mpi_is_prime #1a ..................................... PASS
Test mbedtls_mpi_is_prime #1b ..................................... PASS
Test mbedtls_mpi_is_prime #2a ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #2b ..................................... PASS
Test mbedtls_mpi_is_prime #3 ...................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #4 ...................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #5 [#1] ................................. FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #5 [#2] ................................. FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #6 ...................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #7 ...................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #8 ...................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #9 ...................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #10 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #11 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #12 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #13 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #14 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #15 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #16 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #17 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #18 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #19 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime #20 ..................................... FAILED
  res == div_result
  at line 1319, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime_det (4 non-witnesses) ................... FAILED
  res == 0
  at line 1343, suites/test_suite_mpi.function
Test mbedtls_mpi_is_prime_det (39 non-witnesses) .................. FAILED
  res == 0
  at line 1343, suites/test_suite_mpi.function
Test mbedtls_mpi_gen_prime (Too small) ............................ PASS
Test mbedtls_mpi_gen_prime (OK, minimum size) ..................... PASS
Test mbedtls_mpi_gen_prime (corner case limb size -1 bits) ........ ^C

The last test suite appears to loop forever as prime checking appears to be broken.
^C means I killed the process.

Steps to reproduce

On a Mac M1 with the latest xcode installed

  1. Clone mbedtls
  2. checkout v2.27.0
  3. run make test
  4. observe it stall on the mpi test.
...
test_suite_mdx .................................................... PASS
test_suite_memory_buffer_alloc .................................... PASS
test_suite_mpi .................................................... ^C

Additional information

The same operating system and hardware works fine with gcc-11 as installed by brew.
If I do the following it runs fine

export CC=`which gcc-11`
make clean
make test
...
test_suite_x509parse .............................................. PASS
test_suite_x509write .............................................. PASS
test_suite_xtea ................................................... PASS
------------------------------------------------------------------------
PASSED (96 suites, 11762 tests run)

I maintain a library for the janet language (it's a low memory byte code lisp runtime) and my test suites have the following:

> Failed: test_00007Q
Assertion: (:prime? (bignum/parse 5807))
Reason: Result is Boolean false

> Failed: test_00007R
Assertion: (:prime? (bignum/parse 7841))
Reason: Result is Boolean false

> Failed: test_00007S
Assertion: (:prime? (bignum/parse 9679))
Reason: Result is Boolean false

> Failed: test_00007T
Assertion: (:prime? (bignum/parse 198491329))
Reason: Result is Boolean false

> Failed: test_00007U
Assertion: (:prime? (bignum/parse 217645199))
Reason: Result is Boolean false

> Failed: test_00007V
Assertion: (:prime? (bignum/parse 236887699))
Reason: Result is Boolean false

> Failed: test_00007u
Assertion: (= one (bignum/exponent-modulo one ten million))
Expect (L): <janetls/bignum 1>
Actual (R): <janetls/bignum 615189>

> Failed: test_00007v
Assertion: (= ten (:^% ten one million))
Expect (L): <janetls/bignum 10>
Actual (R): <janetls/bignum 827425>

> Failed: test_00007w
Assertion: (= (bignum/parse 100) (:^% ten two million))
Expect (L): <janetls/bignum 100>
Actual (R): <janetls/bignum 756479>

> Failed: test_00007x
Assertion: (= (bignum/parse 25) (:^% five two million))
Expect (L): <janetls/bignum 25>
Actual (R): <janetls/bignum 918863>

Note that million in this case is 1000001 and :^% calls mbedtls_mpi_exp_mod
So test cases like 5 ^ 2 % 1000001 should easily be 25 but for some reason 918863 is the result value.

@LeviSchuck
Copy link
Author

LeviSchuck commented Oct 10, 2021

It does pass with apple clang 12 on 64bit x86

cc -v
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Upgrading and then trying version 13

cc -v
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

This seems specific to version 13 and not the architecture.

The original issue text has been updated to reflect that this is not architecture dependent but is tied to the exact version.

@LeviSchuck LeviSchuck changed the title Apple Clang 13 on Mac OS aarch64 mpi does not pass tests Apple Clang 13 on Mac OS - mpi does not pass tests Oct 10, 2021
@LeviSchuck
Copy link
Author

LeviSchuck commented Oct 10, 2021

I also went through back to v2.22.0 and this issue is present on all releases between v2.22.0-v2.27.0 with apple clang 13.

  • development at 0c7c524 does pass the mpi test with apple clang 13.
  • v3.0.0 at 8df2f8e does not pass (or finish) the mpi test with apple clang 13.

@LeviSchuck
Copy link
Author

LeviSchuck commented Oct 10, 2021

Tracked down the commit with git bisect that fixes this for aarch64 / arm64

Both of these commits are the most recent changes to library/bn_mul.h

Similar commits are on the development_2.x branch, so the development work has already been done.
https://github.com/ARMmbed/mbedtls/commits/development_2.x/include/mbedtls/bn_mul.h

Now that Apple Clang 13 is what developers are using on Mac OS, might a new patch release be issued with these specific fixes?

@yanesca
Copy link
Contributor

yanesca commented Oct 12, 2021

Hi @LeviSchuck, yes, we are planning to do a release in this quarter that will contain these fixes.

@gilles-peskine-arm
Copy link
Contributor

gilles-peskine-arm commented May 13, 2022

The fix has been released in Mbed TLS 2.28.0 and 3.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants