I have some code on MPLAB X for my PIC24 device (PIC24FJ256GA406) but I am very certain it is faulty and unuseable. I want you to work with me to establish a library of functions in C to reliably use the crypto module on my PIC24 series chip in the first instance and then to take the library to the PIC32 devices on MPLAB Harmony.
You will work to the datasheet sequence of tasks in preference to anything else.
I am using 128bit AES block encryption so all the functions will be tailored to this.
The code will be well annotated.
void Crypto_Encrypt_using_CRYKEY(uint8_t message_size);
void Crypto_Decrypt_using_CRYKEY(uint8_t message_size);
void Crypto_Encrypt_using_OTP_key(uint8_t message_size, uint8_t keynum);
void Crypto_Decrypt_using_OTP_key(uint8_t message_size, uint8_t keynum);
void Crypto_Encrypt_using_KeyRAM_key(uint8_t message_size, uint8_t keynum);
void Crypto_Decrypt_using_KeyRAM_key(uint8_t message_size, uint8_t keynum);
You will need to be able to verify the code in hardware at your location. Obviously, I am a bit worried about writing anything permanent to the device so this explains why you, the expert, are going to be writing and checking the code firsthand.
My preference is to work with someone who has experience in this. Perhaps someone will already have code that is very similar.