10 #include "sw/device/lib/testing/test_framework/ottf_test_config.h"
20 static const char kGettysburgPrelude[] =
21 "Four score and seven years ago our fathers brought forth on this "
22 "continent, a new nation, conceived in Liberty, and dedicated to the "
23 "proposition that all men are created equal.";
33 static const uint8_t kGettysburgDigest[] = {
34 0x1e, 0x6f, 0xd4, 0x03, 0x0f, 0x90, 0x34, 0xcd, 0x77, 0x57, 0x08,
35 0xa3, 0x96, 0xc3, 0x24, 0xed, 0x42, 0x0e, 0xc5, 0x87, 0xeb, 0x3d,
36 0xd4, 0x33, 0xe2, 0x9f, 0x6a, 0xc0, 0x8b, 0x8c, 0xc7, 0xba,
45 #define RETURN_IF_ERROR(expr_) \
52 int32_t hash_test(
void) {
53 uint32_t digest_content[kHashLength];
56 .mode = kOtcryptoHashModeSha256,
58 .data = digest_content,
61 .len =
sizeof(kGettysburgPrelude) - 1,
62 .data = (
const uint8_t *)kGettysburgPrelude,
69 if (
memcmp(digest.data, kGettysburgDigest,
sizeof(kGettysburgDigest)) != 0) {
75 OTTF_DEFINE_TEST_CONFIG();
78 int result = hash_test();