Skip to main content
Visitor II
Aug 24, 2023 11:53 AM UTC
Question

AES-GCM Chunk-Size 1

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.

4 replies

Christian N
ST Employee
Sep 8, 2023 10:28 PM UTC

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
Sep 13, 2023 4:52 PM UTC

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 II
May 2, 2024 5:59 PM UTC

Any update on this

Jocelyn RICARD
ST Employee
May 3, 2024 6:53 PM UTC

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