2016-07-20 16:33:49 +00:00
|
|
|
#include STM32_HAL_H
|
|
|
|
|
2016-10-04 16:01:48 +00:00
|
|
|
#include "crypto.h"
|
|
|
|
#include "ui.h"
|
2016-07-20 16:33:49 +00:00
|
|
|
#include "display.h"
|
|
|
|
|
|
|
|
void SystemClock_Config(void);
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
|
|
|
|
HAL_Init();
|
|
|
|
|
|
|
|
SystemClock_Config();
|
|
|
|
|
|
|
|
__GPIOA_CLK_ENABLE();
|
|
|
|
__GPIOB_CLK_ENABLE();
|
|
|
|
__GPIOC_CLK_ENABLE();
|
|
|
|
__GPIOD_CLK_ENABLE();
|
|
|
|
|
|
|
|
display_init();
|
2016-09-28 16:15:06 +00:00
|
|
|
display_clear();
|
2016-10-03 14:17:49 +00:00
|
|
|
|
2016-10-04 16:01:48 +00:00
|
|
|
uint8_t hash[32];
|
|
|
|
hash_flash(hash);
|
|
|
|
|
2016-10-03 14:17:49 +00:00
|
|
|
screen_welcome();
|
|
|
|
|
2016-10-04 16:01:48 +00:00
|
|
|
uint8_t *pubkey = (uint8_t *)"ThisIsJustAFakePublicKeyForTest!";
|
|
|
|
uint8_t *signature = (uint8_t *)"ThisIsJustAFakeSignatureToTestTheVerifyMechanismInTRZRBootloader";
|
|
|
|
ed25519_verify(hash, 32, pubkey, signature);
|
|
|
|
|
2016-10-03 14:17:49 +00:00
|
|
|
for (;;) {
|
|
|
|
display_backlight(255);
|
2016-09-29 12:38:31 +00:00
|
|
|
HAL_Delay(250);
|
2016-10-03 14:17:49 +00:00
|
|
|
display_backlight(0);
|
2016-09-29 12:38:31 +00:00
|
|
|
HAL_Delay(250);
|
2016-10-03 14:17:49 +00:00
|
|
|
}
|
2016-07-20 16:33:49 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|