@@ -4219,7 +4219,10 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
42194219 #endif
42204220
42214221 #ifdef WOLF_CRYPTO_CB
4222- if (aes -> devId != INVALID_DEVID ) {
4222+ #ifndef WOLF_CRYPTO_CB_FIND
4223+ if (aes -> devId != INVALID_DEVID )
4224+ #endif
4225+ {
42234226 int crypto_cb_ret = wc_CryptoCb_AesCbcEncrypt (aes , out , in , sz );
42244227 if (crypto_cb_ret != CRYPTOCB_UNAVAILABLE )
42254228 return crypto_cb_ret ;
@@ -4352,7 +4355,10 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
43524355 #endif
43534356
43544357 #ifdef WOLF_CRYPTO_CB
4355- if (aes -> devId != INVALID_DEVID ) {
4358+ #ifndef WOLF_CRYPTO_CB_FIND
4359+ if (aes -> devId != INVALID_DEVID )
4360+ #endif
4361+ {
43564362 int crypto_cb_ret = wc_CryptoCb_AesCbcDecrypt (aes , out , in , sz );
43574363 if (crypto_cb_ret != CRYPTOCB_UNAVAILABLE )
43584364 return crypto_cb_ret ;
@@ -4670,7 +4676,10 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
46704676 }
46714677
46724678 #ifdef WOLF_CRYPTO_CB
4673- if (aes -> devId != INVALID_DEVID ) {
4679+ #ifndef WOLF_CRYPTO_CB_FIND
4680+ if (aes -> devId != INVALID_DEVID )
4681+ #endif
4682+ {
46744683 int crypto_cb_ret = wc_CryptoCb_AesCtrEncrypt (aes , out , in , sz );
46754684 if (crypto_cb_ret != CRYPTOCB_UNAVAILABLE )
46764685 return crypto_cb_ret ;
@@ -6863,7 +6872,10 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
68636872 }
68646873
68656874#ifdef WOLF_CRYPTO_CB
6866- if (aes -> devId != INVALID_DEVID ) {
6875+ #ifndef WOLF_CRYPTO_CB_FIND
6876+ if (aes -> devId != INVALID_DEVID )
6877+ #endif
6878+ {
68676879 int crypto_cb_ret =
68686880 wc_CryptoCb_AesGcmEncrypt (aes , out , in , sz , iv , ivSz , authTag ,
68696881 authTagSz , authIn , authInSz );
@@ -7419,7 +7431,10 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
74197431 }
74207432
74217433#ifdef WOLF_CRYPTO_CB
7422- if (aes -> devId != INVALID_DEVID ) {
7434+ #ifndef WOLF_CRYPTO_CB_FIND
7435+ if (aes -> devId != INVALID_DEVID )
7436+ #endif
7437+ {
74237438 int crypto_cb_ret =
74247439 wc_CryptoCb_AesGcmDecrypt (aes , out , in , sz , iv , ivSz ,
74257440 authTag , authTagSz , authIn , authInSz );
@@ -9311,7 +9326,10 @@ int wc_AesCcmEncrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
93119326 }
93129327
93139328#ifdef WOLF_CRYPTO_CB
9314- if (aes -> devId != INVALID_DEVID ) {
9329+ #ifndef WOLF_CRYPTO_CB_FIND
9330+ if (aes -> devId != INVALID_DEVID )
9331+ #endif
9332+ {
93159333 int crypto_cb_ret =
93169334 wc_CryptoCb_AesCcmEncrypt (aes , out , in , inSz , nonce , nonceSz ,
93179335 authTag , authTagSz , authIn , authInSz );
@@ -9490,7 +9508,10 @@ int wc_AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
94909508 }
94919509
94929510#ifdef WOLF_CRYPTO_CB
9493- if (aes -> devId != INVALID_DEVID ) {
9511+ #ifndef WOLF_CRYPTO_CB_FIND
9512+ if (aes -> devId != INVALID_DEVID )
9513+ #endif
9514+ {
94949515 int crypto_cb_ret =
94959516 wc_CryptoCb_AesCcmDecrypt (aes , out , in , inSz , nonce , nonceSz ,
94969517 authTag , authTagSz , authIn , authInSz );
@@ -10009,7 +10030,10 @@ static WARN_UNUSED_RESULT int _AesEcbEncrypt(
1000910030 word32 blocks = sz / AES_BLOCK_SIZE ;
1001010031
1001110032#ifdef WOLF_CRYPTO_CB
10012- if (aes -> devId != INVALID_DEVID ) {
10033+ #ifndef WOLF_CRYPTO_CB_FIND
10034+ if (aes -> devId != INVALID_DEVID )
10035+ #endif
10036+ {
1001310037 int ret = wc_CryptoCb_AesEcbEncrypt (aes , out , in , sz );
1001410038 if (ret != CRYPTOCB_UNAVAILABLE )
1001510039 return ret ;
@@ -10045,7 +10069,10 @@ static WARN_UNUSED_RESULT int _AesEcbDecrypt(
1004510069 word32 blocks = sz / AES_BLOCK_SIZE ;
1004610070
1004710071#ifdef WOLF_CRYPTO_CB
10048- if (aes -> devId != INVALID_DEVID ) {
10072+ #ifndef WOLF_CRYPTO_CB_FIND
10073+ if (aes -> devId != INVALID_DEVID )
10074+ #endif
10075+ {
1004910076 int ret = wc_CryptoCb_AesEcbDecrypt (aes , out , in , sz );
1005010077 if (ret != CRYPTOCB_UNAVAILABLE )
1005110078 return ret ;
0 commit comments