cancel
Showing results for 
Search instead for 
Did you mean: 

Please Let me know correction in below code or this code is correct or not . I am doing first time in AES256 Security . any help is highly appreciated .

STAR
Associate II

I wants to encrypt 8bits of data using AES256 Security with STM32L442KC . And sending Encrypted data through UART. I am confused in code that code is correct or not....please let me know any correction in this code. I am using Atolic true studio.

uint8_t plaintext[]={0x01};

uint8_t ciphertext[16];

uint32_t retval;

MX_AES_Init();

main()

{

uint32_t rerval = HAL_CRYP_AESECB_Encrypt(&hcryp, plaintext, 1, ciphertext, 5);

   if(retval == 0)

    {

    HAL_UART_Transmit(&huart1,(uint8_t *)ciphertext,sizeof(ciphertext),5);

    }

}

Thanks & Regards

Ashok

0 REPLIES 0