1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-01 02:10:56 +00:00
trezor-firmware/micropython/stmhal/bootloader/bootloader.c

41 lines
760 B
C
Raw Normal View History

#include STM32_HAL_H
2016-10-04 16:01:48 +00: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 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
}
return 0;
}