5. Cryp_aes_cbc_padding

5.1. Function description:

This demo shows the operation of cryptographic processor, mainly test the function of padding by software, algorithm is AES, mode is CBC, appending data using the CPU in polling mode.

  • Configure and prepare the plaintext data firstly, then start the encryption to get ciphertext data.

  • Compare the encryption result with the standard to verify the function of encryption.

  • Configure & prepare the key for decryption.

  • Configure & start the decryption, the ciphertext data is comming from encryption result.

  • Compare the decryption result with the plaintext to verify the function of decryption.

Note

  1. For AES_ECB or AES_CBC mode decryption, the key has to be prepared firstly.

  2. If the length of plaintext is not integer to the block length, we need to select right padding mode to encrypt, otherwise default is no padding mode; for decrypt, make sure the ciphertext length is multiple of block length and need to select no padding mode.

5.2. Test result:

After the operation of encryption and decryption, if the encryption data is same as the standard & the decryption result is same as the plaintext data, then print pass, if not print fail.

5.3. IO connection:

None