tfm.h 1017 B

1234567891011121314151617181920212223242526272829
  1. /*!
  2. \ingroup Math
  3. \brief This function checks the runtime fastmath settings for the maximum
  4. size of an integer. It is important when a user is using a wolfCrypt
  5. library independently, as the FP_SIZE must match for each library in order
  6. for math to work correctly. This check is defined as
  7. CheckFastMathSettings(), which simply compares CheckRunTimeFastMath
  8. and FP_SIZE, returning 0 if there is a mismatch, or 1 if they match.
  9. \return FP_SIZE Returns FP_SIZE, corresponding to the max size
  10. available for the math library.
  11. \param none No parameters.
  12. _Example_
  13. \code
  14. if (CheckFastMathSettings() != 1) {
  15. return err_sys("Build vs. runtime fastmath FP_MAX_BITS mismatch\n");
  16. }
  17. // This is converted by the preprocessor to:
  18. // if ( (CheckRunTimeFastMath() == FP_SIZE) != 1) {
  19. // and confirms that the fast math settings match
  20. // the compile time settings
  21. \endcode
  22. \sa CheckRunTimeSettings
  23. */
  24. WOLFSSL_API word32 CheckRunTimeFastMath(void);