Topic: AES CBC mode with IV = NULL and IV is 0x00

Hi All,

I am testing AES CBC mode with IV = {0x00, 0x00, ...... 0x00} and IV = NULL.

1) Using the same plaintext message, I got different ciphertexts with IV = NULL and IV has all 0x00 values.
2) On a machine of my colleague, the same plaintext message and IV = NULL resulted into another different ciphertext than on my machine.

I think the behavior is not correct, right?

I dived into aes.c source. IV is copied to aes.reg. If IV = NULL, aes.reg is not initialized. But AesCbcEncrypt() performs xorbuf((byte*) aes->reg, in, AES_BLOCK_SIZE) independently, whether aes->reg has been initialized before.

Thanks, Yun

Share

Re: AES CBC mode with IV = NULL and IV is 0x00

Hi Yun,

Thanks for the report.  I'll look into this and get back to you.

Best Regards,
Chris

Re: AES CBC mode with IV = NULL and IV is 0x00

Hi Yun,

Please see the following commit to our embedded SSL library which fixes this issue:
https://github.com/cyassl/cyassl/commit … 125d39d664

Best Regards,
Chris