Skip to content

Instantly share code, notes, and snippets.

@ilebedev
Created September 16, 2018 02:34
Show Gist options
  • Save ilebedev/a056f5e621316fd1595aa38db85a4700 to your computer and use it in GitHub Desktop.
Save ilebedev/a056f5e621316fd1595aa38db85a4700 to your computer and use it in GitHub Desktop.
// 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