1 #ifndef _SHA2_H_ 2 #define _SHA2_H_ 3 4 #include_next <sys/sha2.h> 5 6 #define SHA2_CTX SHA256_CTX 7 #define SHA2Init(a, b) SHA256_Init(b) 8 #define SHA2Update SHA256_Update 9 10 static void 11 SHA2Final(void *digest, SHA2_CTX *ctx) 12 { 13 uint8_t tmp[SHA256_DIGEST_LENGTH]; 14 15 SHA256_Final(tmp, ctx); 16 memcpy(digest, &tmp, sizeof(tmp)); 17 } 18 19 20 #endif 21