Hello,
As part of writing a second stage boot loader on a LPC55s28 project I am trying to extend the chain of trust as referred to in the LPC55s2x user manual. I have my image in FLASH ready to be checked and wish to call skboot_authenticate() as described in section 7.4.1 of the user manual.
This section says:
If a user application calls skboot_authenticate() directly or indirectly from SB file processing functions kb_init/kb_process/kb_deinit, the user HASH interrupt vector shall call the HASH_IRQHandler() function for handling of the Hash-crypt IP interrupt.
How do I do this? Are you saying I need to enable the has-crypt interrupt, hook it and call this function.Do I also have to call the default handler as well - i.e. HASHCRYPT_DriverIRQHandler() in fsl_hashcrypt.c
Is there any example code for this?
Would this work?
void (*handler)(void) = 0x13003717;
void HASHCRYPT_IRQHandler(void) {
(*handler)();
}
void setup(void) {
(void)EnableIRQ(HASHCRYPT_IRQn);
// now I can call skboot_authenticate()
(void)DisableIRQ(HASHCRYPT_IRQn);
// check skboot_authenticate() status
}
Thanks...