Topic: wc_AesGcmDecrypt - Decrypt in place?

Hi!

Is it possible to set in and out buffers to be the same buffer when using the wc_AesGcmDecrypt function? That is, read encrypted data from the buffer and decrypt it to the same place?

And same question for the wc_AesGcmEncrypt function.

Thanks!

Share

Re: wc_AesGcmDecrypt - Decrypt in place?

Hi!

Ok, nice to know at least that it is not supported.

We are doing some crypto in a network setting, so it would be nice to decrypt into the same packet intended to forward, to avoid copying data.

Share

Re: wc_AesGcmDecrypt - Decrypt in place?

Hi ztion,

Update on this item. The following is supported in wolfSSL:

     result = wc_AesGcmEncrypt(&enc, resultC, resultC, sizeof(resultC), iv1, sizeof(iv1),
                                         resultT, sizeof(resultT), a, sizeof(a)); 
                                                                        
                                                       
     result = wc_AesGcmDecrypt(&enc, resultC, resultC, sizeof(resultC),           
                       iv1, sizeof(iv1), resultT, sizeof(resultT), a, sizeof(a));

Please let us know if you have any issues performing encrypt/decryption in place with AesGcm.

Warm Regards,

Kaleb