Last active
September 18, 2018 21:54
-
-
Save ilebedev/a453bea693a6eefec30e1e2661a32c06 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
uint8_t SK_T[64]; | |
uint8_t PK_S[32]; | |
uint8_t SK_S[64]; | |
sha3_ctx_t hash_ctx; | |
uint8_t seed[64]; | |
// uint8_t S_H[64] has been previously computed | |
/* Retrieve SK_T and prevent any subsequent | |
software from accessing it */ | |
get_sk_t(SK_T); | |
hide_sk_t_until_reboot(); | |
/* Hash SK_T and the measurement of S to | |
produce a seed for S's keys */ | |
sha3_init(&hash_ctx, 32); | |
sha3_update(&hash_ctx, SK_T, 64); | |
sha3_update(&hash_ctx, S_H, 64); | |
sha3_final(seed, &hash_ctx); | |
// derive keys from seed in scratchpad | |
ed25519_create_keypair(PK_S, SK_S, seed); | |
/* don't forget to clean up private information before boot */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment