trezor-core/micropython/stmhal/bootloader/bootloader.c

41 lines
760 B
C
Raw Normal View History

#include STM32_HAL_H
2016-10-04 09:01:48 -07:00
#include "crypto.h"
#include "ui.h"
#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();
display_clear();
2016-10-03 07:17:49 -07:00
2016-10-04 09:01:48 -07:00
uint8_t hash[32];
hash_flash(hash);
2016-10-03 07:17:49 -07:00
screen_welcome();
2016-10-04 09:01:48 -07:00
uint8_t *pubkey = (uint8_t *)"ThisIsJustAFakePublicKeyForTest!";
uint8_t *signature = (uint8_t *)"ThisIsJustAFakeSignatureToTestTheVerifyMechanismInTRZRBootloader";
ed25519_verify(hash, 32, pubkey, signature);
2016-10-03 07:17:49 -07:00
for (;;) {
display_backlight(255);
2016-09-29 05:38:31 -07:00
HAL_Delay(250);
2016-10-03 07:17:49 -07:00
display_backlight(0);
2016-09-29 05:38:31 -07:00
HAL_Delay(250);
2016-10-03 07:17:49 -07:00
}
return 0;
}