5 #ifndef OPENTITAN_SW_DEVICE_TESTS_CRYPTO_CRYPTOTEST_JSON_KMAC_COMMANDS_H_
6 #define OPENTITAN_SW_DEVICE_TESTS_CRYPTO_CRYPTOTEST_JSON_KMAC_COMMANDS_H_
7 #include "sw/device/lib/ujson/ujson_derive.h"
13 #define KMAC_CMD_MAX_MESSAGE_BYTES 256
14 #define KMAC_CMD_MAX_TAG_BYTES 64
17 #define KMAC_CMD_MAX_CUSTOMIZATION_STRING_BYTES 36
18 #define KMAC_CMD_MAX_KEY_BYTES 64
22 #define KMAC_MODE(_, value) \
25 UJSON_SERDE_ENUM(CryptotestKmacMode, cryptotest_kmac_mode_t, KMAC_MODE);
27 #define KMAC_REQUIRED_TAG_LENGTH(field, string) \
28 field(required_tag_length, size_t)
29 UJSON_SERDE_STRUCT(CryptotestKmacRequiredTagLength, cryptotest_kmac_required_tag_length_t, KMAC_REQUIRED_TAG_LENGTH);
31 #define KMAC_MESSAGE(field, string) \
32 field(message, uint8_t, KMAC_CMD_MAX_MESSAGE_BYTES) \
33 field(message_len, size_t)
34 UJSON_SERDE_STRUCT(CryptotestKmacMessage, cryptotest_kmac_message_t, KMAC_MESSAGE);
36 #define KMAC_KEY(field, string) \
37 field(key, uint8_t, KMAC_CMD_MAX_KEY_BYTES) \
38 field(key_len, size_t)
39 UJSON_SERDE_STRUCT(CryptotestKmacKey, cryptotest_kmac_key_t, KMAC_KEY);
41 #define KMAC_CUSTOMIZATION_STRING(field, string) \
42 field(customization_string, uint8_t, KMAC_CMD_MAX_CUSTOMIZATION_STRING_BYTES) \
43 field(customization_string_len, size_t)
44 UJSON_SERDE_STRUCT(CryptotestKmacCustomizationString, cryptotest_kmac_customization_string_t, KMAC_CUSTOMIZATION_STRING);
46 #define KMAC_TAG(field, string) \
47 field(tag, uint8_t, KMAC_CMD_MAX_TAG_BYTES) \
48 field(tag_len, size_t)
49 UJSON_SERDE_STRUCT(CryptotestKmacTag, cryptotest_kmac_tag_t, KMAC_TAG);