Created
September 17, 2018 09:41
-
-
Save ilebedev/3d8d6734bfaa745f54782689c9c1cc33 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
sha3_ctx_t hash_ctx; | |
uint8_t cert_hash[64]; | |
uint8_t cert_sig[64]; | |
extern uint8_t PK_T[32]; | |
// uint8_t S_H[64] has been previously computed | |
// uint8_t PK_S[32] has been previously computed | |
// uint8_t PK_T[32] has been previously retrieved | |
/* Hash the parts of the certificate into one message */ | |
sha3_init(&hash_ctx, 64); | |
sha3_update(&hash_ctx, S_H, 64); | |
sha3_update(&hash_ctx, PK_S, 32); | |
sha3_final(cert_hash, &hash_ctx); | |
/* Sign the message with SK_T */ | |
ed25519_sign(cert_sig, cert_hash, 64, PK_T, SK_T); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment