add conditions to constant time mask functions

pull/8830/head
JacobBarthelmeh 2025-06-02 15:42:52 -06:00
parent 838636c76b
commit c33035e6a6
1 changed files with 7 additions and 1 deletions

View File

@ -633,7 +633,13 @@ WC_MISC_STATIC WC_INLINE int ConstantCompare(const byte* a, const byte* b,
}
#endif
#ifndef WOLFSSL_NO_CT_OPS
#if defined(WOLFSSL_NO_CT_OPS) && (!defined(NO_RSA) || !defined(WOLFCRYPT_ONLY))
/* constant time operations with mask are required for RSA and TLS operations */
#warning constant time operations required unless using NO_RSA & WOLFCRYPT_ONLY
#endif
#if !defined(WOLFSSL_NO_CT_OPS) || !defined(NO_RSA) || !defined(WOLFCRYPT_ONLY)
/* Constant time - mask set when a > b. */
WC_MISC_STATIC WC_INLINE byte ctMaskGT(int a, int b)
{