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