How to use the AES core Engine in AX8052

hello
I have bought the DVK-2 C Mainboard and wrote custom code for it. I want to use the AES core engine in my custom code But I do not know what to do. Please tell me the steps to set it up.
thank you

Hi Alex, thanks for using our Community Forum.
Check out this application note about the usage of AX8052 Cryptographic Functions - AND9477-D.PDF.

You can find the source code of all these crypto functions directly on your PC in the installation folder C:\Program Files (x86)\ON Semiconductor\AXSDB\libmfcrypto.

Your crypto function could be something like this:

#include "ax8052crypto.h"
#include "aes.h"
#include <string.h>

// function to compute AES (hardcoded or soft coded)
// 128bit key (16bytes)
void aes_128_cbc_encrypt(uint8_t *encrypted_data,			// result of encryption
										uint8_t *data_to_encrypt,        // input buffer to encrypt
										uint8_t data_len				// Input data length
									)
{
	uint8_t __xdata keysched_buffer[176];
	uint8_t __xdata plaintext_buffer[64], ciphertext_buffer[64];
	const uint8_t __xdata aes_key_public[16] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}; //public key

    // Set Chiper Chaining Mode to ECB (Electronic Codebook mode)
	AESCONFIG = 0; 
	// generate key schedule (see aeskey128.c)
	aes128_setup(aes_key_public, keysched_buffer);

	for (;;) {
        uint8_t round_len = data_len;
        if (!round_len)
            break;
        if (round_len >= 16)
            round_len = 16;

        // XOR initialization vector or last ciphertext to data for CBC mode
        {
            uint8_t i;
            for (i = 0; i != round_len; ++i)
                plaintext_buffer[i] = ciphertext_buffer[i] ^ (*data_to_encrypt++);
            for (; i != 16; ++i)
                plaintext_buffer[i] = ciphertext_buffer[i];
        }
        // configure hardware AES module
        AESINADDR0  = ((uint16_t) plaintext_buffer);
        AESINADDR1  = ((uint16_t) plaintext_buffer) >> 8;
        AESOUTADDR0 = ((uint16_t) ciphertext_buffer);
        AESOUTADDR1 = ((uint16_t) ciphertext_buffer) >> 8;

        // start encryption setting AESRUN = 1
        AESMODE = 0x81;

        // wait for hardware to finish
        while (AESCURBLOCK & 0x80) {};

        // copy data back
        memcpy(encrypted_data, ciphertext_buffer, round_len);
        encrypted_data += round_len;
        data_len -= round_len;
    }
}

Thank you for your rapidly answer.
may I have another question, it is about DMA Controller. I want to run a UART Receive process using DMA. could you please send me an example code if you have?