28 #include <rtems/test.h> 30 #if defined(__rtems__) 33 #include <openssl/sha.h> 45 T_report_hash_sha256_putchar(
int c,
void *arg)
52 SHA256_Update(&ctx->sha256, &cc,
sizeof(cc));
53 (*ctx->putchar)(c, ctx->putchar_arg);
57 T_report_hash_sha256_initialize(
void)
61 ctx = &T_report_hash_sha256_instance;
62 SHA256_Init(&ctx->sha256);
63 T_set_putchar(T_report_hash_sha256_putchar, ctx, &ctx->putchar,
68 T_report_hash_sha256_finalize(
void)
71 unsigned char hash[32];
74 ctx = &T_report_hash_sha256_instance;
75 SHA256_Final(hash, &ctx->sha256);
76 T_printf(
"Y:ReportHash:SHA256:");
78 for (i = 0; i < 32; ++i) {
79 T_printf(
"%02x", hash[i]);
86 T_report_hash_sha256(T_event event,
const char *name)
91 case T_EVENT_RUN_INITIALIZE_EARLY:
92 T_report_hash_sha256_initialize();
94 case T_EVENT_RUN_FINALIZE_LATE:
95 T_report_hash_sha256_finalize();