6 #include "sw/device/lib/base/status.h"
7 #include "sw/device/lib/crypto/drivers/entropy.h"
8 #include "sw/device/lib/testing/test_framework/check.h"
10 #include "sw/device/lib/testing/test_framework/ujson_ottf.h"
11 #include "sw/device/lib/ujson/ujson.h"
16 #include "sw/device/tests/crypto/cryptotest/json/aes_commands.h"
17 #include "sw/device/tests/crypto/cryptotest/json/commands.h"
18 #include "sw/device/tests/crypto/cryptotest/json/drbg_commands.h"
19 #include "sw/device/tests/crypto/cryptotest/json/ecdh_commands.h"
20 #include "sw/device/tests/crypto/cryptotest/json/ecdsa_commands.h"
21 #include "sw/device/tests/crypto/cryptotest/json/hash_commands.h"
22 #include "sw/device/tests/crypto/cryptotest/json/hmac_commands.h"
23 #include "sw/device/tests/crypto/cryptotest/json/kmac_commands.h"
24 #include "sw/device/tests/crypto/cryptotest/json/sphincsplus_commands.h"
34 #include "sphincsplus.h"
36 OTTF_DEFINE_TEST_CONFIG(.console.type = kOttfConsoleSpiDevice,
38 .console.test_may_clobber =
false, );
43 TRY(ujson_deserialize_cryptotest_cmd_t(uj, &cmd));
45 case kCryptotestCommandAes:
46 RESP_ERR(uj, handle_aes(uj));
48 case kCryptotestCommandDrbg:
49 RESP_ERR(uj, handle_drbg(uj));
51 case kCryptotestCommandEcdsa:
52 RESP_ERR(uj, handle_ecdsa(uj));
54 case kCryptotestCommandEcdh:
55 RESP_ERR(uj, handle_ecdh(uj));
57 case kCryptotestCommandHash:
58 RESP_ERR(uj, handle_hash(uj));
60 case kCryptotestCommandHmac:
61 RESP_ERR(uj, handle_hmac(uj));
63 case kCryptotestCommandKmac:
64 RESP_ERR(uj, handle_kmac(uj));
66 case kCryptotestCommandSphincsPlus:
67 RESP_ERR(uj, handle_sphincsplus(uj));
70 LOG_ERROR(
"Unrecognized command: %d", cmd);
71 RESP_ERR(uj, INVALID_ARGUMENT());
79 CHECK_STATUS_OK(entropy_complex_init());
80 ujson_t uj = ujson_ottf_console();
81 return status_ok(process_cmd(&uj));