Skip to main content
Visitor II
August 24, 2023
Question

AES-GCM Chunk-Size 1

  • August 24, 2023
  • 3 replies
  • 1852 views

Hello,

I'm using AES-GCM using the method cmox_cipher_append() function call, as taken from the example below, taken from Projects\NUCLEO-L476RG\Applications\Cipher\AES_GCM_AEAD_EncryptDecrypt\Src\main.c

        retval = cmox_cipher_append(cipher_ctx,
                                    &Expected_Ciphertext[index], CHUNK_SIZE, /* Chunk of ciphertext to decrypt and verify */
                                    Computed_Plaintext, &computed_size);     /* Data buffer to receive generated
                                                                            chunk of plaintext */

The code works well if the CHUNK_SIZE size is a multiple of 16. However, I want to decipher streamed data that comes in unpredictable chunks. I know that there is no limitation from the AES-GCM algorithm side on the CHUNK_SIZE. Is there a workaround to implement something with a CHUNK_SIZE of 1?

This topic has been closed for replies.

3 replies

Christian N
ST Employee
September 8, 2023

Hello Michael, 

Your inquiry has been escalated to the ST Online Support team for direct support.

In the future, for prioritized support please submit directly to https://my.st.com/ols. 

Kind Regards,
Christian

ST Support

Jocelyn RICARD
ST Employee
September 13, 2023

Hello Michael,

I confirm here that the X-CUBE-CRYPTOLIB 4.1.0 does not support CHUNK_SIZE of 1 if this is not the end of the cyphertext, and there is no workaround to get this BYTE level decryption. (Same for encryption)

I created a change request which is currently under analysis.

Best regards

Jocelyn

Rajan Soma
Graduate
May 2, 2024

Any update on this

Jocelyn RICARD
ST Employee
May 3, 2024

Hello @Rajan Soma ,

the change request has been included in the development plan.

Now I couldn't get any committed date for this change.

One point to know it that such change will require a new certification of the library which is not something we want to do too often ...

Best regards

Jocelyn