Hi,
I implemented the AES-GCM decryption algorithm in the AM3359 following the AM335x ARM Cortex-A8 Cyptographic Addendum "Technical Reference Manual", and the example given in tivaware_c_series_2_1_4_178/examples/boards/dk-tm4c129x/aes_gcm_decrypt.
Im running the tests given in the aes_gcm_decrypt.c file, but NOT using DMA. The decryption seems to work fine, but the calculation of the tag only works once after switching the Sitara OFF and ON. Every second run of the AESTagRead function returns a wrong value.
Here is the AESTagRead function:
void AESTagRead(uint32_t ui32Base, uint32_t *pui32TagData) { // // Check the arguments. // ASSERT(ui32Base == AES_BASE); // // Wait for the output context to be ready. // while((AES_CTRL_SVCTXTRDY & (HWREG(ui32Base + AES_O_CTRL))) == 0) { } // // Read the tag data. // pui32TagData[0] = HWREG((ui32Base + AES_O_TAG_OUT_0)); pui32TagData[1] = HWREG((ui32Base + AES_O_TAG_OUT_1)); pui32TagData[2] = HWREG((ui32Base + AES_O_TAG_OUT_2)); pui32TagData[3] = HWREG((ui32Base + AES_O_TAG_OUT_3)); }
Do you have any idea what could be the reason that the tag is only calculated correctly one time after startup of the hardware? Regards