Skip to main content
nicolas
Senior II
April 19, 2024
Solved

Missing CMOX_AESFAST_CFB_DEC_ALGO

  • April 19, 2024
  • 2 replies
  • 1090 views

In the X-CUBE-CRYPTOLIB v4.1.0, the documentation say that cmox_cipher_decrypt() accept the CMOX_AESFAST_CFB_DEC_ALGO as algo. But CMOX_AESFAST_CFB_DEC_ALGO is not defined, instead there is a CMOX_AESFAST_CFB_DEC_ALG in cmox_cfb.h.

This topic has been closed for replies.
Best answer by CMYL

Hi @nicolas 

Thank you, sorry I didn't catch your first request. I created a defect ticket to correct the file description or the cryptolib implementation (Ticket 180042 Submitted, this is internal ticket not accessible for you, used for tracking purpose ).

Just to give more analysis, yes I confirm the first @arg name (CMOX_AESFAST_CFB_DEC_ALGO) was incorrect. The correct @arg name is (CMOX_AESFAST_CFB_DEC_ALG). 

There will be compilation error when passing CMOX_AESFAST_CFB_DEC_ALGO as first parameter to cmox_cipher_decrypt.

CMYL_0-1714057367323.png

As workaround, we can use either CMOX_AES_CFB_DEC_ALGO or CMOX_AESFAST_CFB_DEC_ALG  according to line 151 of cmox_cfb.h file.

 

Best regards,

Younes

2 replies

Technical Moderator
April 25, 2024

Hello @nicolas 

The CMOX_AESFAST_CFB_DEC_ALGO is supported by the cryptolib V4.1.0. In main.c, you need to include first

"~\Cryptolib_V1.4\STM32CubeExpansion_Crypto_V4.1.0\Middlewares\ST\STM32_Cryptographic\include\cipher\cmox_crypto.h" file, then call the cmox_cipher_decrypt API with P_algo parmeter equal to CMOX_AESFAST_CFB_DEC_ALGO.

You can see the description of the cmox_cipher_decrypt API in the cmox_cipher.h file line 344-380 for the rest of parameters. Also, you can follow the provided examples in project directory for the CBC and mimic it for CFB. 

 

 

In cmox_cfb.h no definition of CMOX_AESFAST_CFB_DEC_ALGO or CMOX_AESFAST_CFB_DEC_ALG definition. There is only CMOX_AESFAST_CFB_DEC .

 

/**
 * @brief Implementation of CFB decryption using AES (fast implementation)
 * (Defined internally)
 */
extern const cmox_cfb_impl_t CMOX_AESFAST_CFB_DEC;

 

 

best regards,

Younes

 

nicolas
nicolasAuthor
Senior II
April 25, 2024

I know how to use it, it's just the description of the function cmox_cipher_decrypt() (@arg CMOX_AESFAST_CFB_DEC_ALGO) doesn't correspond to the value in cmox_cfb.h (CMOX_AESFAST_CFB_DEC_ALG).

CMOX_AESFAST_CFB_DEC is of type cmox_cfb_impl_t instead of cmox_cipher_algo_t.

The CMOX_AESFAST_CFB_DEC_ALG can be found at line 151 of cmox_cfb.h.

CMYLBest answer
Technical Moderator
April 25, 2024

Hi @nicolas 

Thank you, sorry I didn't catch your first request. I created a defect ticket to correct the file description or the cryptolib implementation (Ticket 180042 Submitted, this is internal ticket not accessible for you, used for tracking purpose ).

Just to give more analysis, yes I confirm the first @arg name (CMOX_AESFAST_CFB_DEC_ALGO) was incorrect. The correct @arg name is (CMOX_AESFAST_CFB_DEC_ALG). 

There will be compilation error when passing CMOX_AESFAST_CFB_DEC_ALGO as first parameter to cmox_cipher_decrypt.

CMYL_0-1714057367323.png

As workaround, we can use either CMOX_AES_CFB_DEC_ALGO or CMOX_AESFAST_CFB_DEC_ALG  according to line 151 of cmox_cfb.h file.

 

Best regards,

Younes