cancel
Showing results for 
Search instead for 
Did you mean: 

AES-GCM Chunk-Size 1

Michael1
Associate

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?

4 REPLIES 4
Christian N
ST Employee

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

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
Associate II

Any update on this

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