Functions
Math API

Functions

WOLFSSL_API word32 CheckRunTimeFastMath (void)
 This function checks the runtime fastmath settings for the maximum size of an integer. It is important when a user is using a wolfCrypt library independently, as the FP_SIZE must match for each library in order for math to work correctly. This check is defined as CheckFastMathSettings(), which simply compares CheckRunTimeFastMath and FP_SIZE, returning 0 if there is a mismatch, or 1 if they match. More...
 
WOLFSSL_API word32 CheckRunTimeSettings (void)
 This function checks the compile time class settings. It is important when a user is using a wolfCrypt library independently, as the settings must match between libraries for math to work correctly. This check is defined as CheckCtcSettings(), which simply compares CheckRunTimeSettings and CTC_SETTINGS, returning 0 if there is a mismatch, or 1 if they match. More...
 

Detailed Description

Function Documentation

◆ CheckRunTimeFastMath()

WOLFSSL_API word32 CheckRunTimeFastMath ( void  )

This function checks the runtime fastmath settings for the maximum size of an integer. It is important when a user is using a wolfCrypt library independently, as the FP_SIZE must match for each library in order for math to work correctly. This check is defined as CheckFastMathSettings(), which simply compares CheckRunTimeFastMath and FP_SIZE, returning 0 if there is a mismatch, or 1 if they match.

Returns
FP_SIZE Returns FP_SIZE, corresponding to the max size available for the math library.
Parameters
noneNo parameters.

Example

if (CheckFastMathSettings() != 1) {
return err_sys("Build vs. runtime fastmath FP_MAX_BITS mismatch\n");
}
// This is converted by the preprocessor to:
// if ( (CheckRunTimeFastMath() == FP_SIZE) != 1) {
// and confirms that the fast math settings match
// the compile time settings
See also
CheckRunTimeSettings

◆ CheckRunTimeSettings()

WOLFSSL_API word32 CheckRunTimeSettings ( void  )

This function checks the compile time class settings. It is important when a user is using a wolfCrypt library independently, as the settings must match between libraries for math to work correctly. This check is defined as CheckCtcSettings(), which simply compares CheckRunTimeSettings and CTC_SETTINGS, returning 0 if there is a mismatch, or 1 if they match.

Returns
settings Returns the runtime CTC_SETTINGS (Compile Time Settings)
Parameters
noneNo Parameters.

Example

if (CheckCtcSettings() != 1) {
return err_sys("Build vs. runtime math mismatch\n");
}
// This is converted by the preprocessor to:
// if ( (CheckCtcSettings() == CTC_SETTINGS) != 1) {
// and will compare whether the compile time class settings
// match the current settings
See also
CheckRunTimeFastMath