Created
September 16, 2018 02:34
-
-
Save ilebedev/a056f5e621316fd1595aa38db85a4700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add at line XXX:XXX | |
// TODO: populate this constant via a linker script | |
extern uint8_t known_good_hash[64]; | |
// Add at line XXX:XXX | |
for (unsigned int i=0; i<8; i++) { | |
if ((uint64_t)known_good_hash)[i] != (uint64_t)hash)[i]) { | |
// Panic | |
// TODO: print an error | |
panic: | |
goto panic; | |
__builtin_unreachable(); | |
} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment