Details
-
Bug
-
Status: In Review (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11
-
None
-
Related to performance
Description
WolfSSL has different implementations of integer handling functions in sp_c32.c and sp_c64.c.
Which one is used is determined by the SP_WORD_SIZE define. SP_WORD_SIZE is auto-detected from indirect tests, like e.g. the presence of _uint128_t (as determined by checking the HAVE__UINT128_T define).
Checking for this data type triggers SP_WORD_SIZE to be 64 on Mac (arm64) and causes the code in sp_c32.c to be compiled out.
This also fixes the UBSAN warnings in it. See https://github.com/wolfSSL/wolfssl/issues/11874 for details on these
warnings.
Fixed by adding a check for _uint128_t in wolfssl's cmake file and by exporting the HAVE__UINT128_T define to all wolfssl related headers. The latter is required since some of the headers used by the server rely on this define.
Note that the code in sp_c64.c is supposedly more optimized for 64bit platforms, so some modest performance improvement is also possible.