8 #include "sw/device/lib/testing/test_framework/check.h"
10 #include "sw/device/silicon_creator/lib/sigverify/sphincsplus/hash.h"
11 #include "sw/device/silicon_creator/lib/sigverify/sphincsplus/params.h"
12 #include "sw/device/silicon_creator/lib/sigverify/sphincsplus/sha2.h"
14 OTTF_DEFINE_TEST_CONFIG();
24 static const uint32_t kTestInput[kMgf1InputWords] = {
25 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c, 0x13121110, 0x17161514,
26 0x1b1a1918, 0x1f1e1d1c, 0x23222120, 0x27262524, 0x2b2a2928, 0x2f2e2d2c,
27 0x33323130, 0x37363534, 0x3b3a3938, 0x3f3e3d3c,
36 static const uint32_t kExpectedOutput[kMgf1OutputWords] = {
37 0x14336a92, 0x12e44587, 0xfd3cb9d1, 0x61782938,
38 0x935e9381, 0xaeb9abeb, 0x2f22425d, 0xa2c8dfd2,
42 static rom_error_t mgf1_test(
void) {
45 HARDENED_RETURN_IF_ERROR(spx_hash_initialize(&ctx));
47 uint32_t actual_output[kMgf1OutputWords];
50 CHECK_ARRAYS_EQ(actual_output, kExpectedOutput,
ARRAYSIZE(kExpectedOutput));
57 return status_ok(result);