-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Comments
It does pass with apple clang 12 on 64bit x86
Upgrading and then trying version 13
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. |
Tracked down the commit with git bisect that fixes this for aarch64 / arm64 Both of these commits are the most recent changes to Similar commits are on the development_2.x branch, so the development work has already been done. Now that Apple Clang 13 is what developers are using on Mac OS, might a new patch release be issued with these specific fixes? |
Hi @LeviSchuck, yes, we are planning to do a release in this quarter that will contain these fixes. |
The fix has been released in Mbed TLS 2.28.0 and 3.1.0. |
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
): defaultCompiler and options (if you used a pre-built binary, please indicate how you obtained it):
Default options
On another machine for x86
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.
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
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
I maintain a library for the janet language (it's a low memory byte code lisp runtime) and my test suites have the following:
Note that
million
in this case is1000001
and:^%
callsmbedtls_mpi_exp_mod
So test cases like
5 ^ 2 % 1000001
should easily be25
but for some reason918863
is the result value.The text was updated successfully, but these errors were encountered: