Hi!
I want to encrypt (or decrypt) large file.
It is unreasonable/impossible to load the whole file into memory and process it by single AESEncryptCBC call.
The more affordable way is to process that file using consecutive smaller chunks.
So, as far as I understand, the term "initialization vector" is need only for a first Encrypt call.
And subsequent Encrypt calls require knowledge of some state from previous call.
Is it possible with IPP primitives to process large amounts through several AESEncryptCBC calls?
And one more question regarding AESEncryptCBC/AESDecryptCBC.
Can pSrc and pDst pointers be the same?
Hello,
Yes, you can do AES CBC encryption by chunks, but in this case you should take care about IV for any subsequent chunk yourself.
The algorithm uses previous encrypted block as an input for the next block processing, so when you encrypt first chunk with the "original" IV, you should take last block of the last encrypted chunk as an IV for the next ippsAESEncryptCBC() call. Please also make sure that size of your chunks is a multiple of block size.
As to the second question, yes, they support in-place mode.
Regards,
Andrey
Hello,
Yes, you can do AES CBC encryption by chunks, but in this case you should take care about IV for any subsequent chunk yourself.
The algorithm uses previous encrypted block as an input for the next block processing, so when you encrypt first chunk with the "original" IV, you should take last block of the last encrypted chunk as an IV for the next ippsAESEncryptCBC() call. Please also make sure that size of your chunks is a multiple of block size.
As to the second question, yes, they support in-place mode.
Regards,
Andrey
Andrey-Matyukov (Intel) wrote:
Yes, it works! Thank you!
For more complete information about compiler optimizations, see our Optimization Notice.