8 #include "sw/device/silicon_creator/lib/sigverify/mod_exp_ibex.h"
14 #include "sigverify_testvectors.h"
17 static uint32_t test_index;
19 rom_error_t sigverify_mod_exp_ibex_test(
void) {
20 sigverify_test_vector_t testvec = sigverify_tests[test_index];
24 sigverify_mod_exp_ibex(&testvec.key, &testvec.sig, &recovered_message);
25 if (err != kErrorOk) {
28 LOG_INFO(
"Test notes: %s", testvec.comment);
36 bool passed =
memcmp(testvec.encoded_msg, recovered_message.data,
37 sizeof(testvec.encoded_msg)) == 0;
38 if (testvec.valid && !passed) {
40 LOG_ERROR(
"Failed to verify a valid signature.");
41 LOG_INFO(
"Test notes: %s", testvec.comment);
43 }
else if (!testvec.valid && passed) {
45 LOG_ERROR(
"Invalid signature passed verification.");
46 LOG_INFO(
"Test notes: %s", testvec.comment);
53 OTTF_DEFINE_TEST_CONFIG();
59 LOG_INFO(
"Starting mod_exp_ibex_functest:%s", RULE_NAME);
60 for (uint32_t i = 0; i < SIGVERIFY_NUM_TESTS; i++) {
61 LOG_INFO(
"Starting test vector %d of %d...", i + 1, SIGVERIFY_NUM_TESTS);
65 LOG_INFO(
"Finished mod_exp_ibex_functest:%s", RULE_NAME);
66 return status_ok(result);