diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 63345a1f1abd..7e8ae21a629d 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -494,6 +494,11 @@ Shell libraries |no_changes_yet_note| +Secure Domain Firmware (SDFW) libraries +--------------------------------------- + +* sdfw_services: Regenerated the zcbor-generated code files using v0.9.0. + Libraries for Zigbee -------------------- diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c index 682fa3afb16c..c3584c1d0180 100644 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c @@ -5,82 +5,86 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "echo_service_decode.h" +#include "zcbor_decode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_decode.h" -#include "echo_service_decode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -static bool decode_echo_service_rsp(zcbor_state_t *state, struct echo_service_rsp *result); -static bool decode_echo_service_req(zcbor_state_t *state, struct zcbor_string *result); - -static bool decode_echo_service_rsp(zcbor_state_t *state, struct echo_service_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((zcbor_list_start_decode(state) && - ((((zcbor_int32_decode(state, (&(*result).echo_service_rsp_ret)))) && - ((zcbor_tstr_decode(state, (&(*result).echo_service_rsp_str_out))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + +static bool decode_echo_service_rsp(zcbor_state_t *state, + struct echo_service_rsp *result); +static bool decode_echo_service_req(zcbor_state_t *state, + struct zcbor_string *result); + +static bool decode_echo_service_rsp(zcbor_state_t *state, + struct echo_service_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result).echo_service_rsp_ret)))) && + ((zcbor_tstr_decode(state, (&(*result).echo_service_rsp_str_out))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + log_result(state, res, __func__); + return res; } -static bool decode_echo_service_req(zcbor_state_t *state, struct zcbor_string *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_echo_service_req(zcbor_state_t *state, + struct zcbor_string *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_tstr_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); + bool res = (((zcbor_list_start_decode(state) && + ((((zcbor_tstr_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } int cbor_decode_echo_service_req(const uint8_t *payload, size_t payload_len, - struct zcbor_string *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_echo_service_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + struct zcbor_string *result, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_echo_service_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } int cbor_decode_echo_service_rsp(const uint8_t *payload, size_t payload_len, - struct echo_service_rsp *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_echo_service_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + struct echo_service_rsp *result, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_echo_service_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h index 284b67ff2716..ac2ea348222d 100644 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,25 +13,28 @@ #ifndef ECHO_SERVICE_DECODE_H__ #define ECHO_SERVICE_DECODE_H__ -#include +#include "echo_service_types.h" #include #include +#include #include -#include "echo_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif int cbor_decode_echo_service_req(const uint8_t *payload, size_t payload_len, - struct zcbor_string *result, size_t *payload_len_out); + struct zcbor_string *result, + size_t *payload_len_out); int cbor_decode_echo_service_rsp(const uint8_t *payload, size_t payload_len, - struct echo_service_rsp *result, size_t *payload_len_out); + struct echo_service_rsp *result, + size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c index a0cf04d2482e..75b8d5d94469 100644 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c @@ -5,82 +5,86 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "echo_service_encode.h" +#include "zcbor_encode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_encode.h" -#include "echo_service_encode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -static bool encode_echo_service_rsp(zcbor_state_t *state, const struct echo_service_rsp *input); -static bool encode_echo_service_req(zcbor_state_t *state, const struct zcbor_string *input); - -static bool encode_echo_service_rsp(zcbor_state_t *state, const struct echo_service_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((zcbor_list_start_encode(state, 2) && - ((((zcbor_int32_encode(state, (&(*input).echo_service_rsp_ret)))) && - ((zcbor_tstr_encode(state, (&(*input).echo_service_rsp_str_out))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 2)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + +static bool encode_echo_service_rsp(zcbor_state_t *state, + const struct echo_service_rsp *input); +static bool encode_echo_service_req(zcbor_state_t *state, + const struct zcbor_string *input); + +static bool encode_echo_service_rsp(zcbor_state_t *state, + const struct echo_service_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (zcbor_list_start_encode(state, 2) && + ((((zcbor_int32_encode(state, (&(*input).echo_service_rsp_ret)))) && + ((zcbor_tstr_encode(state, (&(*input).echo_service_rsp_str_out))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 2)))); + + log_result(state, res, __func__); + return res; } -static bool encode_echo_service_req(zcbor_state_t *state, const struct zcbor_string *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_echo_service_req(zcbor_state_t *state, + const struct zcbor_string *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_tstr_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); + bool res = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_tstr_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } int cbor_encode_echo_service_req(uint8_t *payload, size_t payload_len, - const struct zcbor_string *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_echo_service_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + const struct zcbor_string *input, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_echo_service_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } int cbor_encode_echo_service_rsp(uint8_t *payload, size_t payload_len, - const struct echo_service_rsp *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_echo_service_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + const struct echo_service_rsp *input, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_echo_service_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h index 08002595be0e..24f022c0a0e2 100644 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,25 +13,28 @@ #ifndef ECHO_SERVICE_ENCODE_H__ #define ECHO_SERVICE_ENCODE_H__ -#include +#include "echo_service_types.h" #include #include +#include #include -#include "echo_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif int cbor_encode_echo_service_req(uint8_t *payload, size_t payload_len, - const struct zcbor_string *input, size_t *payload_len_out); + const struct zcbor_string *input, + size_t *payload_len_out); int cbor_encode_echo_service_rsp(uint8_t *payload, size_t payload_len, - const struct echo_service_rsp *input, size_t *payload_len_out); + const struct echo_service_rsp *input, + size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h index 8b89ebb3c067..fc943ea641f9 100644 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,9 +13,9 @@ #ifndef ECHO_SERVICE_TYPES_H__ #define ECHO_SERVICE_TYPES_H__ -#include #include #include +#include #include #ifdef __cplusplus @@ -32,8 +32,8 @@ extern "C" { #define DEFAULT_MAX_QTY 3 struct echo_service_rsp { - int32_t echo_service_rsp_ret; - struct zcbor_string echo_service_rsp_str_out; + int32_t echo_service_rsp_ret; + struct zcbor_string echo_service_rsp_str_out; }; #ifdef __cplusplus diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.c b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.c index 62472160f58d..3db29566249f 100644 --- a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.c +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.c @@ -5,140 +5,125 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "enc_fw_service_decode.h" +#include "zcbor_decode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_decode.h" -#include "enc_fw_service_decode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + static bool decode_init(zcbor_state_t *state, struct init *result); static bool decode_chunk(zcbor_state_t *state, struct chunk *result); static bool decode_enc_fw_rsp(zcbor_state_t *state, int32_t *result); static bool decode_enc_fw_req(zcbor_state_t *state, struct enc_fw_req *result); -static bool decode_init(zcbor_state_t *state, struct init *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (0)))) && - ((zcbor_bstr_decode(state, (&(*result).init_aad))) && - ((((*result).init_aad.len >= 8) && ((*result).init_aad.len <= 8)) || - (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && - ((zcbor_bstr_decode(state, (&(*result).init_nonce))) && - ((((*result).init_nonce.len >= 12) && ((*result).init_nonce.len <= 12)) || - (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && - ((zcbor_bstr_decode(state, (&(*result).init_tag))) && - ((((*result).init_tag.len >= 16) && ((*result).init_tag.len <= 16)) || - (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && - ((zcbor_uint32_decode(state, (&(*result).init_buffer_addr)))) && - ((zcbor_uint32_decode(state, (&(*result).init_buffer_len)))) && - ((zcbor_uint32_decode(state, (&(*result).init_image_addr)))) && - ((zcbor_uint32_decode(state, (&(*result).init_image_len))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool decode_init(zcbor_state_t *state, struct init *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_expect(state, (0)))) && + ((zcbor_bstr_decode(state, (&(*result).init_aad))) && + ((((*result).init_aad.len == 8)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && + ((zcbor_bstr_decode(state, (&(*result).init_nonce))) && + ((((*result).init_nonce.len == 12)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && + ((zcbor_bstr_decode(state, (&(*result).init_tag))) && + ((((*result).init_tag.len == 16)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && + ((zcbor_uint32_decode(state, (&(*result).init_buffer_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).init_buffer_len)))) && + ((zcbor_uint32_decode(state, (&(*result).init_image_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).init_image_len))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_chunk(zcbor_state_t *state, struct chunk *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_chunk(zcbor_state_t *state, struct chunk *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((((zcbor_uint32_expect(state, (1)))) && - ((zcbor_uint32_decode(state, (&(*result).chunk_length)))) && - ((zcbor_bool_decode(state, (&(*result).chunk_last))))))); + bool res = (((((zcbor_uint32_expect(state, (1)))) && + ((zcbor_uint32_decode(state, (&(*result).chunk_length)))) && + ((zcbor_bool_decode(state, (&(*result).chunk_last))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_enc_fw_rsp(zcbor_state_t *state, int32_t *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_int32_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); +static bool decode_enc_fw_rsp(zcbor_state_t *state, int32_t *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_enc_fw_req(zcbor_state_t *state, struct enc_fw_req *result) -{ - zcbor_log("%s\r\n", __func__); - bool int_res; - - bool tmp_result = - (((zcbor_list_start_decode(state) && - ((((zcbor_union_start_code(state) && - (int_res = ((((decode_init(state, (&(*result).enc_fw_req_msg_init_m)))) && - (((*result).enc_fw_req_msg_choice = enc_fw_req_msg_init_m_c), - true)) || - (zcbor_union_elem_code(state) && - (((decode_chunk(state, (&(*result).enc_fw_req_msg_chunk_m)))) && - (((*result).enc_fw_req_msg_choice = enc_fw_req_msg_chunk_m_c), - true)))), - zcbor_union_end_code(state), int_res)))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool decode_enc_fw_req(zcbor_state_t *state, struct enc_fw_req *result) { + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool res = ((( + zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = + ((((decode_init(state, (&(*result).enc_fw_req_msg_init_m)))) && + (((*result).enc_fw_req_msg_choice = enc_fw_req_msg_init_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_chunk(state, + (&(*result).enc_fw_req_msg_chunk_m)))) && + (((*result).enc_fw_req_msg_choice = enc_fw_req_msg_chunk_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + log_result(state, res, __func__); + return res; } -int cbor_decode_enc_fw_req(const uint8_t *payload, size_t payload_len, struct enc_fw_req *result, - size_t *payload_len_out) -{ - zcbor_state_t states[4]; +int cbor_decode_enc_fw_req(const uint8_t *payload, size_t payload_len, + struct enc_fw_req *result, size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_enc_fw_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_enc_fw_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_decode_enc_fw_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; +int cbor_decode_enc_fw_rsp(const uint8_t *payload, size_t payload_len, + int32_t *result, size_t *payload_len_out) { + zcbor_state_t states[3]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_enc_fw_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_enc_fw_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.h b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.h index b1dbbd53ab87..25bfc8521a15 100644 --- a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.h +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,25 +13,26 @@ #ifndef ENC_FW_SERVICE_DECODE_H__ #define ENC_FW_SERVICE_DECODE_H__ -#include +#include "enc_fw_service_types.h" #include #include +#include #include -#include "enc_fw_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -int cbor_decode_enc_fw_req(const uint8_t *payload, size_t payload_len, struct enc_fw_req *result, - size_t *payload_len_out); +int cbor_decode_enc_fw_req(const uint8_t *payload, size_t payload_len, + struct enc_fw_req *result, size_t *payload_len_out); -int cbor_decode_enc_fw_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out); +int cbor_decode_enc_fw_rsp(const uint8_t *payload, size_t payload_len, + int32_t *result, size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.c b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.c index c094cae07aeb..10ced0f4dcce 100644 --- a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.c +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.c @@ -5,135 +5,122 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "enc_fw_service_encode.h" +#include "zcbor_encode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_encode.h" -#include "enc_fw_service_encode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + static bool encode_init(zcbor_state_t *state, const struct init *input); static bool encode_chunk(zcbor_state_t *state, const struct chunk *input); static bool encode_enc_fw_rsp(zcbor_state_t *state, const int32_t *input); -static bool encode_enc_fw_req(zcbor_state_t *state, const struct enc_fw_req *input); - -static bool encode_init(zcbor_state_t *state, const struct init *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (0)))) && - (((((*input).init_aad.len >= 8) && ((*input).init_aad.len <= 8)) || - (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && - (zcbor_bstr_encode(state, (&(*input).init_aad)))) && - (((((*input).init_nonce.len >= 12) && ((*input).init_nonce.len <= 12)) || - (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && - (zcbor_bstr_encode(state, (&(*input).init_nonce)))) && - (((((*input).init_tag.len >= 16) && ((*input).init_tag.len <= 16)) || - (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && - (zcbor_bstr_encode(state, (&(*input).init_tag)))) && - ((zcbor_uint32_encode(state, (&(*input).init_buffer_addr)))) && - ((zcbor_uint32_encode(state, (&(*input).init_buffer_len)))) && - ((zcbor_uint32_encode(state, (&(*input).init_image_addr)))) && - ((zcbor_uint32_encode(state, (&(*input).init_image_len))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_enc_fw_req(zcbor_state_t *state, + const struct enc_fw_req *input); + +static bool encode_init(zcbor_state_t *state, const struct init *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_put(state, (0)))) && + (((((*input).init_aad.len == 8)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && + (zcbor_bstr_encode(state, (&(*input).init_aad)))) && + (((((*input).init_nonce.len == 12)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && + (zcbor_bstr_encode(state, (&(*input).init_nonce)))) && + (((((*input).init_tag.len == 16)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && + (zcbor_bstr_encode(state, (&(*input).init_tag)))) && + ((zcbor_uint32_encode(state, (&(*input).init_buffer_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).init_buffer_len)))) && + ((zcbor_uint32_encode(state, (&(*input).init_image_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).init_image_len))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_chunk(zcbor_state_t *state, const struct chunk *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_chunk(zcbor_state_t *state, const struct chunk *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((((zcbor_uint32_put(state, (1)))) && - ((zcbor_uint32_encode(state, (&(*input).chunk_length)))) && - ((zcbor_bool_encode(state, (&(*input).chunk_last))))))); + bool res = (((((zcbor_uint32_put(state, (1)))) && + ((zcbor_uint32_encode(state, (&(*input).chunk_length)))) && + ((zcbor_bool_encode(state, (&(*input).chunk_last))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_enc_fw_rsp(zcbor_state_t *state, const int32_t *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_int32_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); +static bool encode_enc_fw_rsp(zcbor_state_t *state, const int32_t *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_int32_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_enc_fw_req(zcbor_state_t *state, const struct enc_fw_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_encode(state, 8) && - ((((((*input).enc_fw_req_msg_choice == enc_fw_req_msg_init_m_c) - ? ((encode_init(state, (&(*input).enc_fw_req_msg_init_m)))) - : (((*input).enc_fw_req_msg_choice == enc_fw_req_msg_chunk_m_c) - ? ((encode_chunk(state, (&(*input).enc_fw_req_msg_chunk_m)))) - : false)))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 8)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_enc_fw_req(zcbor_state_t *state, + const struct enc_fw_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((zcbor_list_start_encode(state, 8) && + ((((((*input).enc_fw_req_msg_choice == enc_fw_req_msg_init_m_c) + ? ((encode_init(state, (&(*input).enc_fw_req_msg_init_m)))) + : (((*input).enc_fw_req_msg_choice == enc_fw_req_msg_chunk_m_c) + ? ((encode_chunk(state, + (&(*input).enc_fw_req_msg_chunk_m)))) + : false)))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 8)))); + + log_result(state, res, __func__); + return res; } -int cbor_encode_enc_fw_req(uint8_t *payload, size_t payload_len, const struct enc_fw_req *input, - size_t *payload_len_out) -{ - zcbor_state_t states[4]; +int cbor_encode_enc_fw_req(uint8_t *payload, size_t payload_len, + const struct enc_fw_req *input, + size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_enc_fw_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_enc_fw_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_encode_enc_fw_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; +int cbor_encode_enc_fw_rsp(uint8_t *payload, size_t payload_len, + const int32_t *input, size_t *payload_len_out) { + zcbor_state_t states[3]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_enc_fw_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_enc_fw_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.h b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.h index 4fec1b3d0352..e65681bd8fc4 100644 --- a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.h +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,25 +13,27 @@ #ifndef ENC_FW_SERVICE_ENCODE_H__ #define ENC_FW_SERVICE_ENCODE_H__ -#include +#include "enc_fw_service_types.h" #include #include +#include #include -#include "enc_fw_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -int cbor_encode_enc_fw_req(uint8_t *payload, size_t payload_len, const struct enc_fw_req *input, - size_t *payload_len_out); +int cbor_encode_enc_fw_req(uint8_t *payload, size_t payload_len, + const struct enc_fw_req *input, + size_t *payload_len_out); -int cbor_encode_enc_fw_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out); +int cbor_encode_enc_fw_rsp(uint8_t *payload, size_t payload_len, + const int32_t *input, size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_types.h b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_types.h index c39dbb499309..32d99a9e19da 100644 --- a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_types.h +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_types.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,9 +13,9 @@ #ifndef ENC_FW_SERVICE_TYPES_H__ #define ENC_FW_SERVICE_TYPES_H__ -#include #include #include +#include #include #ifdef __cplusplus @@ -32,29 +32,29 @@ extern "C" { #define DEFAULT_MAX_QTY 3 struct init { - struct zcbor_string init_aad; - struct zcbor_string init_nonce; - struct zcbor_string init_tag; - uint32_t init_buffer_addr; - uint32_t init_buffer_len; - uint32_t init_image_addr; - uint32_t init_image_len; + struct zcbor_string init_aad; + struct zcbor_string init_nonce; + struct zcbor_string init_tag; + uint32_t init_buffer_addr; + uint32_t init_buffer_len; + uint32_t init_image_addr; + uint32_t init_image_len; }; struct chunk { - uint32_t chunk_length; - bool chunk_last; + uint32_t chunk_length; + bool chunk_last; }; struct enc_fw_req { - union { - struct init enc_fw_req_msg_init_m; - struct chunk enc_fw_req_msg_chunk_m; - }; - enum { - enc_fw_req_msg_init_m_c, - enc_fw_req_msg_chunk_m_c, - } enc_fw_req_msg_choice; + union { + struct init enc_fw_req_msg_init_m; + struct chunk enc_fw_req_msg_chunk_m; + }; + enum { + enc_fw_req_msg_init_m_c, + enc_fw_req_msg_chunk_m_c, + } enc_fw_req_msg_choice; }; #ifdef __cplusplus diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.c b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.c index bb16407ee17b..d4a658735086 100644 --- a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.c +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.c @@ -5,403 +5,374 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "extmem_service_decode.h" +#include "zcbor_decode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_decode.h" -#include "extmem_service_decode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -static bool decode_extmem_read_done_req(zcbor_state_t *state, struct extmem_read_done_req *result); -static bool decode_extmem_write_setup_req(zcbor_state_t *state, - struct extmem_write_setup_req *result); +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + +static bool decode_extmem_read_done_req(zcbor_state_t *state, + struct extmem_read_done_req *result); +static bool +decode_extmem_write_setup_req(zcbor_state_t *state, + struct extmem_write_setup_req *result); static bool decode_extmem_write_done_req(zcbor_state_t *state, - struct extmem_write_done_req *result); + struct extmem_write_done_req *result); static bool decode_extmem_erase_done_req(zcbor_state_t *state, - struct extmem_erase_done_req *result); -static bool decode_extmem_get_capabilities_req(zcbor_state_t *state, - struct extmem_get_capabilities_req *result); -static bool decode_extmem_read_pending_notify(zcbor_state_t *state, - struct extmem_read_pending_notify *result); -static bool decode_extmem_write_pending_notify(zcbor_state_t *state, - struct extmem_write_pending_notify *result); -static bool decode_extmem_erase_pending_notify(zcbor_state_t *state, - struct extmem_erase_pending_notify *result); + struct extmem_erase_done_req *result); +static bool +decode_extmem_get_capabilities_req(zcbor_state_t *state, + struct extmem_get_capabilities_req *result); +static bool +decode_extmem_read_pending_notify(zcbor_state_t *state, + struct extmem_read_pending_notify *result); +static bool +decode_extmem_write_pending_notify(zcbor_state_t *state, + struct extmem_write_pending_notify *result); +static bool +decode_extmem_erase_pending_notify(zcbor_state_t *state, + struct extmem_erase_pending_notify *result); static bool decode_extmem_get_capabilities_notify_pending( - zcbor_state_t *state, struct extmem_get_capabilities_notify_pending *result); + zcbor_state_t *state, + struct extmem_get_capabilities_notify_pending *result); static bool decode_extmem_nfy(zcbor_state_t *state, struct extmem_nfy *result); static bool decode_extmem_rsp(zcbor_state_t *state, struct extmem_rsp *result); static bool decode_extmem_req(zcbor_state_t *state, struct extmem_req *result); -static bool decode_extmem_read_done_req(zcbor_state_t *state, struct extmem_read_done_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_extmem_read_done_req(zcbor_state_t *state, + struct extmem_read_done_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_expect(state, (1)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_read_done_req_request_id)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_read_done_req_error)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_read_done_req_addr))))))); + bool res = ((( + ((zcbor_uint32_expect(state, (1)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_read_done_req_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_read_done_req_error)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_read_done_req_addr))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_extmem_write_setup_req(zcbor_state_t *state, - struct extmem_write_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (3)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_write_setup_req_request_id)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_write_setup_req_error)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_write_setup_req_addr))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +decode_extmem_write_setup_req(zcbor_state_t *state, + struct extmem_write_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_expect(state, (3)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_write_setup_req_request_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_write_setup_req_error)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_write_setup_req_addr))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_extmem_write_done_req(zcbor_state_t *state, struct extmem_write_done_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (5)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_write_done_req_request_id)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_write_done_req_error))))))); +static bool decode_extmem_write_done_req(zcbor_state_t *state, + struct extmem_write_done_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((((zcbor_uint32_expect(state, (5)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_write_done_req_request_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_write_done_req_error))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_extmem_erase_done_req(zcbor_state_t *state, struct extmem_erase_done_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (7)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_erase_done_req_request_id)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_erase_done_req_error))))))); +static bool decode_extmem_erase_done_req(zcbor_state_t *state, + struct extmem_erase_done_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((((zcbor_uint32_expect(state, (7)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_erase_done_req_request_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_erase_done_req_error))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_extmem_get_capabilities_req(zcbor_state_t *state, - struct extmem_get_capabilities_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (9)))) && - ((zcbor_uint32_decode(state, - (&(*result).extmem_get_capabilities_req_request_id)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_get_capabilities_req_error)))) && - ((zcbor_uint32_decode(state, - (&(*result).extmem_get_capabilities_req_base_addr)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_get_capabilities_req_capacity)))) && - ((zcbor_uint32_decode(state, - (&(*result).extmem_get_capabilities_req_erase_size)))) && - ((zcbor_uint32_decode(state, - (&(*result).extmem_get_capabilities_req_write_size)))) && - ((zcbor_uint32_decode(state, - (&(*result).extmem_get_capabilities_req_chunk_size)))) && - ((zcbor_bool_decode(state, - (&(*result).extmem_get_capabilities_req_memory_mapped))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +decode_extmem_get_capabilities_req(zcbor_state_t *state, + struct extmem_get_capabilities_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (9)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_get_capabilities_req_request_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_get_capabilities_req_error)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_get_capabilities_req_base_addr)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_get_capabilities_req_capacity)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_get_capabilities_req_erase_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_get_capabilities_req_write_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_get_capabilities_req_chunk_size)))) && + ((zcbor_bool_decode( + state, (&(*result).extmem_get_capabilities_req_memory_mapped))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_extmem_read_pending_notify(zcbor_state_t *state, - struct extmem_read_pending_notify *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (2)))) && - ((zcbor_uint32_decode(state, - (&(*result).extmem_read_pending_notify_request_id)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_read_pending_notify_offset)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_read_pending_notify_size))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +decode_extmem_read_pending_notify(zcbor_state_t *state, + struct extmem_read_pending_notify *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (2)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_read_pending_notify_request_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_read_pending_notify_offset)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_read_pending_notify_size))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_extmem_write_pending_notify(zcbor_state_t *state, - struct extmem_write_pending_notify *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (6)))) && - ((zcbor_uint32_decode(state, - (&(*result).extmem_write_pending_notify_request_id)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_write_pending_notify_offset)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_write_pending_notify_size))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +decode_extmem_write_pending_notify(zcbor_state_t *state, + struct extmem_write_pending_notify *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (6)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_write_pending_notify_request_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_write_pending_notify_offset)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_write_pending_notify_size))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_extmem_erase_pending_notify(zcbor_state_t *state, - struct extmem_erase_pending_notify *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (8)))) && - ((zcbor_uint32_decode(state, - (&(*result).extmem_erase_pending_notify_request_id)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_erase_pending_notify_offset)))) && - ((zcbor_uint32_decode(state, (&(*result).extmem_erase_pending_notify_size))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +decode_extmem_erase_pending_notify(zcbor_state_t *state, + struct extmem_erase_pending_notify *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (8)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_erase_pending_notify_request_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_erase_pending_notify_offset)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_erase_pending_notify_size))))))); + + log_result(state, res, __func__); + return res; } -static bool -decode_extmem_get_capabilities_notify_pending(zcbor_state_t *state, - struct extmem_get_capabilities_notify_pending *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (10)))) && - ((zcbor_uint32_decode( - state, (&(*result).extmem_get_capabilities_notify_pending_request_id))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool decode_extmem_get_capabilities_notify_pending( + zcbor_state_t *state, + struct extmem_get_capabilities_notify_pending *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (10)))) && + ((zcbor_uint32_decode( + state, + (&(*result).extmem_get_capabilities_notify_pending_request_id))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_extmem_nfy(zcbor_state_t *state, struct extmem_nfy *result) -{ - zcbor_log("%s\r\n", __func__); - bool int_res; - - bool tmp_result = (((zcbor_list_start_decode(state) && ((((zcbor_union_start_code(state) && - (int_res = ((((decode_extmem_read_pending_notify( - state, (&(*result).extmem_nfy_msg_extmem_read_pending_notify_m)))) && - (((*result).extmem_nfy_msg_choice = - extmem_nfy_msg_extmem_read_pending_notify_m_c), true)) || - (zcbor_union_elem_code(state) && - (((decode_extmem_write_pending_notify( - state, (&(*result).extmem_nfy_msg_extmem_write_pending_notify_m)))) && - (((*result).extmem_nfy_msg_choice = - extmem_nfy_msg_extmem_write_pending_notify_m_c), true))) || - (zcbor_union_elem_code(state) && - (((decode_extmem_erase_pending_notify( - state, (&(*result).extmem_nfy_msg_extmem_erase_pending_notify_m)))) && - (((*result).extmem_nfy_msg_choice = - extmem_nfy_msg_extmem_erase_pending_notify_m_c), true))) || - (zcbor_union_elem_code(state) && - (((decode_extmem_get_capabilities_notify_pending( - state, - (&(*result).extmem_nfy_msg_extmem_get_capabilities_notify_pending_m)))) && - (((*result).extmem_nfy_msg_choice = - extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c), true)))), - zcbor_union_end_code(state), int_res)))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool decode_extmem_nfy(zcbor_state_t *state, struct extmem_nfy *result) { + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool res = ((( + zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = + ((((decode_extmem_read_pending_notify( + state, + (&(*result) + .extmem_nfy_msg_extmem_read_pending_notify_m)))) && + (((*result).extmem_nfy_msg_choice = + extmem_nfy_msg_extmem_read_pending_notify_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_extmem_write_pending_notify( + state, + (&(*result) + .extmem_nfy_msg_extmem_write_pending_notify_m)))) && + (((*result).extmem_nfy_msg_choice = + extmem_nfy_msg_extmem_write_pending_notify_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_erase_pending_notify( + state, + (&(*result) + .extmem_nfy_msg_extmem_erase_pending_notify_m)))) && + (((*result).extmem_nfy_msg_choice = + extmem_nfy_msg_extmem_erase_pending_notify_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_get_capabilities_notify_pending( + state, + (&(*result) + .extmem_nfy_msg_extmem_get_capabilities_notify_pending_m)))) && + (((*result).extmem_nfy_msg_choice = + extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + log_result(state, res, __func__); + return res; } -static bool decode_extmem_rsp(zcbor_state_t *state, struct extmem_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((((zcbor_uint_decode(state, &(*result).extmem_rsp_msg_choice, - sizeof((*result).extmem_rsp_msg_choice)))) && - ((((((*result).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_read_done_rsp_m_c) && - ((1))) || - (((*result).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_write_setup_rsp_m_c) && - ((1))) || - (((*result).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_write_done_rsp_m_c) && - ((1))) || - (((*result).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_erase_done_rsp_m_c) && - ((1))) || - (((*result).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_get_capabilities_rsp_m_c) && - ((1)))) || - (zcbor_error(state, ZCBOR_ERR_WRONG_VALUE), false)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool decode_extmem_rsp(zcbor_state_t *state, struct extmem_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((zcbor_list_start_decode(state) && + ((((((zcbor_uint_decode(state, &(*result).extmem_rsp_msg_choice, + sizeof((*result).extmem_rsp_msg_choice)))) && + ((((((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_read_done_rsp_m_c) && + ((1))) || + (((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_write_setup_rsp_m_c) && + ((1))) || + (((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_write_done_rsp_m_c) && + ((1))) || + (((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_erase_done_rsp_m_c) && + ((1))) || + (((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_get_capabilities_rsp_m_c) && + ((1)))) || + (zcbor_error(state, ZCBOR_ERR_WRONG_VALUE), false)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + log_result(state, res, __func__); + return res; } -static bool decode_extmem_req(zcbor_state_t *state, struct extmem_req *result) -{ - zcbor_log("%s\r\n", __func__); - bool int_res; - - bool tmp_result = ((( - zcbor_list_start_decode(state) && - ((((zcbor_union_start_code(state) && - (int_res = - ((((decode_extmem_read_done_req( - state, - (&(*result).extmem_req_msg_extmem_read_done_req_m)))) && - (((*result).extmem_req_msg_choice = - extmem_req_msg_extmem_read_done_req_m_c), - true)) || - (zcbor_union_elem_code(state) && - (((decode_extmem_write_setup_req( - state, - (&(*result).extmem_req_msg_extmem_write_setup_req_m)))) && - (((*result).extmem_req_msg_choice = - extmem_req_msg_extmem_write_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_extmem_write_done_req( - state, - (&(*result).extmem_req_msg_extmem_write_done_req_m)))) && - (((*result).extmem_req_msg_choice = - extmem_req_msg_extmem_write_done_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_extmem_erase_done_req( - state, - (&(*result).extmem_req_msg_extmem_erase_done_req_m)))) && - (((*result).extmem_req_msg_choice = - extmem_req_msg_extmem_erase_done_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_extmem_get_capabilities_req( - state, - (&(*result) - .extmem_req_msg_extmem_get_capabilities_req_m))) - ) && - (((*result).extmem_req_msg_choice = - extmem_req_msg_extmem_get_capabilities_req_m_c), - true)))), - zcbor_union_end_code(state), int_res)))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool decode_extmem_req(zcbor_state_t *state, struct extmem_req *result) { + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool res = ((( + zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = + ((((decode_extmem_read_done_req( + state, + (&(*result).extmem_req_msg_extmem_read_done_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_read_done_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_extmem_write_setup_req( + state, + (&(*result).extmem_req_msg_extmem_write_setup_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_write_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_write_done_req( + state, + (&(*result).extmem_req_msg_extmem_write_done_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_write_done_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_erase_done_req( + state, + (&(*result).extmem_req_msg_extmem_erase_done_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_erase_done_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_get_capabilities_req( + state, + (&(*result) + .extmem_req_msg_extmem_get_capabilities_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_get_capabilities_req_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + log_result(state, res, __func__); + return res; } -int cbor_decode_extmem_req(const uint8_t *payload, size_t payload_len, struct extmem_req *result, - size_t *payload_len_out) -{ - zcbor_state_t states[4]; +int cbor_decode_extmem_req(const uint8_t *payload, size_t payload_len, + struct extmem_req *result, size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_extmem_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_extmem_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_decode_extmem_rsp(const uint8_t *payload, size_t payload_len, struct extmem_rsp *result, - size_t *payload_len_out) -{ - zcbor_state_t states[4]; +int cbor_decode_extmem_rsp(const uint8_t *payload, size_t payload_len, + struct extmem_rsp *result, size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_extmem_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_extmem_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_decode_extmem_nfy(const uint8_t *payload, size_t payload_len, struct extmem_nfy *result, - size_t *payload_len_out) -{ - zcbor_state_t states[4]; +int cbor_decode_extmem_nfy(const uint8_t *payload, size_t payload_len, + struct extmem_nfy *result, size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_extmem_nfy, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_extmem_nfy, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.h b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.h index b4e7887df8d7..aebe4204c36c 100644 --- a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.h +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,28 +13,29 @@ #ifndef EXTMEM_SERVICE_DECODE_H__ #define EXTMEM_SERVICE_DECODE_H__ -#include +#include "extmem_service_types.h" #include #include +#include #include -#include "extmem_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -int cbor_decode_extmem_req(const uint8_t *payload, size_t payload_len, struct extmem_req *result, - size_t *payload_len_out); +int cbor_decode_extmem_req(const uint8_t *payload, size_t payload_len, + struct extmem_req *result, size_t *payload_len_out); -int cbor_decode_extmem_rsp(const uint8_t *payload, size_t payload_len, struct extmem_rsp *result, - size_t *payload_len_out); +int cbor_decode_extmem_rsp(const uint8_t *payload, size_t payload_len, + struct extmem_rsp *result, size_t *payload_len_out); -int cbor_decode_extmem_nfy(const uint8_t *payload, size_t payload_len, struct extmem_nfy *result, - size_t *payload_len_out); +int cbor_decode_extmem_nfy(const uint8_t *payload, size_t payload_len, + struct extmem_nfy *result, size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.c b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.c index 2eee86cb577b..f8a2128dba06 100644 --- a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.c +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.c @@ -5,379 +5,358 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "extmem_service_encode.h" +#include "zcbor_encode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_encode.h" -#include "extmem_service_encode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -static bool encode_extmem_read_done_req(zcbor_state_t *state, - const struct extmem_read_done_req *input); -static bool encode_extmem_write_setup_req(zcbor_state_t *state, - const struct extmem_write_setup_req *input); -static bool encode_extmem_write_done_req(zcbor_state_t *state, - const struct extmem_write_done_req *input); -static bool encode_extmem_erase_done_req(zcbor_state_t *state, - const struct extmem_erase_done_req *input); -static bool encode_extmem_get_capabilities_req(zcbor_state_t *state, - const struct extmem_get_capabilities_req *input); -static bool encode_extmem_read_pending_notify(zcbor_state_t *state, - const struct extmem_read_pending_notify *input); -static bool encode_extmem_write_pending_notify(zcbor_state_t *state, - const struct extmem_write_pending_notify *input); -static bool encode_extmem_erase_pending_notify(zcbor_state_t *state, - const struct extmem_erase_pending_notify *input); +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + +static bool +encode_extmem_read_done_req(zcbor_state_t *state, + const struct extmem_read_done_req *input); +static bool +encode_extmem_write_setup_req(zcbor_state_t *state, + const struct extmem_write_setup_req *input); +static bool +encode_extmem_write_done_req(zcbor_state_t *state, + const struct extmem_write_done_req *input); +static bool +encode_extmem_erase_done_req(zcbor_state_t *state, + const struct extmem_erase_done_req *input); +static bool encode_extmem_get_capabilities_req( + zcbor_state_t *state, const struct extmem_get_capabilities_req *input); +static bool encode_extmem_read_pending_notify( + zcbor_state_t *state, const struct extmem_read_pending_notify *input); +static bool encode_extmem_write_pending_notify( + zcbor_state_t *state, const struct extmem_write_pending_notify *input); +static bool encode_extmem_erase_pending_notify( + zcbor_state_t *state, const struct extmem_erase_pending_notify *input); static bool encode_extmem_get_capabilities_notify_pending( - zcbor_state_t *state, const struct extmem_get_capabilities_notify_pending *input); -static bool encode_extmem_nfy(zcbor_state_t *state, const struct extmem_nfy *input); -static bool encode_extmem_rsp(zcbor_state_t *state, const struct extmem_rsp *input); -static bool encode_extmem_req(zcbor_state_t *state, const struct extmem_req *input); - -static bool encode_extmem_read_done_req(zcbor_state_t *state, - const struct extmem_read_done_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (1)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_read_done_req_request_id)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_read_done_req_error)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_read_done_req_addr))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + zcbor_state_t *state, + const struct extmem_get_capabilities_notify_pending *input); +static bool encode_extmem_nfy(zcbor_state_t *state, + const struct extmem_nfy *input); +static bool encode_extmem_rsp(zcbor_state_t *state, + const struct extmem_rsp *input); +static bool encode_extmem_req(zcbor_state_t *state, + const struct extmem_req *input); + +static bool +encode_extmem_read_done_req(zcbor_state_t *state, + const struct extmem_read_done_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (1)))) && + ((zcbor_uint32_encode(state, + (&(*input).extmem_read_done_req_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_read_done_req_error)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_read_done_req_addr))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_extmem_write_setup_req(zcbor_state_t *state, - const struct extmem_write_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (3)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_write_setup_req_request_id)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_write_setup_req_error)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_write_setup_req_addr))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +encode_extmem_write_setup_req(zcbor_state_t *state, + const struct extmem_write_setup_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_put(state, (3)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_write_setup_req_request_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_write_setup_req_error)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_write_setup_req_addr))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_extmem_write_done_req(zcbor_state_t *state, - const struct extmem_write_done_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_extmem_write_done_req(zcbor_state_t *state, + const struct extmem_write_done_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (5)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_write_done_req_request_id)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_write_done_req_error))))))); + bool res = (((((zcbor_uint32_put(state, (5)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_write_done_req_request_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_write_done_req_error))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_extmem_erase_done_req(zcbor_state_t *state, - const struct extmem_erase_done_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (7)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_erase_done_req_request_id)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_erase_done_req_error))))))); +static bool +encode_extmem_erase_done_req(zcbor_state_t *state, + const struct extmem_erase_done_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((((zcbor_uint32_put(state, (7)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_erase_done_req_request_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_erase_done_req_error))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_extmem_get_capabilities_req(zcbor_state_t *state, - const struct extmem_get_capabilities_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (9)))) && - ((zcbor_uint32_encode(state, - (&(*input).extmem_get_capabilities_req_request_id)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_get_capabilities_req_error)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_get_capabilities_req_base_addr)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_get_capabilities_req_capacity)))) && - ((zcbor_uint32_encode(state, - (&(*input).extmem_get_capabilities_req_erase_size)))) && - ((zcbor_uint32_encode(state, - (&(*input).extmem_get_capabilities_req_write_size)))) && - ((zcbor_uint32_encode(state, - (&(*input).extmem_get_capabilities_req_chunk_size)))) && - ((zcbor_bool_encode(state, - (&(*input).extmem_get_capabilities_req_memory_mapped))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_extmem_get_capabilities_req( + zcbor_state_t *state, const struct extmem_get_capabilities_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (9)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_get_capabilities_req_request_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_get_capabilities_req_error)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_get_capabilities_req_base_addr)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_get_capabilities_req_capacity)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_get_capabilities_req_erase_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_get_capabilities_req_write_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_get_capabilities_req_chunk_size)))) && + ((zcbor_bool_encode( + state, (&(*input).extmem_get_capabilities_req_memory_mapped))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_extmem_read_pending_notify(zcbor_state_t *state, - const struct extmem_read_pending_notify *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (2)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_read_pending_notify_request_id)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_read_pending_notify_offset)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_read_pending_notify_size))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_extmem_read_pending_notify( + zcbor_state_t *state, const struct extmem_read_pending_notify *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (2)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_read_pending_notify_request_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_read_pending_notify_offset)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_read_pending_notify_size))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_extmem_write_pending_notify(zcbor_state_t *state, - const struct extmem_write_pending_notify *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (6)))) && - ((zcbor_uint32_encode(state, - (&(*input).extmem_write_pending_notify_request_id)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_write_pending_notify_offset)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_write_pending_notify_size))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_extmem_write_pending_notify( + zcbor_state_t *state, const struct extmem_write_pending_notify *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (6)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_write_pending_notify_request_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_write_pending_notify_offset)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_write_pending_notify_size))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_extmem_erase_pending_notify(zcbor_state_t *state, - const struct extmem_erase_pending_notify *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (8)))) && - ((zcbor_uint32_encode(state, - (&(*input).extmem_erase_pending_notify_request_id)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_erase_pending_notify_offset)))) && - ((zcbor_uint32_encode(state, (&(*input).extmem_erase_pending_notify_size))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_extmem_erase_pending_notify( + zcbor_state_t *state, const struct extmem_erase_pending_notify *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (8)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_erase_pending_notify_request_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_erase_pending_notify_offset)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_erase_pending_notify_size))))))); + + log_result(state, res, __func__); + return res; } static bool encode_extmem_get_capabilities_notify_pending( - zcbor_state_t *state, const struct extmem_get_capabilities_notify_pending *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (10)))) && - ((zcbor_uint32_encode( - state, (&(*input).extmem_get_capabilities_notify_pending_request_id))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + zcbor_state_t *state, + const struct extmem_get_capabilities_notify_pending *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (10)))) && + ((zcbor_uint32_encode( + state, + (&(*input).extmem_get_capabilities_notify_pending_request_id))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_extmem_nfy(zcbor_state_t *state, const struct extmem_nfy *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_encode(state, 4) && - ((((((*input).extmem_nfy_msg_choice == - extmem_nfy_msg_extmem_read_pending_notify_m_c) - ? ((encode_extmem_read_pending_notify( - state, (&(*input).extmem_nfy_msg_extmem_read_pending_notify_m)))) - : (((*input).extmem_nfy_msg_choice == - extmem_nfy_msg_extmem_write_pending_notify_m_c) - ? ((encode_extmem_write_pending_notify( - state, (&(*input).extmem_nfy_msg_extmem_write_pending_notify_m)))) - : (((*input).extmem_nfy_msg_choice == - extmem_nfy_msg_extmem_erase_pending_notify_m_c) - ? ((encode_extmem_erase_pending_notify( - state, (&(*input).extmem_nfy_msg_extmem_erase_pending_notify_m)))) - : (((*input).extmem_nfy_msg_choice == - extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c) - ? ((encode_extmem_get_capabilities_notify_pending( - state, - (&(*input).extmem_nfy_msg_extmem_get_capabilities_notify_pending_m)))) - : false)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 4)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_extmem_nfy(zcbor_state_t *state, + const struct extmem_nfy *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + zcbor_list_start_encode(state, 4) && + ((((((*input).extmem_nfy_msg_choice == + extmem_nfy_msg_extmem_read_pending_notify_m_c) + ? ((encode_extmem_read_pending_notify( + state, + (&(*input).extmem_nfy_msg_extmem_read_pending_notify_m)))) + : (((*input).extmem_nfy_msg_choice == + extmem_nfy_msg_extmem_write_pending_notify_m_c) + ? ((encode_extmem_write_pending_notify( + state, + (&(*input) + .extmem_nfy_msg_extmem_write_pending_notify_m)))) + : (((*input).extmem_nfy_msg_choice == + extmem_nfy_msg_extmem_erase_pending_notify_m_c) + ? ((encode_extmem_erase_pending_notify( + state, + (&(*input) + .extmem_nfy_msg_extmem_erase_pending_notify_m)))) + : (((*input).extmem_nfy_msg_choice == + extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c) + ? ((encode_extmem_get_capabilities_notify_pending( + state, + (&(*input) + .extmem_nfy_msg_extmem_get_capabilities_notify_pending_m)))) + : false)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 4)))); + + log_result(state, res, __func__); + return res; } -static bool encode_extmem_rsp(zcbor_state_t *state, const struct extmem_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_encode(state, 1) && - ((((((*input).extmem_rsp_msg_choice == extmem_rsp_msg_extmem_read_done_rsp_m_c) - ? ((zcbor_uint32_put(state, (1)))) - : (((*input).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_write_setup_rsp_m_c) - ? ((zcbor_uint32_put(state, (3)))) - : (((*input).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_write_done_rsp_m_c) - ? ((zcbor_uint32_put(state, (5)))) - : (((*input).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_erase_done_rsp_m_c) - ? ((zcbor_uint32_put(state, (7)))) - : (((*input).extmem_rsp_msg_choice == - extmem_rsp_msg_extmem_get_capabilities_rsp_m_c) - ? ((zcbor_uint32_put(state, (9)))) - : false))))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_extmem_rsp(zcbor_state_t *state, + const struct extmem_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + zcbor_list_start_encode(state, 1) && + ((((((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_read_done_rsp_m_c) + ? ((zcbor_uint32_put(state, (1)))) + : (((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_write_setup_rsp_m_c) + ? ((zcbor_uint32_put(state, (3)))) + : (((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_write_done_rsp_m_c) + ? ((zcbor_uint32_put(state, (5)))) + : (((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_erase_done_rsp_m_c) + ? ((zcbor_uint32_put(state, (7)))) + : (((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_get_capabilities_rsp_m_c) + ? ((zcbor_uint32_put(state, (9)))) + : false))))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); + + log_result(state, res, __func__); + return res; } -static bool encode_extmem_req(zcbor_state_t *state, const struct extmem_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_encode(state, 9) && - ((((((*input).extmem_req_msg_choice == extmem_req_msg_extmem_read_done_req_m_c) - ? ((encode_extmem_read_done_req( - state, (&(*input).extmem_req_msg_extmem_read_done_req_m)))) - : (((*input).extmem_req_msg_choice == - extmem_req_msg_extmem_write_setup_req_m_c) - ? ((encode_extmem_write_setup_req( - state, (&(*input).extmem_req_msg_extmem_write_setup_req_m)))) - : (((*input).extmem_req_msg_choice == - extmem_req_msg_extmem_write_done_req_m_c) - ? ((encode_extmem_write_done_req( - state, (&(*input).extmem_req_msg_extmem_write_done_req_m)))) - : (((*input).extmem_req_msg_choice == - extmem_req_msg_extmem_erase_done_req_m_c) - ? ((encode_extmem_erase_done_req( - state, (&(*input).extmem_req_msg_extmem_erase_done_req_m)))) - : (((*input).extmem_req_msg_choice == - extmem_req_msg_extmem_get_capabilities_req_m_c) - ? ((encode_extmem_get_capabilities_req( - state, (&(*input).extmem_req_msg_extmem_get_capabilities_req_m)))) - : false))))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 9)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_extmem_req(zcbor_state_t *state, + const struct extmem_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + zcbor_list_start_encode(state, 9) && + ((((((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_read_done_req_m_c) + ? ((encode_extmem_read_done_req( + state, (&(*input).extmem_req_msg_extmem_read_done_req_m)))) + : (((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_write_setup_req_m_c) + ? ((encode_extmem_write_setup_req( + state, + (&(*input) + .extmem_req_msg_extmem_write_setup_req_m)))) + : (((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_write_done_req_m_c) + ? ((encode_extmem_write_done_req( + state, + (&(*input) + .extmem_req_msg_extmem_write_done_req_m)))) + : (((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_erase_done_req_m_c) + ? ((encode_extmem_erase_done_req( + state, + (&(*input) + .extmem_req_msg_extmem_erase_done_req_m)))) + : (((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_get_capabilities_req_m_c) + ? ((encode_extmem_get_capabilities_req( + state, + (&(*input) + .extmem_req_msg_extmem_get_capabilities_req_m)))) + : false))))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 9)))); + + log_result(state, res, __func__); + return res; } -int cbor_encode_extmem_req(uint8_t *payload, size_t payload_len, const struct extmem_req *input, - size_t *payload_len_out) -{ - zcbor_state_t states[4]; +int cbor_encode_extmem_req(uint8_t *payload, size_t payload_len, + const struct extmem_req *input, + size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_extmem_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_extmem_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_encode_extmem_rsp(uint8_t *payload, size_t payload_len, const struct extmem_rsp *input, - size_t *payload_len_out) -{ - zcbor_state_t states[4]; +int cbor_encode_extmem_rsp(uint8_t *payload, size_t payload_len, + const struct extmem_rsp *input, + size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_extmem_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_extmem_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_encode_extmem_nfy(uint8_t *payload, size_t payload_len, const struct extmem_nfy *input, - size_t *payload_len_out) -{ - zcbor_state_t states[4]; +int cbor_encode_extmem_nfy(uint8_t *payload, size_t payload_len, + const struct extmem_nfy *input, + size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_extmem_nfy, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_extmem_nfy, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.h b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.h index 689b5f1087fd..55441cd0bb5e 100644 --- a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.h +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,28 +13,32 @@ #ifndef EXTMEM_SERVICE_ENCODE_H__ #define EXTMEM_SERVICE_ENCODE_H__ -#include +#include "extmem_service_types.h" #include #include +#include #include -#include "extmem_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -int cbor_encode_extmem_req(uint8_t *payload, size_t payload_len, const struct extmem_req *input, - size_t *payload_len_out); +int cbor_encode_extmem_req(uint8_t *payload, size_t payload_len, + const struct extmem_req *input, + size_t *payload_len_out); -int cbor_encode_extmem_rsp(uint8_t *payload, size_t payload_len, const struct extmem_rsp *input, - size_t *payload_len_out); +int cbor_encode_extmem_rsp(uint8_t *payload, size_t payload_len, + const struct extmem_rsp *input, + size_t *payload_len_out); -int cbor_encode_extmem_nfy(uint8_t *payload, size_t payload_len, const struct extmem_nfy *input, - size_t *payload_len_out); +int cbor_encode_extmem_nfy(uint8_t *payload, size_t payload_len, + const struct extmem_nfy *input, + size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_types.h b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_types.h index adaa70c696a6..074260018c2f 100644 --- a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_types.h +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_types.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,9 +13,9 @@ #ifndef EXTMEM_SERVICE_TYPES_H__ #define EXTMEM_SERVICE_TYPES_H__ -#include #include #include +#include #ifdef __cplusplus extern "C" { @@ -31,101 +31,105 @@ extern "C" { #define DEFAULT_MAX_QTY 3 struct extmem_read_done_req { - uint32_t extmem_read_done_req_request_id; - uint32_t extmem_read_done_req_error; - uint32_t extmem_read_done_req_addr; + uint32_t extmem_read_done_req_request_id; + uint32_t extmem_read_done_req_error; + uint32_t extmem_read_done_req_addr; }; struct extmem_write_setup_req { - uint32_t extmem_write_setup_req_request_id; - uint32_t extmem_write_setup_req_error; - uint32_t extmem_write_setup_req_addr; + uint32_t extmem_write_setup_req_request_id; + uint32_t extmem_write_setup_req_error; + uint32_t extmem_write_setup_req_addr; }; struct extmem_write_done_req { - uint32_t extmem_write_done_req_request_id; - uint32_t extmem_write_done_req_error; + uint32_t extmem_write_done_req_request_id; + uint32_t extmem_write_done_req_error; }; struct extmem_erase_done_req { - uint32_t extmem_erase_done_req_request_id; - uint32_t extmem_erase_done_req_error; + uint32_t extmem_erase_done_req_request_id; + uint32_t extmem_erase_done_req_error; }; struct extmem_get_capabilities_req { - uint32_t extmem_get_capabilities_req_request_id; - uint32_t extmem_get_capabilities_req_error; - uint32_t extmem_get_capabilities_req_base_addr; - uint32_t extmem_get_capabilities_req_capacity; - uint32_t extmem_get_capabilities_req_erase_size; - uint32_t extmem_get_capabilities_req_write_size; - uint32_t extmem_get_capabilities_req_chunk_size; - bool extmem_get_capabilities_req_memory_mapped; + uint32_t extmem_get_capabilities_req_request_id; + uint32_t extmem_get_capabilities_req_error; + uint32_t extmem_get_capabilities_req_base_addr; + uint32_t extmem_get_capabilities_req_capacity; + uint32_t extmem_get_capabilities_req_erase_size; + uint32_t extmem_get_capabilities_req_write_size; + uint32_t extmem_get_capabilities_req_chunk_size; + bool extmem_get_capabilities_req_memory_mapped; }; struct extmem_req { - union { - struct extmem_read_done_req extmem_req_msg_extmem_read_done_req_m; - struct extmem_write_setup_req extmem_req_msg_extmem_write_setup_req_m; - struct extmem_write_done_req extmem_req_msg_extmem_write_done_req_m; - struct extmem_erase_done_req extmem_req_msg_extmem_erase_done_req_m; - struct extmem_get_capabilities_req extmem_req_msg_extmem_get_capabilities_req_m; - }; - enum { - extmem_req_msg_extmem_read_done_req_m_c, - extmem_req_msg_extmem_write_setup_req_m_c, - extmem_req_msg_extmem_write_done_req_m_c, - extmem_req_msg_extmem_erase_done_req_m_c, - extmem_req_msg_extmem_get_capabilities_req_m_c, - } extmem_req_msg_choice; + union { + struct extmem_read_done_req extmem_req_msg_extmem_read_done_req_m; + struct extmem_write_setup_req extmem_req_msg_extmem_write_setup_req_m; + struct extmem_write_done_req extmem_req_msg_extmem_write_done_req_m; + struct extmem_erase_done_req extmem_req_msg_extmem_erase_done_req_m; + struct extmem_get_capabilities_req + extmem_req_msg_extmem_get_capabilities_req_m; + }; + enum { + extmem_req_msg_extmem_read_done_req_m_c, + extmem_req_msg_extmem_write_setup_req_m_c, + extmem_req_msg_extmem_write_done_req_m_c, + extmem_req_msg_extmem_erase_done_req_m_c, + extmem_req_msg_extmem_get_capabilities_req_m_c, + } extmem_req_msg_choice; }; struct extmem_rsp { - enum { - extmem_rsp_msg_extmem_read_done_rsp_m_c = 1, - extmem_rsp_msg_extmem_write_setup_rsp_m_c = 3, - extmem_rsp_msg_extmem_write_done_rsp_m_c = 5, - extmem_rsp_msg_extmem_erase_done_rsp_m_c = 7, - extmem_rsp_msg_extmem_get_capabilities_rsp_m_c = 9, - } extmem_rsp_msg_choice; + enum { + extmem_rsp_msg_extmem_read_done_rsp_m_c = 1, + extmem_rsp_msg_extmem_write_setup_rsp_m_c = 3, + extmem_rsp_msg_extmem_write_done_rsp_m_c = 5, + extmem_rsp_msg_extmem_erase_done_rsp_m_c = 7, + extmem_rsp_msg_extmem_get_capabilities_rsp_m_c = 9, + } extmem_rsp_msg_choice; }; struct extmem_read_pending_notify { - uint32_t extmem_read_pending_notify_request_id; - uint32_t extmem_read_pending_notify_offset; - uint32_t extmem_read_pending_notify_size; + uint32_t extmem_read_pending_notify_request_id; + uint32_t extmem_read_pending_notify_offset; + uint32_t extmem_read_pending_notify_size; }; struct extmem_write_pending_notify { - uint32_t extmem_write_pending_notify_request_id; - uint32_t extmem_write_pending_notify_offset; - uint32_t extmem_write_pending_notify_size; + uint32_t extmem_write_pending_notify_request_id; + uint32_t extmem_write_pending_notify_offset; + uint32_t extmem_write_pending_notify_size; }; struct extmem_erase_pending_notify { - uint32_t extmem_erase_pending_notify_request_id; - uint32_t extmem_erase_pending_notify_offset; - uint32_t extmem_erase_pending_notify_size; + uint32_t extmem_erase_pending_notify_request_id; + uint32_t extmem_erase_pending_notify_offset; + uint32_t extmem_erase_pending_notify_size; }; struct extmem_get_capabilities_notify_pending { - uint32_t extmem_get_capabilities_notify_pending_request_id; + uint32_t extmem_get_capabilities_notify_pending_request_id; }; struct extmem_nfy { - union { - struct extmem_read_pending_notify extmem_nfy_msg_extmem_read_pending_notify_m; - struct extmem_write_pending_notify extmem_nfy_msg_extmem_write_pending_notify_m; - struct extmem_erase_pending_notify extmem_nfy_msg_extmem_erase_pending_notify_m; - struct extmem_get_capabilities_notify_pending - extmem_nfy_msg_extmem_get_capabilities_notify_pending_m; - }; - enum { - extmem_nfy_msg_extmem_read_pending_notify_m_c, - extmem_nfy_msg_extmem_write_pending_notify_m_c, - extmem_nfy_msg_extmem_erase_pending_notify_m_c, - extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c, - } extmem_nfy_msg_choice; + union { + struct extmem_read_pending_notify + extmem_nfy_msg_extmem_read_pending_notify_m; + struct extmem_write_pending_notify + extmem_nfy_msg_extmem_write_pending_notify_m; + struct extmem_erase_pending_notify + extmem_nfy_msg_extmem_erase_pending_notify_m; + struct extmem_get_capabilities_notify_pending + extmem_nfy_msg_extmem_get_capabilities_notify_pending_m; + }; + enum { + extmem_nfy_msg_extmem_read_pending_notify_m_c, + extmem_nfy_msg_extmem_write_pending_notify_m_c, + extmem_nfy_msg_extmem_erase_pending_notify_m_c, + extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c, + } extmem_nfy_msg_choice; }; #ifdef __cplusplus diff --git a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/CMakeLists.txt index 474cb6a9151e..050146567de0 100644 --- a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/CMakeLists.txt +++ b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Nordic Semiconductor +# Copyright (c) 2024 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # diff --git a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_decode.c b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_decode.c index 7a6b93d67ee9..cfae4ef9110b 100644 --- a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_decode.c +++ b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_decode.c @@ -5,2470 +5,2188 @@ */ /* - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "psa_crypto_service_decode.h" +#include "zcbor_decode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_decode.h" -#include "psa_crypto_service_decode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + static bool decode_ptr_attr(zcbor_state_t *state, uint32_t *result); -static bool decode_psa_get_key_attributes_req(zcbor_state_t *state, - struct psa_get_key_attributes_req *result); -static bool decode_psa_reset_key_attributes_req(zcbor_state_t *state, - struct psa_reset_key_attributes_req *result); -static bool decode_psa_purge_key_req(zcbor_state_t *state, struct psa_purge_key_req *result); +static bool +decode_psa_get_key_attributes_req(zcbor_state_t *state, + struct psa_get_key_attributes_req *result); +static bool decode_psa_reset_key_attributes_req( + zcbor_state_t *state, struct psa_reset_key_attributes_req *result); +static bool decode_psa_purge_key_req(zcbor_state_t *state, + struct psa_purge_key_req *result); static bool decode_ptr_key(zcbor_state_t *state, uint32_t *result); -static bool decode_psa_copy_key_req(zcbor_state_t *state, struct psa_copy_key_req *result); -static bool decode_psa_destroy_key_req(zcbor_state_t *state, struct psa_destroy_key_req *result); +static bool decode_psa_copy_key_req(zcbor_state_t *state, + struct psa_copy_key_req *result); +static bool decode_psa_destroy_key_req(zcbor_state_t *state, + struct psa_destroy_key_req *result); static bool decode_ptr_buf(zcbor_state_t *state, uint32_t *result); static bool decode_buf_len(zcbor_state_t *state, uint32_t *result); -static bool decode_psa_import_key_req(zcbor_state_t *state, struct psa_import_key_req *result); +static bool decode_psa_import_key_req(zcbor_state_t *state, + struct psa_import_key_req *result); static bool decode_ptr_uint(zcbor_state_t *state, uint32_t *result); -static bool decode_psa_export_key_req(zcbor_state_t *state, struct psa_export_key_req *result); -static bool decode_psa_export_public_key_req(zcbor_state_t *state, - struct psa_export_public_key_req *result); -static bool decode_psa_hash_compute_req(zcbor_state_t *state, struct psa_hash_compute_req *result); -static bool decode_psa_hash_compare_req(zcbor_state_t *state, struct psa_hash_compare_req *result); -static bool decode_psa_hash_setup_req(zcbor_state_t *state, struct psa_hash_setup_req *result); -static bool decode_psa_hash_update_req(zcbor_state_t *state, struct psa_hash_update_req *result); -static bool decode_psa_hash_finish_req(zcbor_state_t *state, struct psa_hash_finish_req *result); -static bool decode_psa_hash_verify_req(zcbor_state_t *state, struct psa_hash_verify_req *result); -static bool decode_psa_hash_abort_req(zcbor_state_t *state, struct psa_hash_abort_req *result); -static bool decode_psa_hash_clone_req(zcbor_state_t *state, struct psa_hash_clone_req *result); -static bool decode_psa_mac_compute_req(zcbor_state_t *state, struct psa_mac_compute_req *result); -static bool decode_psa_mac_verify_req(zcbor_state_t *state, struct psa_mac_verify_req *result); -static bool decode_psa_mac_sign_setup_req(zcbor_state_t *state, - struct psa_mac_sign_setup_req *result); -static bool decode_psa_mac_verify_setup_req(zcbor_state_t *state, - struct psa_mac_verify_setup_req *result); -static bool decode_psa_mac_update_req(zcbor_state_t *state, struct psa_mac_update_req *result); -static bool decode_psa_mac_sign_finish_req(zcbor_state_t *state, - struct psa_mac_sign_finish_req *result); -static bool decode_psa_mac_verify_finish_req(zcbor_state_t *state, - struct psa_mac_verify_finish_req *result); -static bool decode_psa_mac_abort_req(zcbor_state_t *state, struct psa_mac_abort_req *result); -static bool decode_psa_cipher_encrypt_req(zcbor_state_t *state, - struct psa_cipher_encrypt_req *result); -static bool decode_psa_cipher_decrypt_req(zcbor_state_t *state, - struct psa_cipher_decrypt_req *result); -static bool decode_psa_cipher_encrypt_setup_req(zcbor_state_t *state, - struct psa_cipher_encrypt_setup_req *result); -static bool decode_psa_cipher_decrypt_setup_req(zcbor_state_t *state, - struct psa_cipher_decrypt_setup_req *result); -static bool decode_psa_cipher_generate_iv_req(zcbor_state_t *state, - struct psa_cipher_generate_iv_req *result); +static bool decode_psa_export_key_req(zcbor_state_t *state, + struct psa_export_key_req *result); +static bool +decode_psa_export_public_key_req(zcbor_state_t *state, + struct psa_export_public_key_req *result); +static bool decode_psa_hash_compute_req(zcbor_state_t *state, + struct psa_hash_compute_req *result); +static bool decode_psa_hash_compare_req(zcbor_state_t *state, + struct psa_hash_compare_req *result); +static bool decode_psa_hash_setup_req(zcbor_state_t *state, + struct psa_hash_setup_req *result); +static bool decode_psa_hash_update_req(zcbor_state_t *state, + struct psa_hash_update_req *result); +static bool decode_psa_hash_finish_req(zcbor_state_t *state, + struct psa_hash_finish_req *result); +static bool decode_psa_hash_verify_req(zcbor_state_t *state, + struct psa_hash_verify_req *result); +static bool decode_psa_hash_abort_req(zcbor_state_t *state, + struct psa_hash_abort_req *result); +static bool decode_psa_hash_clone_req(zcbor_state_t *state, + struct psa_hash_clone_req *result); +static bool decode_psa_mac_compute_req(zcbor_state_t *state, + struct psa_mac_compute_req *result); +static bool decode_psa_mac_verify_req(zcbor_state_t *state, + struct psa_mac_verify_req *result); +static bool +decode_psa_mac_sign_setup_req(zcbor_state_t *state, + struct psa_mac_sign_setup_req *result); +static bool +decode_psa_mac_verify_setup_req(zcbor_state_t *state, + struct psa_mac_verify_setup_req *result); +static bool decode_psa_mac_update_req(zcbor_state_t *state, + struct psa_mac_update_req *result); +static bool +decode_psa_mac_sign_finish_req(zcbor_state_t *state, + struct psa_mac_sign_finish_req *result); +static bool +decode_psa_mac_verify_finish_req(zcbor_state_t *state, + struct psa_mac_verify_finish_req *result); +static bool decode_psa_mac_abort_req(zcbor_state_t *state, + struct psa_mac_abort_req *result); +static bool +decode_psa_cipher_encrypt_req(zcbor_state_t *state, + struct psa_cipher_encrypt_req *result); +static bool +decode_psa_cipher_decrypt_req(zcbor_state_t *state, + struct psa_cipher_decrypt_req *result); +static bool decode_psa_cipher_encrypt_setup_req( + zcbor_state_t *state, struct psa_cipher_encrypt_setup_req *result); +static bool decode_psa_cipher_decrypt_setup_req( + zcbor_state_t *state, struct psa_cipher_decrypt_setup_req *result); +static bool +decode_psa_cipher_generate_iv_req(zcbor_state_t *state, + struct psa_cipher_generate_iv_req *result); static bool decode_psa_cipher_set_iv_req(zcbor_state_t *state, - struct psa_cipher_set_iv_req *result); + struct psa_cipher_set_iv_req *result); static bool decode_psa_cipher_update_req(zcbor_state_t *state, - struct psa_cipher_update_req *result); + struct psa_cipher_update_req *result); static bool decode_psa_cipher_finish_req(zcbor_state_t *state, - struct psa_cipher_finish_req *result); -static bool decode_psa_cipher_abort_req(zcbor_state_t *state, struct psa_cipher_abort_req *result); -static bool decode_psa_aead_encrypt_req(zcbor_state_t *state, struct psa_aead_encrypt_req *result); -static bool decode_psa_aead_decrypt_req(zcbor_state_t *state, struct psa_aead_decrypt_req *result); -static bool decode_psa_aead_encrypt_setup_req(zcbor_state_t *state, - struct psa_aead_encrypt_setup_req *result); -static bool decode_psa_aead_decrypt_setup_req(zcbor_state_t *state, - struct psa_aead_decrypt_setup_req *result); -static bool decode_psa_aead_generate_nonce_req(zcbor_state_t *state, - struct psa_aead_generate_nonce_req *result); -static bool decode_psa_aead_set_nonce_req(zcbor_state_t *state, - struct psa_aead_set_nonce_req *result); -static bool decode_psa_aead_set_lengths_req(zcbor_state_t *state, - struct psa_aead_set_lengths_req *result); -static bool decode_psa_aead_update_ad_req(zcbor_state_t *state, - struct psa_aead_update_ad_req *result); -static bool decode_psa_aead_update_req(zcbor_state_t *state, struct psa_aead_update_req *result); -static bool decode_psa_aead_finish_req(zcbor_state_t *state, struct psa_aead_finish_req *result); -static bool decode_psa_aead_verify_req(zcbor_state_t *state, struct psa_aead_verify_req *result); -static bool decode_psa_aead_abort_req(zcbor_state_t *state, struct psa_aead_abort_req *result); -static bool decode_psa_sign_message_req(zcbor_state_t *state, struct psa_sign_message_req *result); -static bool decode_psa_verify_message_req(zcbor_state_t *state, - struct psa_verify_message_req *result); -static bool decode_psa_sign_hash_req(zcbor_state_t *state, struct psa_sign_hash_req *result); -static bool decode_psa_verify_hash_req(zcbor_state_t *state, struct psa_verify_hash_req *result); -static bool decode_psa_asymmetric_encrypt_req(zcbor_state_t *state, - struct psa_asymmetric_encrypt_req *result); -static bool decode_psa_asymmetric_decrypt_req(zcbor_state_t *state, - struct psa_asymmetric_decrypt_req *result); -static bool decode_psa_key_derivation_setup_req(zcbor_state_t *state, - struct psa_key_derivation_setup_req *result); + struct psa_cipher_finish_req *result); +static bool decode_psa_cipher_abort_req(zcbor_state_t *state, + struct psa_cipher_abort_req *result); +static bool decode_psa_aead_encrypt_req(zcbor_state_t *state, + struct psa_aead_encrypt_req *result); +static bool decode_psa_aead_decrypt_req(zcbor_state_t *state, + struct psa_aead_decrypt_req *result); +static bool +decode_psa_aead_encrypt_setup_req(zcbor_state_t *state, + struct psa_aead_encrypt_setup_req *result); +static bool +decode_psa_aead_decrypt_setup_req(zcbor_state_t *state, + struct psa_aead_decrypt_setup_req *result); static bool -decode_psa_key_derivation_get_capacity_req(zcbor_state_t *state, - struct psa_key_derivation_get_capacity_req *result); +decode_psa_aead_generate_nonce_req(zcbor_state_t *state, + struct psa_aead_generate_nonce_req *result); static bool -decode_psa_key_derivation_set_capacity_req(zcbor_state_t *state, - struct psa_key_derivation_set_capacity_req *result); +decode_psa_aead_set_nonce_req(zcbor_state_t *state, + struct psa_aead_set_nonce_req *result); static bool -decode_psa_key_derivation_input_bytes_req(zcbor_state_t *state, - struct psa_key_derivation_input_bytes_req *result); +decode_psa_aead_set_lengths_req(zcbor_state_t *state, + struct psa_aead_set_lengths_req *result); static bool -decode_psa_key_derivation_input_integer_req(zcbor_state_t *state, - struct psa_key_derivation_input_integer_req *result); +decode_psa_aead_update_ad_req(zcbor_state_t *state, + struct psa_aead_update_ad_req *result); +static bool decode_psa_aead_update_req(zcbor_state_t *state, + struct psa_aead_update_req *result); +static bool decode_psa_aead_finish_req(zcbor_state_t *state, + struct psa_aead_finish_req *result); +static bool decode_psa_aead_verify_req(zcbor_state_t *state, + struct psa_aead_verify_req *result); +static bool decode_psa_aead_abort_req(zcbor_state_t *state, + struct psa_aead_abort_req *result); +static bool decode_psa_sign_message_req(zcbor_state_t *state, + struct psa_sign_message_req *result); static bool -decode_psa_key_derivation_input_key_req(zcbor_state_t *state, - struct psa_key_derivation_input_key_req *result); +decode_psa_verify_message_req(zcbor_state_t *state, + struct psa_verify_message_req *result); +static bool decode_psa_sign_hash_req(zcbor_state_t *state, + struct psa_sign_hash_req *result); +static bool decode_psa_verify_hash_req(zcbor_state_t *state, + struct psa_verify_hash_req *result); static bool -decode_psa_key_derivation_key_agreement_req(zcbor_state_t *state, - struct psa_key_derivation_key_agreement_req *result); +decode_psa_asymmetric_encrypt_req(zcbor_state_t *state, + struct psa_asymmetric_encrypt_req *result); static bool -decode_psa_key_derivation_output_bytes_req(zcbor_state_t *state, - struct psa_key_derivation_output_bytes_req *result); +decode_psa_asymmetric_decrypt_req(zcbor_state_t *state, + struct psa_asymmetric_decrypt_req *result); +static bool decode_psa_key_derivation_setup_req( + zcbor_state_t *state, struct psa_key_derivation_setup_req *result); +static bool decode_psa_key_derivation_get_capacity_req( + zcbor_state_t *state, struct psa_key_derivation_get_capacity_req *result); +static bool decode_psa_key_derivation_set_capacity_req( + zcbor_state_t *state, struct psa_key_derivation_set_capacity_req *result); +static bool decode_psa_key_derivation_input_bytes_req( + zcbor_state_t *state, struct psa_key_derivation_input_bytes_req *result); +static bool decode_psa_key_derivation_input_integer_req( + zcbor_state_t *state, struct psa_key_derivation_input_integer_req *result); +static bool decode_psa_key_derivation_input_key_req( + zcbor_state_t *state, struct psa_key_derivation_input_key_req *result); +static bool decode_psa_key_derivation_key_agreement_req( + zcbor_state_t *state, struct psa_key_derivation_key_agreement_req *result); +static bool decode_psa_key_derivation_output_bytes_req( + zcbor_state_t *state, struct psa_key_derivation_output_bytes_req *result); +static bool decode_psa_key_derivation_output_key_req( + zcbor_state_t *state, struct psa_key_derivation_output_key_req *result); +static bool decode_psa_key_derivation_abort_req( + zcbor_state_t *state, struct psa_key_derivation_abort_req *result); static bool -decode_psa_key_derivation_output_key_req(zcbor_state_t *state, - struct psa_key_derivation_output_key_req *result); -static bool decode_psa_key_derivation_abort_req(zcbor_state_t *state, - struct psa_key_derivation_abort_req *result); -static bool decode_psa_raw_key_agreement_req(zcbor_state_t *state, - struct psa_raw_key_agreement_req *result); -static bool decode_psa_generate_random_req(zcbor_state_t *state, - struct psa_generate_random_req *result); -static bool decode_psa_generate_key_req(zcbor_state_t *state, struct psa_generate_key_req *result); +decode_psa_raw_key_agreement_req(zcbor_state_t *state, + struct psa_raw_key_agreement_req *result); +static bool +decode_psa_generate_random_req(zcbor_state_t *state, + struct psa_generate_random_req *result); +static bool decode_psa_generate_key_req(zcbor_state_t *state, + struct psa_generate_key_req *result); static bool decode_ptr_cipher(zcbor_state_t *state, uint32_t *result); -static bool decode_psa_pake_setup_req(zcbor_state_t *state, struct psa_pake_setup_req *result); +static bool decode_psa_pake_setup_req(zcbor_state_t *state, + struct psa_pake_setup_req *result); static bool decode_psa_pake_set_role_req(zcbor_state_t *state, - struct psa_pake_set_role_req *result); + struct psa_pake_set_role_req *result); static bool decode_psa_pake_set_user_req(zcbor_state_t *state, - struct psa_pake_set_user_req *result); + struct psa_pake_set_user_req *result); static bool decode_psa_pake_set_peer_req(zcbor_state_t *state, - struct psa_pake_set_peer_req *result); -static bool decode_psa_pake_set_context_req(zcbor_state_t *state, - struct psa_pake_set_context_req *result); -static bool decode_psa_pake_output_req(zcbor_state_t *state, struct psa_pake_output_req *result); -static bool decode_psa_pake_input_req(zcbor_state_t *state, struct psa_pake_input_req *result); -static bool decode_psa_pake_get_shared_key_req(zcbor_state_t *state, - struct psa_pake_get_shared_key_req *result); -static bool decode_psa_pake_abort_req(zcbor_state_t *state, struct psa_pake_abort_req *result); -static bool decode_psa_crypto_rsp(zcbor_state_t *state, struct psa_crypto_rsp *result); -static bool decode_psa_crypto_req(zcbor_state_t *state, struct psa_crypto_req *result); + struct psa_pake_set_peer_req *result); +static bool +decode_psa_pake_set_context_req(zcbor_state_t *state, + struct psa_pake_set_context_req *result); +static bool decode_psa_pake_output_req(zcbor_state_t *state, + struct psa_pake_output_req *result); +static bool decode_psa_pake_input_req(zcbor_state_t *state, + struct psa_pake_input_req *result); +static bool +decode_psa_pake_get_shared_key_req(zcbor_state_t *state, + struct psa_pake_get_shared_key_req *result); +static bool decode_psa_pake_abort_req(zcbor_state_t *state, + struct psa_pake_abort_req *result); +static bool decode_psa_crypto_rsp(zcbor_state_t *state, + struct psa_crypto_rsp *result); +static bool decode_psa_crypto_req(zcbor_state_t *state, + struct psa_crypto_req *result); + +static bool decode_ptr_attr(zcbor_state_t *state, uint32_t *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((zcbor_tag_expect(state, 32772) && + (zcbor_uint32_decode(state, (&(*result)))))); + + log_result(state, res, __func__); + return res; +} + +static bool +decode_psa_get_key_attributes_req(zcbor_state_t *state, + struct psa_get_key_attributes_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (11)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_get_key_attributes_req_key)))) && + ((decode_ptr_attr( + state, (&(*result).psa_get_key_attributes_req_p_attributes))))))); + + log_result(state, res, __func__); + return res; +} -static bool decode_ptr_attr(zcbor_state_t *state, uint32_t *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_reset_key_attributes_req( + zcbor_state_t *state, struct psa_reset_key_attributes_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - ((zcbor_tag_expect(state, 32772) && (zcbor_uint32_decode(state, (&(*result)))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (( + (((zcbor_uint32_expect(state, (12)))) && + ((decode_ptr_attr( + state, (&(*result).psa_reset_key_attributes_req_p_attributes))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_get_key_attributes_req(zcbor_state_t *state, - struct psa_get_key_attributes_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_purge_key_req(zcbor_state_t *state, + struct psa_purge_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (13)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_purge_key_req_key))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (11)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_get_key_attributes_req_key)))) && - ((decode_ptr_attr(state, (&(*result).psa_get_key_attributes_req_p_attributes))))))); +static bool decode_ptr_key(zcbor_state_t *state, uint32_t *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((zcbor_tag_expect(state, 32773) && + (zcbor_uint32_decode(state, (&(*result)))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_reset_key_attributes_req(zcbor_state_t *state, - struct psa_reset_key_attributes_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_copy_key_req(zcbor_state_t *state, + struct psa_copy_key_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_expect(state, (12)))) && - ((decode_ptr_attr(state, - (&(*result).psa_reset_key_attributes_req_p_attributes))))))); + bool res = (( + (((zcbor_uint32_expect(state, (14)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_copy_key_req_source_key)))) && + ((decode_ptr_attr(state, (&(*result).psa_copy_key_req_p_attributes)))) && + ((decode_ptr_key(state, (&(*result).psa_copy_key_req_p_target_key))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_destroy_key_req(zcbor_state_t *state, + struct psa_destroy_key_req *result) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = (( + (((zcbor_uint32_expect(state, (15)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_destroy_key_req_key))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_psa_purge_key_req(zcbor_state_t *state, struct psa_purge_key_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_ptr_buf(zcbor_state_t *state, uint32_t *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((zcbor_tag_expect(state, 32770) && + (zcbor_uint32_decode(state, (&(*result)))))); - bool tmp_result = (((((zcbor_uint32_expect(state, (13)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_purge_key_req_key))))))); + log_result(state, res, __func__); + return res; +} + +static bool decode_buf_len(zcbor_state_t *state, uint32_t *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((zcbor_tag_expect(state, 32771) && + (zcbor_uint32_decode(state, (&(*result)))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_ptr_key(zcbor_state_t *state, uint32_t *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_import_key_req(zcbor_state_t *state, + struct psa_import_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (16)))) && + ((decode_ptr_attr(state, + (&(*result).psa_import_key_req_p_attributes)))) && + ((decode_ptr_buf(state, (&(*result).psa_import_key_req_p_data)))) && + ((decode_buf_len(state, (&(*result).psa_import_key_req_data_length)))) && + ((decode_ptr_key(state, (&(*result).psa_import_key_req_p_key))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - ((zcbor_tag_expect(state, 32773) && (zcbor_uint32_decode(state, (&(*result)))))); +static bool decode_ptr_uint(zcbor_state_t *state, uint32_t *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((zcbor_tag_expect(state, 32774) && + (zcbor_uint32_decode(state, (&(*result)))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_copy_key_req(zcbor_state_t *state, struct psa_copy_key_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_export_key_req(zcbor_state_t *state, + struct psa_export_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (17)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_export_key_req_key)))) && + ((decode_ptr_buf(state, (&(*result).psa_export_key_req_p_data)))) && + ((decode_buf_len(state, (&(*result).psa_export_key_req_data_size)))) && + ((decode_ptr_uint(state, + (&(*result).psa_export_key_req_p_data_length))))))); - bool tmp_result = - (((((zcbor_uint32_expect(state, (14)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_copy_key_req_source_key)))) && - ((decode_ptr_attr(state, (&(*result).psa_copy_key_req_p_attributes)))) && - ((decode_ptr_key(state, (&(*result).psa_copy_key_req_p_target_key))))))); + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool +decode_psa_export_public_key_req(zcbor_state_t *state, + struct psa_export_public_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (18)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_export_public_key_req_key)))) && + ((decode_ptr_buf(state, + (&(*result).psa_export_public_key_req_p_data)))) && + ((decode_buf_len(state, + (&(*result).psa_export_public_key_req_data_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_export_public_key_req_p_data_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_hash_compute_req(zcbor_state_t *state, + struct psa_hash_compute_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (19)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_hash_compute_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_hash_compute_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_hash_compute_req_input_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_hash_compute_req_p_hash)))) && + ((decode_buf_len(state, (&(*result).psa_hash_compute_req_hash_size)))) && + ((decode_ptr_uint(state, + (&(*result).psa_hash_compute_req_p_hash_length))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_psa_destroy_key_req(zcbor_state_t *state, struct psa_destroy_key_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_hash_compare_req(zcbor_state_t *state, + struct psa_hash_compare_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (20)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_hash_compare_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_hash_compare_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_hash_compare_req_input_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_hash_compare_req_p_hash)))) && + ((decode_buf_len(state, + (&(*result).psa_hash_compare_req_hash_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_hash_setup_req(zcbor_state_t *state, + struct psa_hash_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (21)))) && + ((decode_ptr_uint(state, (&(*result).psa_hash_setup_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_hash_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_hash_update_req(zcbor_state_t *state, + struct psa_hash_update_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (22)))) && + ((decode_ptr_uint(state, (&(*result).psa_hash_update_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_hash_update_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_hash_update_req_input_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_hash_finish_req(zcbor_state_t *state, + struct psa_hash_finish_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (23)))) && + ((decode_ptr_uint(state, (&(*result).psa_hash_finish_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_hash_finish_req_p_hash)))) && + ((decode_buf_len(state, (&(*result).psa_hash_finish_req_hash_size)))) && + ((decode_ptr_uint(state, + (&(*result).psa_hash_finish_req_p_hash_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_hash_verify_req(zcbor_state_t *state, + struct psa_hash_verify_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (24)))) && + ((decode_ptr_uint(state, (&(*result).psa_hash_verify_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_hash_verify_req_p_hash)))) && + ((decode_buf_len(state, + (&(*result).psa_hash_verify_req_hash_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_expect(state, (15)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_destroy_key_req_key))))))); +static bool decode_psa_hash_abort_req(zcbor_state_t *state, + struct psa_hash_abort_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (( + (((zcbor_uint32_expect(state, (25)))) && + ((decode_ptr_uint(state, (&(*result).psa_hash_abort_req_p_handle))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_ptr_buf(zcbor_state_t *state, uint32_t *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_hash_clone_req(zcbor_state_t *state, + struct psa_hash_clone_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (26)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_hash_clone_req_handle)))) && + ((decode_ptr_uint(state, (&(*result).psa_hash_clone_req_p_handle))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - ((zcbor_tag_expect(state, 32770) && (zcbor_uint32_decode(state, (&(*result)))))); +static bool decode_psa_mac_compute_req(zcbor_state_t *state, + struct psa_mac_compute_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_expect(state, (27)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_mac_compute_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_mac_compute_req_input_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_mac_compute_req_p_mac)))) && + ((decode_buf_len(state, (&(*result).psa_mac_compute_req_mac_size)))) && + ((decode_ptr_uint(state, + (&(*result).psa_mac_compute_req_p_mac_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_buf_len(zcbor_state_t *state, uint32_t *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_mac_verify_req(zcbor_state_t *state, + struct psa_mac_verify_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - ((zcbor_tag_expect(state, 32771) && (zcbor_uint32_decode(state, (&(*result)))))); + bool res = ((( + ((zcbor_uint32_expect(state, (28)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_mac_verify_req_p_input)))) && + ((decode_buf_len(state, (&(*result).psa_mac_verify_req_input_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_mac_verify_req_p_mac)))) && + ((decode_buf_len(state, (&(*result).psa_mac_verify_req_mac_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +decode_psa_mac_sign_setup_req(zcbor_state_t *state, + struct psa_mac_sign_setup_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_expect(state, (29)))) && + ((decode_ptr_uint(state, + (&(*result).psa_mac_sign_setup_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_sign_setup_req_key)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_sign_setup_req_alg))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_import_key_req(zcbor_state_t *state, struct psa_import_key_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool +decode_psa_mac_verify_setup_req(zcbor_state_t *state, + struct psa_mac_verify_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (30)))) && + ((decode_ptr_uint(state, + (&(*result).psa_mac_verify_setup_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_verify_setup_req_key)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_verify_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_expect(state, (16)))) && - ((decode_ptr_attr(state, (&(*result).psa_import_key_req_p_attributes)))) && - ((decode_ptr_buf(state, (&(*result).psa_import_key_req_p_data)))) && - ((decode_buf_len(state, (&(*result).psa_import_key_req_data_length)))) && - ((decode_ptr_key(state, (&(*result).psa_import_key_req_p_key))))))); +static bool decode_psa_mac_update_req(zcbor_state_t *state, + struct psa_mac_update_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_expect(state, (31)))) && + ((decode_ptr_uint(state, (&(*result).psa_mac_update_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_mac_update_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_mac_update_req_input_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_ptr_uint(zcbor_state_t *state, uint32_t *result) -{ - zcbor_log("%s\r\n", __func__); +static bool +decode_psa_mac_sign_finish_req(zcbor_state_t *state, + struct psa_mac_sign_finish_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (32)))) && + ((decode_ptr_uint(state, + (&(*result).psa_mac_sign_finish_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_mac_sign_finish_req_p_mac)))) && + ((decode_buf_len(state, + (&(*result).psa_mac_sign_finish_req_mac_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_mac_sign_finish_req_p_mac_length))))))); - bool tmp_result = - ((zcbor_tag_expect(state, 32774) && (zcbor_uint32_decode(state, (&(*result)))))); + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool +decode_psa_mac_verify_finish_req(zcbor_state_t *state, + struct psa_mac_verify_finish_req *result) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = ((( + ((zcbor_uint32_expect(state, (33)))) && + ((decode_ptr_uint(state, + (&(*result).psa_mac_verify_finish_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_mac_verify_finish_req_p_mac)))) && + ((decode_buf_len(state, + (&(*result).psa_mac_verify_finish_req_mac_length))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_psa_export_key_req(zcbor_state_t *state, struct psa_export_key_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_mac_abort_req(zcbor_state_t *state, + struct psa_mac_abort_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_expect(state, (17)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_key_req_key)))) && - ((decode_ptr_buf(state, (&(*result).psa_export_key_req_p_data)))) && - ((decode_buf_len(state, (&(*result).psa_export_key_req_data_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_export_key_req_p_data_length))))))); + bool res = + (((((zcbor_uint32_expect(state, (34)))) && + ((decode_ptr_uint(state, (&(*result).psa_mac_abort_req_p_handle))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} - return tmp_result; +static bool +decode_psa_cipher_encrypt_req(zcbor_state_t *state, + struct psa_cipher_encrypt_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (35)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_encrypt_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_encrypt_req_input_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_encrypt_req_p_output)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_encrypt_req_output_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_cipher_encrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_psa_export_public_key_req(zcbor_state_t *state, - struct psa_export_public_key_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool +decode_psa_cipher_decrypt_req(zcbor_state_t *state, + struct psa_cipher_decrypt_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (36)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_decrypt_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_decrypt_req_input_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_decrypt_req_p_output)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_decrypt_req_output_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_cipher_decrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_cipher_encrypt_setup_req( + zcbor_state_t *state, struct psa_cipher_encrypt_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (37)))) && + ((decode_ptr_uint( + state, (&(*result).psa_cipher_encrypt_setup_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_encrypt_setup_req_key)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_encrypt_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_cipher_decrypt_setup_req( + zcbor_state_t *state, struct psa_cipher_decrypt_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (38)))) && + ((decode_ptr_uint( + state, (&(*result).psa_cipher_decrypt_setup_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_decrypt_setup_req_key)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_decrypt_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (18)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_public_key_req_key)))) && - ((decode_ptr_buf(state, (&(*result).psa_export_public_key_req_p_data)))) && - ((decode_buf_len(state, (&(*result).psa_export_public_key_req_data_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_export_public_key_req_p_data_length))))))); +static bool +decode_psa_cipher_generate_iv_req(zcbor_state_t *state, + struct psa_cipher_generate_iv_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_expect(state, (39)))) && + ((decode_ptr_uint(state, + (&(*result).psa_cipher_generate_iv_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_generate_iv_req_p_iv)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_generate_iv_req_iv_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_cipher_generate_iv_req_p_iv_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_hash_compute_req(zcbor_state_t *state, struct psa_hash_compute_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (19)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compute_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_hash_compute_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_hash_compute_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_hash_compute_req_p_hash)))) && - ((decode_buf_len(state, (&(*result).psa_hash_compute_req_hash_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_hash_compute_req_p_hash_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_hash_compare_req(zcbor_state_t *state, struct psa_hash_compare_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (20)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compare_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_hash_compare_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_hash_compare_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_hash_compare_req_p_hash)))) && - ((decode_buf_len(state, (&(*result).psa_hash_compare_req_hash_length))))))); +static bool decode_psa_cipher_set_iv_req(zcbor_state_t *state, + struct psa_cipher_set_iv_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_expect(state, (40)))) && + ((decode_ptr_uint(state, (&(*result).psa_cipher_set_iv_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_set_iv_req_p_iv)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_set_iv_req_iv_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_hash_setup_req(zcbor_state_t *state, struct psa_hash_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((((zcbor_uint32_expect(state, (21)))) && - ((decode_ptr_uint(state, (&(*result).psa_hash_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_hash_update_req(zcbor_state_t *state, struct psa_hash_update_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_cipher_update_req(zcbor_state_t *state, + struct psa_cipher_update_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_expect(state, (22)))) && - ((decode_ptr_uint(state, (&(*result).psa_hash_update_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_hash_update_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_hash_update_req_input_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_hash_finish_req(zcbor_state_t *state, struct psa_hash_finish_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (23)))) && - ((decode_ptr_uint(state, (&(*result).psa_hash_finish_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_hash_finish_req_p_hash)))) && - ((decode_buf_len(state, (&(*result).psa_hash_finish_req_hash_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_hash_finish_req_p_hash_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_hash_verify_req(zcbor_state_t *state, struct psa_hash_verify_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (24)))) && - ((decode_ptr_uint(state, (&(*result).psa_hash_verify_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_hash_verify_req_p_hash)))) && - ((decode_buf_len(state, (&(*result).psa_hash_verify_req_hash_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_hash_abort_req(zcbor_state_t *state, struct psa_hash_abort_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (25)))) && - ((decode_ptr_uint(state, (&(*result).psa_hash_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + bool res = ((( + ((zcbor_uint32_expect(state, (41)))) && + ((decode_ptr_uint(state, (&(*result).psa_cipher_update_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_update_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_update_req_input_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_update_req_p_output)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_update_req_output_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_cipher_update_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_cipher_finish_req(zcbor_state_t *state, + struct psa_cipher_finish_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (42)))) && + ((decode_ptr_uint(state, (&(*result).psa_cipher_finish_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_cipher_finish_req_p_output)))) && + ((decode_buf_len(state, + (&(*result).psa_cipher_finish_req_output_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_cipher_finish_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_cipher_abort_req(zcbor_state_t *state, + struct psa_cipher_abort_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (43)))) && + ((decode_ptr_uint(state, (&(*result).psa_cipher_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_aead_encrypt_req(zcbor_state_t *state, + struct psa_aead_encrypt_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (44)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_encrypt_req_p_nonce)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_encrypt_req_nonce_length)))) && + ((decode_ptr_buf( + state, (&(*result).psa_aead_encrypt_req_p_additional_data)))) && + ((decode_buf_len( + state, (&(*result).psa_aead_encrypt_req_additional_data_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_aead_encrypt_req_p_plaintext)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_encrypt_req_plaintext_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_aead_encrypt_req_p_ciphertext)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_encrypt_req_ciphertext_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_aead_encrypt_req_p_ciphertext_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_aead_decrypt_req(zcbor_state_t *state, + struct psa_aead_decrypt_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (45)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_decrypt_req_p_nonce)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_decrypt_req_nonce_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_aead_decrypt_req_p_additional_data)))) && + ((decode_buf_len( + state, (&(*result).psa_aead_decrypt_req_additional_data_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_aead_decrypt_req_p_ciphertext)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_decrypt_req_ciphertext_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_aead_decrypt_req_p_plaintext)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_decrypt_req_plaintext_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_aead_decrypt_req_p_plaintext_length))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_psa_hash_clone_req(zcbor_state_t *state, struct psa_hash_clone_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (26)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_clone_req_handle)))) && - ((decode_ptr_uint(state, (&(*result).psa_hash_clone_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +decode_psa_aead_encrypt_setup_req(zcbor_state_t *state, + struct psa_aead_encrypt_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (46)))) && + ((decode_ptr_uint( + state, (&(*result).psa_aead_encrypt_setup_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_encrypt_setup_req_key)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_encrypt_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; } - -static bool decode_psa_mac_compute_req(zcbor_state_t *state, struct psa_mac_compute_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (27)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_mac_compute_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_mac_compute_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_mac_compute_req_p_mac)))) && - ((decode_buf_len(state, (&(*result).psa_mac_compute_req_mac_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_mac_compute_req_p_mac_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_mac_verify_req(zcbor_state_t *state, struct psa_mac_verify_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (28)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_mac_verify_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_mac_verify_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_mac_verify_req_p_mac)))) && - ((decode_buf_len(state, (&(*result).psa_mac_verify_req_mac_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_mac_sign_setup_req(zcbor_state_t *state, - struct psa_mac_sign_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (29)))) && - ((decode_ptr_uint(state, (&(*result).psa_mac_sign_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_sign_setup_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_sign_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_mac_verify_setup_req(zcbor_state_t *state, - struct psa_mac_verify_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (30)))) && - ((decode_ptr_uint(state, (&(*result).psa_mac_verify_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_setup_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_mac_update_req(zcbor_state_t *state, struct psa_mac_update_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (31)))) && - ((decode_ptr_uint(state, (&(*result).psa_mac_update_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_mac_update_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_mac_update_req_input_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_mac_sign_finish_req(zcbor_state_t *state, - struct psa_mac_sign_finish_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (32)))) && - ((decode_ptr_uint(state, (&(*result).psa_mac_sign_finish_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_mac_sign_finish_req_p_mac)))) && - ((decode_buf_len(state, (&(*result).psa_mac_sign_finish_req_mac_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_mac_sign_finish_req_p_mac_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_mac_verify_finish_req(zcbor_state_t *state, - struct psa_mac_verify_finish_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (33)))) && - ((decode_ptr_uint(state, (&(*result).psa_mac_verify_finish_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_mac_verify_finish_req_p_mac)))) && - ((decode_buf_len(state, (&(*result).psa_mac_verify_finish_req_mac_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_mac_abort_req(zcbor_state_t *state, struct psa_mac_abort_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((((zcbor_uint32_expect(state, (34)))) && - ((decode_ptr_uint(state, (&(*result).psa_mac_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_encrypt_req(zcbor_state_t *state, - struct psa_cipher_encrypt_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (35)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_encrypt_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_encrypt_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_encrypt_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_encrypt_req_output_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_encrypt_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_decrypt_req(zcbor_state_t *state, - struct psa_cipher_decrypt_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (36)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_decrypt_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_decrypt_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_decrypt_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_decrypt_req_output_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_decrypt_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_encrypt_setup_req(zcbor_state_t *state, - struct psa_cipher_encrypt_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (37)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_encrypt_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_setup_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_decrypt_setup_req(zcbor_state_t *state, - struct psa_cipher_decrypt_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (38)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_decrypt_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_setup_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_generate_iv_req(zcbor_state_t *state, - struct psa_cipher_generate_iv_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (39)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_generate_iv_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_generate_iv_req_p_iv)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_generate_iv_req_iv_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_generate_iv_req_p_iv_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_set_iv_req(zcbor_state_t *state, struct psa_cipher_set_iv_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (40)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_set_iv_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_set_iv_req_p_iv)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_set_iv_req_iv_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_update_req(zcbor_state_t *state, struct psa_cipher_update_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (41)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_update_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_update_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_update_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_update_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_update_req_output_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_update_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_finish_req(zcbor_state_t *state, struct psa_cipher_finish_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (42)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_finish_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_cipher_finish_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_cipher_finish_req_output_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_finish_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_cipher_abort_req(zcbor_state_t *state, struct psa_cipher_abort_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (43)))) && - ((decode_ptr_uint(state, (&(*result).psa_cipher_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_encrypt_req(zcbor_state_t *state, struct psa_aead_encrypt_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (44)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_encrypt_req_p_nonce)))) && - ((decode_buf_len(state, (&(*result).psa_aead_encrypt_req_nonce_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_encrypt_req_p_additional_data)))) && - ((decode_buf_len(state, - (&(*result).psa_aead_encrypt_req_additional_data_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_encrypt_req_p_plaintext)))) && - ((decode_buf_len(state, (&(*result).psa_aead_encrypt_req_plaintext_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_encrypt_req_p_ciphertext)))) && - ((decode_buf_len(state, (&(*result).psa_aead_encrypt_req_ciphertext_size)))) && - ((decode_ptr_uint(state, - (&(*result).psa_aead_encrypt_req_p_ciphertext_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_decrypt_req(zcbor_state_t *state, struct psa_aead_decrypt_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (45)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_decrypt_req_p_nonce)))) && - ((decode_buf_len(state, (&(*result).psa_aead_decrypt_req_nonce_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_decrypt_req_p_additional_data)))) && - ((decode_buf_len(state, - (&(*result).psa_aead_decrypt_req_additional_data_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_decrypt_req_p_ciphertext)))) && - ((decode_buf_len(state, (&(*result).psa_aead_decrypt_req_ciphertext_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_decrypt_req_p_plaintext)))) && - ((decode_buf_len(state, (&(*result).psa_aead_decrypt_req_plaintext_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_decrypt_req_p_plaintext_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_encrypt_setup_req(zcbor_state_t *state, - struct psa_aead_encrypt_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (46)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_encrypt_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_setup_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_decrypt_setup_req(zcbor_state_t *state, - struct psa_aead_decrypt_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (47)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_decrypt_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_setup_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_generate_nonce_req(zcbor_state_t *state, - struct psa_aead_generate_nonce_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (48)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_generate_nonce_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_generate_nonce_req_p_nonce)))) && - ((decode_buf_len(state, (&(*result).psa_aead_generate_nonce_req_nonce_size)))) && - ((decode_ptr_uint(state, - (&(*result).psa_aead_generate_nonce_req_p_nonce_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_set_nonce_req(zcbor_state_t *state, - struct psa_aead_set_nonce_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (49)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_set_nonce_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_set_nonce_req_p_nonce)))) && - ((decode_buf_len(state, (&(*result).psa_aead_set_nonce_req_nonce_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_set_lengths_req(zcbor_state_t *state, - struct psa_aead_set_lengths_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (50)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_set_lengths_req_p_handle)))) && - ((decode_buf_len(state, (&(*result).psa_aead_set_lengths_req_ad_length)))) && - ((decode_buf_len(state, - (&(*result).psa_aead_set_lengths_req_plaintext_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_update_ad_req(zcbor_state_t *state, - struct psa_aead_update_ad_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (51)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_update_ad_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_update_ad_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_aead_update_ad_req_input_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_update_req(zcbor_state_t *state, struct psa_aead_update_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (52)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_update_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_update_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_aead_update_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_update_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_aead_update_req_output_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_update_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_finish_req(zcbor_state_t *state, struct psa_aead_finish_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (53)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_finish_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_finish_req_p_ciphertext)))) && - ((decode_buf_len(state, (&(*result).psa_aead_finish_req_ciphertext_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_finish_req_p_ciphertext_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_finish_req_p_tag)))) && - ((decode_buf_len(state, (&(*result).psa_aead_finish_req_tag_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_finish_req_p_tag_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_verify_req(zcbor_state_t *state, struct psa_aead_verify_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (54)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_verify_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_verify_req_p_plaintext)))) && - ((decode_buf_len(state, (&(*result).psa_aead_verify_req_plaintext_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_verify_req_p_plaintext_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_aead_verify_req_p_tag)))) && - ((decode_buf_len(state, (&(*result).psa_aead_verify_req_tag_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_aead_abort_req(zcbor_state_t *state, struct psa_aead_abort_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (55)))) && - ((decode_ptr_uint(state, (&(*result).psa_aead_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_sign_message_req(zcbor_state_t *state, struct psa_sign_message_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (56)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_message_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_message_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_sign_message_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_sign_message_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_sign_message_req_p_signature)))) && - ((decode_buf_len(state, (&(*result).psa_sign_message_req_signature_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_sign_message_req_p_signature_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_verify_message_req(zcbor_state_t *state, - struct psa_verify_message_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (57)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_message_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_message_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_verify_message_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_verify_message_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_verify_message_req_p_signature)))) && - ((decode_buf_len(state, (&(*result).psa_verify_message_req_signature_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_sign_hash_req(zcbor_state_t *state, struct psa_sign_hash_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (58)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_sign_hash_req_p_hash)))) && - ((decode_buf_len(state, (&(*result).psa_sign_hash_req_hash_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_sign_hash_req_p_signature)))) && - ((decode_buf_len(state, (&(*result).psa_sign_hash_req_signature_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_sign_hash_req_p_signature_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_verify_hash_req(zcbor_state_t *state, struct psa_verify_hash_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (59)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_hash_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_hash_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_verify_hash_req_p_hash)))) && - ((decode_buf_len(state, (&(*result).psa_verify_hash_req_hash_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_verify_hash_req_p_signature)))) && - ((decode_buf_len(state, (&(*result).psa_verify_hash_req_signature_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_asymmetric_encrypt_req(zcbor_state_t *state, - struct psa_asymmetric_encrypt_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (60)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_encrypt_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_encrypt_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_asymmetric_encrypt_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_asymmetric_encrypt_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_asymmetric_encrypt_req_p_salt)))) && - ((decode_buf_len(state, (&(*result).psa_asymmetric_encrypt_req_salt_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_asymmetric_encrypt_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_asymmetric_encrypt_req_output_size)))) && - ((decode_ptr_uint(state, - (&(*result).psa_asymmetric_encrypt_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_asymmetric_decrypt_req(zcbor_state_t *state, - struct psa_asymmetric_decrypt_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (61)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_decrypt_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_decrypt_req_alg)))) && - ((decode_ptr_buf(state, (&(*result).psa_asymmetric_decrypt_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_asymmetric_decrypt_req_input_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_asymmetric_decrypt_req_p_salt)))) && - ((decode_buf_len(state, (&(*result).psa_asymmetric_decrypt_req_salt_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_asymmetric_decrypt_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_asymmetric_decrypt_req_output_size)))) && - ((decode_ptr_uint(state, - (&(*result).psa_asymmetric_decrypt_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_key_derivation_setup_req(zcbor_state_t *state, - struct psa_key_derivation_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (62)))) && - ((decode_ptr_uint(state, (&(*result).psa_key_derivation_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_key_derivation_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + +static bool +decode_psa_aead_decrypt_setup_req(zcbor_state_t *state, + struct psa_aead_decrypt_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (47)))) && + ((decode_ptr_uint( + state, (&(*result).psa_aead_decrypt_setup_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_decrypt_setup_req_key)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_decrypt_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; } static bool -decode_psa_key_derivation_get_capacity_req(zcbor_state_t *state, - struct psa_key_derivation_get_capacity_req *result) -{ - zcbor_log("%s\r\n", __func__); +decode_psa_aead_generate_nonce_req(zcbor_state_t *state, + struct psa_aead_generate_nonce_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_expect(state, (63)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_get_capacity_req_handle)))) && - ((decode_ptr_uint( - state, (&(*result).psa_key_derivation_get_capacity_req_p_capacity))))))); + bool res = (( + (((zcbor_uint32_expect(state, (48)))) && + ((decode_ptr_uint(state, + (&(*result).psa_aead_generate_nonce_req_p_handle)))) && + ((decode_ptr_buf(state, + (&(*result).psa_aead_generate_nonce_req_p_nonce)))) && + ((decode_buf_len( + state, (&(*result).psa_aead_generate_nonce_req_nonce_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_aead_generate_nonce_req_p_nonce_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +decode_psa_aead_set_nonce_req(zcbor_state_t *state, + struct psa_aead_set_nonce_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (( + (((zcbor_uint32_expect(state, (49)))) && + ((decode_ptr_uint(state, + (&(*result).psa_aead_set_nonce_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_set_nonce_req_p_nonce)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_set_nonce_req_nonce_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } static bool -decode_psa_key_derivation_set_capacity_req(zcbor_state_t *state, - struct psa_key_derivation_set_capacity_req *result) -{ - zcbor_log("%s\r\n", __func__); +decode_psa_aead_set_lengths_req(zcbor_state_t *state, + struct psa_aead_set_lengths_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_expect(state, (64)))) && - ((decode_ptr_uint(state, - (&(*result).psa_key_derivation_set_capacity_req_p_handle)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_set_capacity_req_capacity))))))); + bool res = (( + (((zcbor_uint32_expect(state, (50)))) && + ((decode_ptr_uint(state, + (&(*result).psa_aead_set_lengths_req_p_handle)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_set_lengths_req_ad_length)))) && + ((decode_buf_len( + state, (&(*result).psa_aead_set_lengths_req_plaintext_length))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} - return tmp_result; +static bool +decode_psa_aead_update_ad_req(zcbor_state_t *state, + struct psa_aead_update_ad_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (51)))) && + ((decode_ptr_uint(state, + (&(*result).psa_aead_update_ad_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_update_ad_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_update_ad_req_input_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_aead_update_req(zcbor_state_t *state, + struct psa_aead_update_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (52)))) && + ((decode_ptr_uint(state, (&(*result).psa_aead_update_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_update_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_update_req_input_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_update_req_p_output)))) && + ((decode_buf_len(state, (&(*result).psa_aead_update_req_output_size)))) && + ((decode_ptr_uint(state, + (&(*result).psa_aead_update_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_aead_finish_req(zcbor_state_t *state, + struct psa_aead_finish_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (53)))) && + ((decode_ptr_uint(state, (&(*result).psa_aead_finish_req_p_handle)))) && + ((decode_ptr_buf(state, + (&(*result).psa_aead_finish_req_p_ciphertext)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_finish_req_ciphertext_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_aead_finish_req_p_ciphertext_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_finish_req_p_tag)))) && + ((decode_buf_len(state, (&(*result).psa_aead_finish_req_tag_size)))) && + ((decode_ptr_uint(state, + (&(*result).psa_aead_finish_req_p_tag_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_aead_verify_req(zcbor_state_t *state, + struct psa_aead_verify_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (54)))) && + ((decode_ptr_uint(state, (&(*result).psa_aead_verify_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_verify_req_p_plaintext)))) && + ((decode_buf_len(state, + (&(*result).psa_aead_verify_req_plaintext_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_aead_verify_req_p_plaintext_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_aead_verify_req_p_tag)))) && + ((decode_buf_len(state, (&(*result).psa_aead_verify_req_tag_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_aead_abort_req(zcbor_state_t *state, + struct psa_aead_abort_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (55)))) && + ((decode_ptr_uint(state, (&(*result).psa_aead_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_sign_message_req(zcbor_state_t *state, + struct psa_sign_message_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (56)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_sign_message_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_sign_message_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_sign_message_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_sign_message_req_input_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_sign_message_req_p_signature)))) && + ((decode_buf_len(state, + (&(*result).psa_sign_message_req_signature_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_sign_message_req_p_signature_length))))))); + + log_result(state, res, __func__); + return res; } static bool -decode_psa_key_derivation_input_bytes_req(zcbor_state_t *state, - struct psa_key_derivation_input_bytes_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (65)))) && - ((decode_ptr_uint(state, - (&(*result).psa_key_derivation_input_bytes_req_p_handle)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_key_derivation_input_bytes_req_step)))) && - ((decode_ptr_buf(state, (&(*result).psa_key_derivation_input_bytes_req_p_data)))) && - ((decode_buf_len(state, - (&(*result).psa_key_derivation_input_bytes_req_data_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +decode_psa_verify_message_req(zcbor_state_t *state, + struct psa_verify_message_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (57)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_verify_message_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_verify_message_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_verify_message_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_verify_message_req_input_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_verify_message_req_p_signature)))) && + ((decode_buf_len( + state, (&(*result).psa_verify_message_req_signature_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_sign_hash_req(zcbor_state_t *state, + struct psa_sign_hash_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (58)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_sign_hash_req_p_hash)))) && + ((decode_buf_len(state, (&(*result).psa_sign_hash_req_hash_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_sign_hash_req_p_signature)))) && + ((decode_buf_len(state, + (&(*result).psa_sign_hash_req_signature_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_sign_hash_req_p_signature_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_verify_hash_req(zcbor_state_t *state, + struct psa_verify_hash_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (59)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_verify_hash_req_key)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_verify_hash_req_alg)))) && + ((decode_ptr_buf(state, (&(*result).psa_verify_hash_req_p_hash)))) && + ((decode_buf_len(state, (&(*result).psa_verify_hash_req_hash_length)))) && + ((decode_ptr_buf(state, (&(*result).psa_verify_hash_req_p_signature)))) && + ((decode_buf_len(state, + (&(*result).psa_verify_hash_req_signature_length))))))); + + log_result(state, res, __func__); + return res; } static bool -decode_psa_key_derivation_input_integer_req(zcbor_state_t *state, - struct psa_key_derivation_input_integer_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (66)))) && - ((decode_ptr_uint( - state, (&(*result).psa_key_derivation_input_integer_req_p_handle)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_input_integer_req_step)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_input_integer_req_value))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_key_derivation_input_key_req(zcbor_state_t *state, - struct psa_key_derivation_input_key_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (67)))) && - ((decode_ptr_uint(state, - (&(*result).psa_key_derivation_input_key_req_p_handle)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_key_derivation_input_key_req_step)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_key_derivation_input_key_req_key))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +decode_psa_asymmetric_encrypt_req(zcbor_state_t *state, + struct psa_asymmetric_encrypt_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (60)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_asymmetric_encrypt_req_key)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_asymmetric_encrypt_req_alg)))) && + ((decode_ptr_buf(state, + (&(*result).psa_asymmetric_encrypt_req_p_input)))) && + ((decode_buf_len( + state, (&(*result).psa_asymmetric_encrypt_req_input_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_asymmetric_encrypt_req_p_salt)))) && + ((decode_buf_len(state, + (&(*result).psa_asymmetric_encrypt_req_salt_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_asymmetric_encrypt_req_p_output)))) && + ((decode_buf_len(state, + (&(*result).psa_asymmetric_encrypt_req_output_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_asymmetric_encrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; } static bool -decode_psa_key_derivation_key_agreement_req(zcbor_state_t *state, - struct psa_key_derivation_key_agreement_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (68)))) && - ((decode_ptr_uint(state, - (&(*result).psa_key_derivation_key_agreement_req_p_handle)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_key_derivation_key_agreement_req_step)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_key_agreement_req_private_key)))) && - ((decode_ptr_buf(state, - (&(*result).psa_key_derivation_key_agreement_req_p_peer_key)))) && - ((decode_buf_len( - state, - (&(*result).psa_key_derivation_key_agreement_req_peer_key_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +decode_psa_asymmetric_decrypt_req(zcbor_state_t *state, + struct psa_asymmetric_decrypt_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (61)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_asymmetric_decrypt_req_key)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_asymmetric_decrypt_req_alg)))) && + ((decode_ptr_buf(state, + (&(*result).psa_asymmetric_decrypt_req_p_input)))) && + ((decode_buf_len( + state, (&(*result).psa_asymmetric_decrypt_req_input_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_asymmetric_decrypt_req_p_salt)))) && + ((decode_buf_len(state, + (&(*result).psa_asymmetric_decrypt_req_salt_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_asymmetric_decrypt_req_p_output)))) && + ((decode_buf_len(state, + (&(*result).psa_asymmetric_decrypt_req_output_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_asymmetric_decrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_setup_req( + zcbor_state_t *state, struct psa_key_derivation_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (62)))) && + ((decode_ptr_uint( + state, (&(*result).psa_key_derivation_setup_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_get_capacity_req( + zcbor_state_t *state, struct psa_key_derivation_get_capacity_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (63)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_get_capacity_req_handle)))) && + ((decode_ptr_uint( + state, + (&(*result).psa_key_derivation_get_capacity_req_p_capacity))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_set_capacity_req( + zcbor_state_t *state, struct psa_key_derivation_set_capacity_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (64)))) && + ((decode_ptr_uint( + state, (&(*result).psa_key_derivation_set_capacity_req_p_handle)))) && + ((zcbor_uint32_decode( + state, + (&(*result).psa_key_derivation_set_capacity_req_capacity))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_input_bytes_req( + zcbor_state_t *state, struct psa_key_derivation_input_bytes_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (65)))) && + ((decode_ptr_uint( + state, (&(*result).psa_key_derivation_input_bytes_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_input_bytes_req_step)))) && + ((decode_ptr_buf( + state, (&(*result).psa_key_derivation_input_bytes_req_p_data)))) && + ((decode_buf_len( + state, + (&(*result).psa_key_derivation_input_bytes_req_data_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_input_integer_req( + zcbor_state_t *state, struct psa_key_derivation_input_integer_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (66)))) && + ((decode_ptr_uint( + state, + (&(*result).psa_key_derivation_input_integer_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_input_integer_req_step)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_input_integer_req_value))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_input_key_req( + zcbor_state_t *state, struct psa_key_derivation_input_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (67)))) && + ((decode_ptr_uint( + state, (&(*result).psa_key_derivation_input_key_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_input_key_req_step)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_input_key_req_key))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_key_agreement_req( + zcbor_state_t *state, struct psa_key_derivation_key_agreement_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (68)))) && + ((decode_ptr_uint( + state, + (&(*result).psa_key_derivation_key_agreement_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_key_agreement_req_step)))) && + ((zcbor_uint32_decode( + state, + (&(*result).psa_key_derivation_key_agreement_req_private_key)))) && + ((decode_ptr_buf( + state, + (&(*result).psa_key_derivation_key_agreement_req_p_peer_key)))) && + ((decode_buf_len( + state, + (&(*result) + .psa_key_derivation_key_agreement_req_peer_key_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_output_bytes_req( + zcbor_state_t *state, struct psa_key_derivation_output_bytes_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (69)))) && + ((decode_ptr_uint( + state, (&(*result).psa_key_derivation_output_bytes_req_p_handle)))) && + ((decode_ptr_buf( + state, (&(*result).psa_key_derivation_output_bytes_req_p_output)))) && + ((decode_buf_len( + state, + (&(*result).psa_key_derivation_output_bytes_req_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_output_key_req( + zcbor_state_t *state, struct psa_key_derivation_output_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (70)))) && + ((decode_ptr_attr( + state, + (&(*result).psa_key_derivation_output_key_req_p_attributes)))) && + ((decode_ptr_uint( + state, (&(*result).psa_key_derivation_output_key_req_p_handle)))) && + ((decode_ptr_key( + state, (&(*result).psa_key_derivation_output_key_req_p_key))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_key_derivation_abort_req( + zcbor_state_t *state, struct psa_key_derivation_abort_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (71)))) && + ((decode_ptr_uint( + state, (&(*result).psa_key_derivation_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; } static bool -decode_psa_key_derivation_output_bytes_req(zcbor_state_t *state, - struct psa_key_derivation_output_bytes_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (69)))) && - ((decode_ptr_uint(state, - (&(*result).psa_key_derivation_output_bytes_req_p_handle)))) && - ((decode_ptr_buf(state, - (&(*result).psa_key_derivation_output_bytes_req_p_output)))) && - ((decode_buf_len( - state, (&(*result).psa_key_derivation_output_bytes_req_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +decode_psa_raw_key_agreement_req(zcbor_state_t *state, + struct psa_raw_key_agreement_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (72)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_raw_key_agreement_req_alg)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_raw_key_agreement_req_private_key)))) && + ((decode_ptr_buf(state, + (&(*result).psa_raw_key_agreement_req_p_peer_key)))) && + ((decode_buf_len( + state, (&(*result).psa_raw_key_agreement_req_peer_key_length)))) && + ((decode_ptr_buf(state, + (&(*result).psa_raw_key_agreement_req_p_output)))) && + ((decode_buf_len(state, + (&(*result).psa_raw_key_agreement_req_output_size)))) && + ((decode_ptr_uint( + state, (&(*result).psa_raw_key_agreement_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; } static bool -decode_psa_key_derivation_output_key_req(zcbor_state_t *state, - struct psa_key_derivation_output_key_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (70)))) && - ((decode_ptr_attr(state, - (&(*result).psa_key_derivation_output_key_req_p_attributes)))) && - ((decode_ptr_uint(state, - (&(*result).psa_key_derivation_output_key_req_p_handle)))) && - ((decode_ptr_key(state, (&(*result).psa_key_derivation_output_key_req_p_key))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_key_derivation_abort_req(zcbor_state_t *state, - struct psa_key_derivation_abort_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (71)))) && - ((decode_ptr_uint(state, (&(*result).psa_key_derivation_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_raw_key_agreement_req(zcbor_state_t *state, - struct psa_raw_key_agreement_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (72)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_raw_key_agreement_req_alg)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_raw_key_agreement_req_private_key)))) && - ((decode_ptr_buf(state, (&(*result).psa_raw_key_agreement_req_p_peer_key)))) && - ((decode_buf_len(state, (&(*result).psa_raw_key_agreement_req_peer_key_length)))) && - ((decode_ptr_buf(state, (&(*result).psa_raw_key_agreement_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_raw_key_agreement_req_output_size)))) && - ((decode_ptr_uint(state, - (&(*result).psa_raw_key_agreement_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_generate_random_req(zcbor_state_t *state, - struct psa_generate_random_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (73)))) && - ((decode_ptr_buf(state, (&(*result).psa_generate_random_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_generate_random_req_output_size))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_generate_key_req(zcbor_state_t *state, struct psa_generate_key_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (74)))) && - ((decode_ptr_attr(state, (&(*result).psa_generate_key_req_p_attributes)))) && - ((decode_ptr_key(state, (&(*result).psa_generate_key_req_p_key))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +decode_psa_generate_random_req(zcbor_state_t *state, + struct psa_generate_random_req *result) { + zcbor_log("%s\r\n", __func__); - return tmp_result; -} - -static bool decode_ptr_cipher(zcbor_state_t *state, uint32_t *result) -{ - zcbor_log("%s\r\n", __func__); + bool res = + (((((zcbor_uint32_expect(state, (73)))) && + ((decode_ptr_buf(state, + (&(*result).psa_generate_random_req_p_output)))) && + ((decode_buf_len( + state, (&(*result).psa_generate_random_req_output_size))))))); - bool tmp_result = - ((zcbor_tag_expect(state, 32775) && (zcbor_uint32_decode(state, (&(*result)))))); + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool decode_psa_generate_key_req(zcbor_state_t *state, + struct psa_generate_key_req *result) { + zcbor_log("%s\r\n", __func__); - return tmp_result; -} + bool res = + (((((zcbor_uint32_expect(state, (74)))) && + ((decode_ptr_attr(state, + (&(*result).psa_generate_key_req_p_attributes)))) && + ((decode_ptr_key(state, (&(*result).psa_generate_key_req_p_key))))))); -static bool decode_psa_pake_setup_req(zcbor_state_t *state, struct psa_pake_setup_req *result) -{ - zcbor_log("%s\r\n", __func__); + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_expect(state, (79)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_setup_req_password_key)))) && - ((decode_ptr_cipher(state, (&(*result).psa_pake_setup_req_p_cipher_suite))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_pake_set_role_req(zcbor_state_t *state, struct psa_pake_set_role_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (80)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_set_role_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_role_req_role))))))); +static bool decode_ptr_cipher(zcbor_state_t *state, uint32_t *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((zcbor_tag_expect(state, 32775) && + (zcbor_uint32_decode(state, (&(*result)))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_pake_set_user_req(zcbor_state_t *state, struct psa_pake_set_user_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_pake_setup_req(zcbor_state_t *state, + struct psa_pake_setup_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_expect(state, (81)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_set_user_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_pake_set_user_req_p_user_id)))) && - ((decode_buf_len(state, (&(*result).psa_pake_set_user_req_user_id_len))))))); + bool res = + (((((zcbor_uint32_expect(state, (79)))) && + ((decode_ptr_uint(state, (&(*result).psa_pake_setup_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_setup_req_password_key)))) && + ((decode_ptr_cipher( + state, (&(*result).psa_pake_setup_req_p_cipher_suite))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_pake_set_role_req(zcbor_state_t *state, + struct psa_pake_set_role_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_expect(state, (80)))) && + ((decode_ptr_uint(state, (&(*result).psa_pake_set_role_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_pake_set_role_req_role))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_pake_set_peer_req(zcbor_state_t *state, struct psa_pake_set_peer_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_psa_pake_set_user_req(zcbor_state_t *state, + struct psa_pake_set_user_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (81)))) && + ((decode_ptr_uint(state, (&(*result).psa_pake_set_user_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_pake_set_user_req_p_user_id)))) && + ((decode_buf_len(state, + (&(*result).psa_pake_set_user_req_user_id_len))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_expect(state, (82)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_set_peer_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_pake_set_peer_req_p_peer_id)))) && - ((decode_buf_len(state, (&(*result).psa_pake_set_peer_req_peer_id_len))))))); +static bool decode_psa_pake_set_peer_req(zcbor_state_t *state, + struct psa_pake_set_peer_req *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_expect(state, (82)))) && + ((decode_ptr_uint(state, (&(*result).psa_pake_set_peer_req_p_handle)))) && + ((decode_ptr_buf(state, (&(*result).psa_pake_set_peer_req_p_peer_id)))) && + ((decode_buf_len(state, + (&(*result).psa_pake_set_peer_req_peer_id_len))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_psa_pake_set_context_req(zcbor_state_t *state, - struct psa_pake_set_context_req *result) -{ - zcbor_log("%s\r\n", __func__); +static bool +decode_psa_pake_set_context_req(zcbor_state_t *state, + struct psa_pake_set_context_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (83)))) && + ((decode_ptr_uint(state, + (&(*result).psa_pake_set_context_req_p_handle)))) && + ((decode_ptr_buf(state, + (&(*result).psa_pake_set_context_req_p_context)))) && + ((decode_buf_len( + state, (&(*result).psa_pake_set_context_req_context_len))))))); - bool tmp_result = - (((((zcbor_uint32_expect(state, (83)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_set_context_req_p_handle)))) && - ((decode_ptr_buf(state, (&(*result).psa_pake_set_context_req_p_context)))) && - ((decode_buf_len(state, (&(*result).psa_pake_set_context_req_context_len))))))); + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool decode_psa_pake_output_req(zcbor_state_t *state, + struct psa_pake_output_req *result) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = ((( + ((zcbor_uint32_expect(state, (84)))) && + ((decode_ptr_uint(state, (&(*result).psa_pake_output_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_pake_output_req_step)))) && + ((decode_ptr_buf(state, (&(*result).psa_pake_output_req_p_output)))) && + ((decode_buf_len(state, (&(*result).psa_pake_output_req_output_size)))) && + ((decode_ptr_uint(state, + (&(*result).psa_pake_output_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_psa_pake_output_req(zcbor_state_t *state, struct psa_pake_output_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (84)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_output_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_output_req_step)))) && - ((decode_ptr_buf(state, (&(*result).psa_pake_output_req_p_output)))) && - ((decode_buf_len(state, (&(*result).psa_pake_output_req_output_size)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_output_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_pake_input_req(zcbor_state_t *state, struct psa_pake_input_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (85)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_input_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_input_req_step)))) && - ((decode_ptr_buf(state, (&(*result).psa_pake_input_req_p_input)))) && - ((decode_buf_len(state, (&(*result).psa_pake_input_req_input_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_pake_get_shared_key_req(zcbor_state_t *state, - struct psa_pake_get_shared_key_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (86)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_get_shared_key_req_p_handle)))) && - ((decode_ptr_attr(state, (&(*result).psa_pake_get_shared_key_req_p_attributes)))) && - ((decode_ptr_key(state, (&(*result).psa_pake_get_shared_key_req_p_key))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_pake_abort_req(zcbor_state_t *state, struct psa_pake_abort_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (87)))) && - ((decode_ptr_uint(state, (&(*result).psa_pake_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_crypto_rsp(zcbor_state_t *state, struct psa_crypto_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_uint32_decode(state, (&(*result).psa_crypto_rsp_id)))) && - ((zcbor_int32_decode(state, (&(*result).psa_crypto_rsp_status))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_psa_crypto_req(zcbor_state_t *state, struct psa_crypto_req *result) -{ - zcbor_log("%s\r\n", __func__); - bool int_res; - - bool tmp_result = ((( - zcbor_list_start_decode(state) && - ((((zcbor_union_start_code(state) && - (int_res = - ((((zcbor_uint32_expect_union(state, (10)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_crypto_init_req_m_c), - true)) || - (zcbor_union_elem_code(state) && - (((decode_psa_get_key_attributes_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_get_key_attributes_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_get_key_attributes_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_reset_key_attributes_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_reset_key_attributes_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_reset_key_attributes_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_purge_key_req( - state, - (&(*result).psa_crypto_req_msg_psa_purge_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_purge_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_copy_key_req( - state, - (&(*result).psa_crypto_req_msg_psa_copy_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_copy_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_destroy_key_req( - state, - (&(*result).psa_crypto_req_msg_psa_destroy_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_destroy_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_import_key_req( - state, - (&(*result).psa_crypto_req_msg_psa_import_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_import_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_export_key_req( - state, - (&(*result).psa_crypto_req_msg_psa_export_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_export_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_export_public_key_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_export_public_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_export_public_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_hash_compute_req( - state, - (&(*result).psa_crypto_req_msg_psa_hash_compute_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_hash_compute_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_hash_compare_req( - state, - (&(*result).psa_crypto_req_msg_psa_hash_compare_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_hash_compare_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_hash_setup_req( - state, - (&(*result).psa_crypto_req_msg_psa_hash_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_hash_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_hash_update_req( - state, - (&(*result).psa_crypto_req_msg_psa_hash_update_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_hash_update_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_hash_finish_req( - state, - (&(*result).psa_crypto_req_msg_psa_hash_finish_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_hash_finish_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_hash_verify_req( - state, - (&(*result).psa_crypto_req_msg_psa_hash_verify_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_hash_verify_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_hash_abort_req( - state, - (&(*result).psa_crypto_req_msg_psa_hash_abort_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_hash_abort_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_hash_clone_req( - state, - (&(*result).psa_crypto_req_msg_psa_hash_clone_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_hash_clone_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_mac_compute_req( - state, - (&(*result).psa_crypto_req_msg_psa_mac_compute_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_mac_compute_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_mac_verify_req( - state, - (&(*result).psa_crypto_req_msg_psa_mac_verify_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_mac_verify_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_mac_sign_setup_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_mac_sign_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_mac_sign_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_mac_verify_setup_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_mac_verify_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_mac_verify_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_mac_update_req( - state, - (&(*result).psa_crypto_req_msg_psa_mac_update_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_mac_update_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_mac_sign_finish_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_mac_sign_finish_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_mac_sign_finish_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_mac_verify_finish_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_mac_verify_finish_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_mac_verify_finish_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_mac_abort_req( - state, - (&(*result).psa_crypto_req_msg_psa_mac_abort_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_mac_abort_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_encrypt_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_cipher_encrypt_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_encrypt_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_decrypt_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_cipher_decrypt_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_decrypt_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_encrypt_setup_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_cipher_encrypt_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_encrypt_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_decrypt_setup_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_cipher_decrypt_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_decrypt_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_generate_iv_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_cipher_generate_iv_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_generate_iv_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_set_iv_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_cipher_set_iv_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_set_iv_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_update_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_cipher_update_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_update_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_finish_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_cipher_finish_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_finish_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_cipher_abort_req( - state, - (&(*result).psa_crypto_req_msg_psa_cipher_abort_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_cipher_abort_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_encrypt_req( - state, - (&(*result).psa_crypto_req_msg_psa_aead_encrypt_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_encrypt_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_decrypt_req( - state, - (&(*result).psa_crypto_req_msg_psa_aead_decrypt_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_decrypt_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_encrypt_setup_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_aead_encrypt_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_encrypt_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_decrypt_setup_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_aead_decrypt_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_decrypt_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_generate_nonce_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_aead_generate_nonce_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_generate_nonce_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_set_nonce_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_aead_set_nonce_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_set_nonce_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_set_lengths_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_aead_set_lengths_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_set_lengths_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_update_ad_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_aead_update_ad_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_update_ad_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_update_req( - state, - (&(*result).psa_crypto_req_msg_psa_aead_update_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_update_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_finish_req( - state, - (&(*result).psa_crypto_req_msg_psa_aead_finish_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_finish_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_verify_req( - state, - (&(*result).psa_crypto_req_msg_psa_aead_verify_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_verify_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_aead_abort_req( - state, - (&(*result).psa_crypto_req_msg_psa_aead_abort_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_aead_abort_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_sign_message_req( - state, - (&(*result).psa_crypto_req_msg_psa_sign_message_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_sign_message_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_verify_message_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_verify_message_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_verify_message_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_sign_hash_req( - state, - (&(*result).psa_crypto_req_msg_psa_sign_hash_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_sign_hash_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_verify_hash_req( - state, - (&(*result).psa_crypto_req_msg_psa_verify_hash_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_verify_hash_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_asymmetric_encrypt_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_asymmetric_encrypt_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_asymmetric_encrypt_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_asymmetric_decrypt_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_asymmetric_decrypt_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_asymmetric_decrypt_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_setup_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_get_capacity_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_get_capacity_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_get_capacity_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_set_capacity_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_set_capacity_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_set_capacity_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_input_bytes_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_input_bytes_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_input_bytes_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_input_integer_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_input_integer_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_input_integer_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_input_key_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_input_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_input_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_key_agreement_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_key_agreement_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_key_agreement_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_output_bytes_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_output_bytes_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_output_bytes_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_output_key_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_output_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_output_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_key_derivation_abort_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_key_derivation_abort_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_key_derivation_abort_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_raw_key_agreement_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_raw_key_agreement_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_raw_key_agreement_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_generate_random_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_generate_random_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_generate_random_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_generate_key_req( - state, - (&(*result).psa_crypto_req_msg_psa_generate_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_generate_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_setup_req( - state, - (&(*result).psa_crypto_req_msg_psa_pake_setup_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_setup_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_set_role_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_pake_set_role_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_set_role_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_set_user_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_pake_set_user_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_set_user_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_set_peer_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_pake_set_peer_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_set_peer_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_set_context_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_pake_set_context_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_set_context_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_output_req( - state, - (&(*result).psa_crypto_req_msg_psa_pake_output_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_output_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_input_req( - state, - (&(*result).psa_crypto_req_msg_psa_pake_input_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_input_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_get_shared_key_req( - state, - (&(*result) - .psa_crypto_req_msg_psa_pake_get_shared_key_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_get_shared_key_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_psa_pake_abort_req( - state, - (&(*result).psa_crypto_req_msg_psa_pake_abort_req_m)))) && - (((*result).psa_crypto_req_msg_choice = - psa_crypto_req_msg_psa_pake_abort_req_m_c), - true)))), - zcbor_union_end_code(state), int_res)))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool decode_psa_pake_input_req(zcbor_state_t *state, + struct psa_pake_input_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (85)))) && + ((decode_ptr_uint(state, (&(*result).psa_pake_input_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_pake_input_req_step)))) && + ((decode_ptr_buf(state, (&(*result).psa_pake_input_req_p_input)))) && + ((decode_buf_len(state, + (&(*result).psa_pake_input_req_input_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +decode_psa_pake_get_shared_key_req(zcbor_state_t *state, + struct psa_pake_get_shared_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (86)))) && + ((decode_ptr_uint( + state, (&(*result).psa_pake_get_shared_key_req_p_handle)))) && + ((decode_ptr_attr( + state, (&(*result).psa_pake_get_shared_key_req_p_attributes)))) && + ((decode_ptr_key(state, + (&(*result).psa_pake_get_shared_key_req_p_key))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_pake_abort_req(zcbor_state_t *state, + struct psa_pake_abort_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (87)))) && + ((decode_ptr_uint(state, (&(*result).psa_pake_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_crypto_rsp(zcbor_state_t *state, + struct psa_crypto_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((zcbor_list_start_decode(state) && + ((((zcbor_uint32_decode(state, (&(*result).psa_crypto_rsp_id)))) && + ((zcbor_int32_decode(state, (&(*result).psa_crypto_rsp_status))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_crypto_req(zcbor_state_t *state, + struct psa_crypto_req *result) { + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool res = ((( + zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = + ((((zcbor_uint32_expect_union(state, (10)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_crypto_init_req_m_c), + true)) || + (((decode_psa_get_key_attributes_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_get_key_attributes_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_get_key_attributes_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_psa_reset_key_attributes_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_reset_key_attributes_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_reset_key_attributes_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_purge_key_req( + state, + (&(*result).psa_crypto_req_msg_psa_purge_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_purge_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_copy_key_req( + state, + (&(*result).psa_crypto_req_msg_psa_copy_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_copy_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_destroy_key_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_destroy_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_destroy_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_import_key_req( + state, + (&(*result).psa_crypto_req_msg_psa_import_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_import_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_export_key_req( + state, + (&(*result).psa_crypto_req_msg_psa_export_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_export_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_export_public_key_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_export_public_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_export_public_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_hash_compute_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_hash_compute_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_hash_compute_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_hash_compare_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_hash_compare_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_hash_compare_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_hash_setup_req( + state, + (&(*result).psa_crypto_req_msg_psa_hash_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_hash_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_hash_update_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_hash_update_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_hash_update_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_hash_finish_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_hash_finish_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_hash_finish_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_hash_verify_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_hash_verify_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_hash_verify_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_hash_abort_req( + state, + (&(*result).psa_crypto_req_msg_psa_hash_abort_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_hash_abort_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_hash_clone_req( + state, + (&(*result).psa_crypto_req_msg_psa_hash_clone_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_hash_clone_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_mac_compute_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_mac_compute_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_mac_compute_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_mac_verify_req( + state, + (&(*result).psa_crypto_req_msg_psa_mac_verify_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_mac_verify_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_mac_sign_setup_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_mac_sign_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_mac_sign_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_mac_verify_setup_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_mac_verify_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_mac_verify_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_mac_update_req( + state, + (&(*result).psa_crypto_req_msg_psa_mac_update_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_mac_update_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_mac_sign_finish_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_mac_sign_finish_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_mac_sign_finish_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_mac_verify_finish_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_mac_verify_finish_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_mac_verify_finish_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_mac_abort_req( + state, + (&(*result).psa_crypto_req_msg_psa_mac_abort_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_mac_abort_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_encrypt_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_encrypt_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_encrypt_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_decrypt_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_decrypt_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_decrypt_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_encrypt_setup_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_encrypt_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_encrypt_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_decrypt_setup_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_decrypt_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_decrypt_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_generate_iv_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_generate_iv_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_generate_iv_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_set_iv_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_set_iv_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_set_iv_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_update_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_update_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_update_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_finish_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_finish_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_finish_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_cipher_abort_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_cipher_abort_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_cipher_abort_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_encrypt_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_encrypt_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_encrypt_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_decrypt_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_decrypt_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_decrypt_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_encrypt_setup_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_encrypt_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_encrypt_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_decrypt_setup_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_decrypt_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_decrypt_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_generate_nonce_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_generate_nonce_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_generate_nonce_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_set_nonce_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_set_nonce_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_set_nonce_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_set_lengths_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_set_lengths_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_set_lengths_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_update_ad_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_update_ad_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_update_ad_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_update_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_update_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_update_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_finish_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_finish_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_finish_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_verify_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_aead_verify_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_verify_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_aead_abort_req( + state, + (&(*result).psa_crypto_req_msg_psa_aead_abort_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_aead_abort_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_sign_message_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_sign_message_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_sign_message_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_verify_message_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_verify_message_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_verify_message_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_sign_hash_req( + state, + (&(*result).psa_crypto_req_msg_psa_sign_hash_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_sign_hash_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_verify_hash_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_verify_hash_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_verify_hash_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_asymmetric_encrypt_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_asymmetric_encrypt_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_asymmetric_encrypt_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_asymmetric_decrypt_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_asymmetric_decrypt_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_asymmetric_decrypt_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_setup_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_get_capacity_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_get_capacity_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_get_capacity_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_set_capacity_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_set_capacity_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_set_capacity_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_input_bytes_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_input_bytes_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_input_bytes_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_input_integer_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_input_integer_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_input_integer_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_input_key_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_input_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_input_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_key_agreement_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_key_agreement_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_key_agreement_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_output_bytes_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_output_bytes_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_output_bytes_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_output_key_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_output_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_output_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_key_derivation_abort_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_key_derivation_abort_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_key_derivation_abort_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_raw_key_agreement_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_raw_key_agreement_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_raw_key_agreement_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_generate_random_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_generate_random_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_generate_random_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_generate_key_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_generate_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_generate_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_setup_req( + state, + (&(*result).psa_crypto_req_msg_psa_pake_setup_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_set_role_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_pake_set_role_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_set_role_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_set_user_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_pake_set_user_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_set_user_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_set_peer_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_pake_set_peer_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_set_peer_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_set_context_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_pake_set_context_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_set_context_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_output_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_pake_output_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_output_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_input_req( + state, + (&(*result).psa_crypto_req_msg_psa_pake_input_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_input_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_get_shared_key_req( + state, + (&(*result) + .psa_crypto_req_msg_psa_pake_get_shared_key_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_get_shared_key_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_psa_pake_abort_req( + state, + (&(*result).psa_crypto_req_msg_psa_pake_abort_req_m)))) && + (((*result).psa_crypto_req_msg_choice = + psa_crypto_req_msg_psa_pake_abort_req_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + log_result(state, res, __func__); + return res; } int cbor_decode_psa_crypto_req(const uint8_t *payload, size_t payload_len, - struct psa_crypto_req *result, size_t *payload_len_out) -{ - zcbor_state_t states[4]; + struct psa_crypto_req *result, + size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_psa_crypto_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_psa_crypto_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } int cbor_decode_psa_crypto_rsp(const uint8_t *payload, size_t payload_len, - struct psa_crypto_rsp *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_psa_crypto_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + struct psa_crypto_rsp *result, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_psa_crypto_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_decode.h b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_decode.h index 2902793fabd8..1906262031f7 100644 --- a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_decode.h +++ b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_decode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,25 +13,28 @@ #ifndef PSA_CRYPTO_SERVICE_DECODE_H__ #define PSA_CRYPTO_SERVICE_DECODE_H__ -#include +#include "psa_crypto_service_types.h" #include #include +#include #include -#include "psa_crypto_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif int cbor_decode_psa_crypto_req(const uint8_t *payload, size_t payload_len, - struct psa_crypto_req *result, size_t *payload_len_out); + struct psa_crypto_req *result, + size_t *payload_len_out); int cbor_decode_psa_crypto_rsp(const uint8_t *payload, size_t payload_len, - struct psa_crypto_rsp *result, size_t *payload_len_out); + struct psa_crypto_rsp *result, + size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_encode.c b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_encode.c index 4925a38f7d58..ea9c9b73f272 100644 --- a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_encode.c +++ b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_encode.c @@ -5,1907 +5,1594 @@ */ /* - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "psa_crypto_service_encode.h" +#include "zcbor_encode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_encode.h" -#include "psa_crypto_service_encode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + static bool encode_ptr_attr(zcbor_state_t *state, const uint32_t *input); -static bool encode_psa_get_key_attributes_req(zcbor_state_t *state, - const struct psa_get_key_attributes_req *input); -static bool encode_psa_reset_key_attributes_req(zcbor_state_t *state, - const struct psa_reset_key_attributes_req *input); -static bool encode_psa_purge_key_req(zcbor_state_t *state, const struct psa_purge_key_req *input); +static bool encode_psa_get_key_attributes_req( + zcbor_state_t *state, const struct psa_get_key_attributes_req *input); +static bool encode_psa_reset_key_attributes_req( + zcbor_state_t *state, const struct psa_reset_key_attributes_req *input); +static bool encode_psa_purge_key_req(zcbor_state_t *state, + const struct psa_purge_key_req *input); static bool encode_ptr_key(zcbor_state_t *state, const uint32_t *input); -static bool encode_psa_copy_key_req(zcbor_state_t *state, const struct psa_copy_key_req *input); +static bool encode_psa_copy_key_req(zcbor_state_t *state, + const struct psa_copy_key_req *input); static bool encode_psa_destroy_key_req(zcbor_state_t *state, - const struct psa_destroy_key_req *input); + const struct psa_destroy_key_req *input); static bool encode_ptr_buf(zcbor_state_t *state, const uint32_t *input); static bool encode_buf_len(zcbor_state_t *state, const uint32_t *input); -static bool encode_psa_import_key_req(zcbor_state_t *state, const struct psa_import_key_req *input); +static bool encode_psa_import_key_req(zcbor_state_t *state, + const struct psa_import_key_req *input); static bool encode_ptr_uint(zcbor_state_t *state, const uint32_t *input); -static bool encode_psa_export_key_req(zcbor_state_t *state, const struct psa_export_key_req *input); -static bool encode_psa_export_public_key_req(zcbor_state_t *state, - const struct psa_export_public_key_req *input); -static bool encode_psa_hash_compute_req(zcbor_state_t *state, - const struct psa_hash_compute_req *input); -static bool encode_psa_hash_compare_req(zcbor_state_t *state, - const struct psa_hash_compare_req *input); -static bool encode_psa_hash_setup_req(zcbor_state_t *state, const struct psa_hash_setup_req *input); +static bool encode_psa_export_key_req(zcbor_state_t *state, + const struct psa_export_key_req *input); +static bool +encode_psa_export_public_key_req(zcbor_state_t *state, + const struct psa_export_public_key_req *input); +static bool +encode_psa_hash_compute_req(zcbor_state_t *state, + const struct psa_hash_compute_req *input); +static bool +encode_psa_hash_compare_req(zcbor_state_t *state, + const struct psa_hash_compare_req *input); +static bool encode_psa_hash_setup_req(zcbor_state_t *state, + const struct psa_hash_setup_req *input); static bool encode_psa_hash_update_req(zcbor_state_t *state, - const struct psa_hash_update_req *input); + const struct psa_hash_update_req *input); static bool encode_psa_hash_finish_req(zcbor_state_t *state, - const struct psa_hash_finish_req *input); + const struct psa_hash_finish_req *input); static bool encode_psa_hash_verify_req(zcbor_state_t *state, - const struct psa_hash_verify_req *input); -static bool encode_psa_hash_abort_req(zcbor_state_t *state, const struct psa_hash_abort_req *input); -static bool encode_psa_hash_clone_req(zcbor_state_t *state, const struct psa_hash_clone_req *input); + const struct psa_hash_verify_req *input); +static bool encode_psa_hash_abort_req(zcbor_state_t *state, + const struct psa_hash_abort_req *input); +static bool encode_psa_hash_clone_req(zcbor_state_t *state, + const struct psa_hash_clone_req *input); static bool encode_psa_mac_compute_req(zcbor_state_t *state, - const struct psa_mac_compute_req *input); -static bool encode_psa_mac_verify_req(zcbor_state_t *state, const struct psa_mac_verify_req *input); -static bool encode_psa_mac_sign_setup_req(zcbor_state_t *state, - const struct psa_mac_sign_setup_req *input); -static bool encode_psa_mac_verify_setup_req(zcbor_state_t *state, - const struct psa_mac_verify_setup_req *input); -static bool encode_psa_mac_update_req(zcbor_state_t *state, const struct psa_mac_update_req *input); -static bool encode_psa_mac_sign_finish_req(zcbor_state_t *state, - const struct psa_mac_sign_finish_req *input); -static bool encode_psa_mac_verify_finish_req(zcbor_state_t *state, - const struct psa_mac_verify_finish_req *input); -static bool encode_psa_mac_abort_req(zcbor_state_t *state, const struct psa_mac_abort_req *input); -static bool encode_psa_cipher_encrypt_req(zcbor_state_t *state, - const struct psa_cipher_encrypt_req *input); -static bool encode_psa_cipher_decrypt_req(zcbor_state_t *state, - const struct psa_cipher_decrypt_req *input); -static bool encode_psa_cipher_encrypt_setup_req(zcbor_state_t *state, - const struct psa_cipher_encrypt_setup_req *input); -static bool encode_psa_cipher_decrypt_setup_req(zcbor_state_t *state, - const struct psa_cipher_decrypt_setup_req *input); -static bool encode_psa_cipher_generate_iv_req(zcbor_state_t *state, - const struct psa_cipher_generate_iv_req *input); -static bool encode_psa_cipher_set_iv_req(zcbor_state_t *state, - const struct psa_cipher_set_iv_req *input); -static bool encode_psa_cipher_update_req(zcbor_state_t *state, - const struct psa_cipher_update_req *input); -static bool encode_psa_cipher_finish_req(zcbor_state_t *state, - const struct psa_cipher_finish_req *input); -static bool encode_psa_cipher_abort_req(zcbor_state_t *state, - const struct psa_cipher_abort_req *input); -static bool encode_psa_aead_encrypt_req(zcbor_state_t *state, - const struct psa_aead_encrypt_req *input); -static bool encode_psa_aead_decrypt_req(zcbor_state_t *state, - const struct psa_aead_decrypt_req *input); -static bool encode_psa_aead_encrypt_setup_req(zcbor_state_t *state, - const struct psa_aead_encrypt_setup_req *input); -static bool encode_psa_aead_decrypt_setup_req(zcbor_state_t *state, - const struct psa_aead_decrypt_setup_req *input); -static bool encode_psa_aead_generate_nonce_req(zcbor_state_t *state, - const struct psa_aead_generate_nonce_req *input); -static bool encode_psa_aead_set_nonce_req(zcbor_state_t *state, - const struct psa_aead_set_nonce_req *input); -static bool encode_psa_aead_set_lengths_req(zcbor_state_t *state, - const struct psa_aead_set_lengths_req *input); -static bool encode_psa_aead_update_ad_req(zcbor_state_t *state, - const struct psa_aead_update_ad_req *input); + const struct psa_mac_compute_req *input); +static bool encode_psa_mac_verify_req(zcbor_state_t *state, + const struct psa_mac_verify_req *input); +static bool +encode_psa_mac_sign_setup_req(zcbor_state_t *state, + const struct psa_mac_sign_setup_req *input); +static bool +encode_psa_mac_verify_setup_req(zcbor_state_t *state, + const struct psa_mac_verify_setup_req *input); +static bool encode_psa_mac_update_req(zcbor_state_t *state, + const struct psa_mac_update_req *input); +static bool +encode_psa_mac_sign_finish_req(zcbor_state_t *state, + const struct psa_mac_sign_finish_req *input); +static bool +encode_psa_mac_verify_finish_req(zcbor_state_t *state, + const struct psa_mac_verify_finish_req *input); +static bool encode_psa_mac_abort_req(zcbor_state_t *state, + const struct psa_mac_abort_req *input); +static bool +encode_psa_cipher_encrypt_req(zcbor_state_t *state, + const struct psa_cipher_encrypt_req *input); +static bool +encode_psa_cipher_decrypt_req(zcbor_state_t *state, + const struct psa_cipher_decrypt_req *input); +static bool encode_psa_cipher_encrypt_setup_req( + zcbor_state_t *state, const struct psa_cipher_encrypt_setup_req *input); +static bool encode_psa_cipher_decrypt_setup_req( + zcbor_state_t *state, const struct psa_cipher_decrypt_setup_req *input); +static bool encode_psa_cipher_generate_iv_req( + zcbor_state_t *state, const struct psa_cipher_generate_iv_req *input); +static bool +encode_psa_cipher_set_iv_req(zcbor_state_t *state, + const struct psa_cipher_set_iv_req *input); +static bool +encode_psa_cipher_update_req(zcbor_state_t *state, + const struct psa_cipher_update_req *input); +static bool +encode_psa_cipher_finish_req(zcbor_state_t *state, + const struct psa_cipher_finish_req *input); +static bool +encode_psa_cipher_abort_req(zcbor_state_t *state, + const struct psa_cipher_abort_req *input); +static bool +encode_psa_aead_encrypt_req(zcbor_state_t *state, + const struct psa_aead_encrypt_req *input); +static bool +encode_psa_aead_decrypt_req(zcbor_state_t *state, + const struct psa_aead_decrypt_req *input); +static bool encode_psa_aead_encrypt_setup_req( + zcbor_state_t *state, const struct psa_aead_encrypt_setup_req *input); +static bool encode_psa_aead_decrypt_setup_req( + zcbor_state_t *state, const struct psa_aead_decrypt_setup_req *input); +static bool encode_psa_aead_generate_nonce_req( + zcbor_state_t *state, const struct psa_aead_generate_nonce_req *input); +static bool +encode_psa_aead_set_nonce_req(zcbor_state_t *state, + const struct psa_aead_set_nonce_req *input); +static bool +encode_psa_aead_set_lengths_req(zcbor_state_t *state, + const struct psa_aead_set_lengths_req *input); +static bool +encode_psa_aead_update_ad_req(zcbor_state_t *state, + const struct psa_aead_update_ad_req *input); static bool encode_psa_aead_update_req(zcbor_state_t *state, - const struct psa_aead_update_req *input); + const struct psa_aead_update_req *input); static bool encode_psa_aead_finish_req(zcbor_state_t *state, - const struct psa_aead_finish_req *input); + const struct psa_aead_finish_req *input); static bool encode_psa_aead_verify_req(zcbor_state_t *state, - const struct psa_aead_verify_req *input); -static bool encode_psa_aead_abort_req(zcbor_state_t *state, const struct psa_aead_abort_req *input); -static bool encode_psa_sign_message_req(zcbor_state_t *state, - const struct psa_sign_message_req *input); -static bool encode_psa_verify_message_req(zcbor_state_t *state, - const struct psa_verify_message_req *input); -static bool encode_psa_sign_hash_req(zcbor_state_t *state, const struct psa_sign_hash_req *input); -static bool encode_psa_verify_hash_req(zcbor_state_t *state, - const struct psa_verify_hash_req *input); -static bool encode_psa_asymmetric_encrypt_req(zcbor_state_t *state, - const struct psa_asymmetric_encrypt_req *input); -static bool encode_psa_asymmetric_decrypt_req(zcbor_state_t *state, - const struct psa_asymmetric_decrypt_req *input); -static bool encode_psa_key_derivation_setup_req(zcbor_state_t *state, - const struct psa_key_derivation_setup_req *input); -static bool -encode_psa_key_derivation_get_capacity_req(zcbor_state_t *state, - const struct psa_key_derivation_get_capacity_req *input); + const struct psa_aead_verify_req *input); +static bool encode_psa_aead_abort_req(zcbor_state_t *state, + const struct psa_aead_abort_req *input); static bool -encode_psa_key_derivation_set_capacity_req(zcbor_state_t *state, - const struct psa_key_derivation_set_capacity_req *input); +encode_psa_sign_message_req(zcbor_state_t *state, + const struct psa_sign_message_req *input); static bool -encode_psa_key_derivation_input_bytes_req(zcbor_state_t *state, - const struct psa_key_derivation_input_bytes_req *input); +encode_psa_verify_message_req(zcbor_state_t *state, + const struct psa_verify_message_req *input); +static bool encode_psa_sign_hash_req(zcbor_state_t *state, + const struct psa_sign_hash_req *input); +static bool encode_psa_verify_hash_req(zcbor_state_t *state, + const struct psa_verify_hash_req *input); +static bool encode_psa_asymmetric_encrypt_req( + zcbor_state_t *state, const struct psa_asymmetric_encrypt_req *input); +static bool encode_psa_asymmetric_decrypt_req( + zcbor_state_t *state, const struct psa_asymmetric_decrypt_req *input); +static bool encode_psa_key_derivation_setup_req( + zcbor_state_t *state, const struct psa_key_derivation_setup_req *input); +static bool encode_psa_key_derivation_get_capacity_req( + zcbor_state_t *state, + const struct psa_key_derivation_get_capacity_req *input); +static bool encode_psa_key_derivation_set_capacity_req( + zcbor_state_t *state, + const struct psa_key_derivation_set_capacity_req *input); +static bool encode_psa_key_derivation_input_bytes_req( + zcbor_state_t *state, + const struct psa_key_derivation_input_bytes_req *input); static bool encode_psa_key_derivation_input_integer_req( - zcbor_state_t *state, const struct psa_key_derivation_input_integer_req *input); -static bool -encode_psa_key_derivation_input_key_req(zcbor_state_t *state, - const struct psa_key_derivation_input_key_req *input); + zcbor_state_t *state, + const struct psa_key_derivation_input_integer_req *input); +static bool encode_psa_key_derivation_input_key_req( + zcbor_state_t *state, const struct psa_key_derivation_input_key_req *input); static bool encode_psa_key_derivation_key_agreement_req( - zcbor_state_t *state, const struct psa_key_derivation_key_agreement_req *input); + zcbor_state_t *state, + const struct psa_key_derivation_key_agreement_req *input); +static bool encode_psa_key_derivation_output_bytes_req( + zcbor_state_t *state, + const struct psa_key_derivation_output_bytes_req *input); +static bool encode_psa_key_derivation_output_key_req( + zcbor_state_t *state, + const struct psa_key_derivation_output_key_req *input); +static bool encode_psa_key_derivation_abort_req( + zcbor_state_t *state, const struct psa_key_derivation_abort_req *input); +static bool +encode_psa_raw_key_agreement_req(zcbor_state_t *state, + const struct psa_raw_key_agreement_req *input); static bool -encode_psa_key_derivation_output_bytes_req(zcbor_state_t *state, - const struct psa_key_derivation_output_bytes_req *input); +encode_psa_generate_random_req(zcbor_state_t *state, + const struct psa_generate_random_req *input); static bool -encode_psa_key_derivation_output_key_req(zcbor_state_t *state, - const struct psa_key_derivation_output_key_req *input); -static bool encode_psa_key_derivation_abort_req(zcbor_state_t *state, - const struct psa_key_derivation_abort_req *input); -static bool encode_psa_raw_key_agreement_req(zcbor_state_t *state, - const struct psa_raw_key_agreement_req *input); -static bool encode_psa_generate_random_req(zcbor_state_t *state, - const struct psa_generate_random_req *input); -static bool encode_psa_generate_key_req(zcbor_state_t *state, - const struct psa_generate_key_req *input); +encode_psa_generate_key_req(zcbor_state_t *state, + const struct psa_generate_key_req *input); static bool encode_ptr_cipher(zcbor_state_t *state, const uint32_t *input); -static bool encode_psa_pake_setup_req(zcbor_state_t *state, const struct psa_pake_setup_req *input); -static bool encode_psa_pake_set_role_req(zcbor_state_t *state, - const struct psa_pake_set_role_req *input); -static bool encode_psa_pake_set_user_req(zcbor_state_t *state, - const struct psa_pake_set_user_req *input); -static bool encode_psa_pake_set_peer_req(zcbor_state_t *state, - const struct psa_pake_set_peer_req *input); -static bool encode_psa_pake_set_context_req(zcbor_state_t *state, - const struct psa_pake_set_context_req *input); +static bool encode_psa_pake_setup_req(zcbor_state_t *state, + const struct psa_pake_setup_req *input); +static bool +encode_psa_pake_set_role_req(zcbor_state_t *state, + const struct psa_pake_set_role_req *input); +static bool +encode_psa_pake_set_user_req(zcbor_state_t *state, + const struct psa_pake_set_user_req *input); +static bool +encode_psa_pake_set_peer_req(zcbor_state_t *state, + const struct psa_pake_set_peer_req *input); +static bool +encode_psa_pake_set_context_req(zcbor_state_t *state, + const struct psa_pake_set_context_req *input); static bool encode_psa_pake_output_req(zcbor_state_t *state, - const struct psa_pake_output_req *input); -static bool encode_psa_pake_input_req(zcbor_state_t *state, const struct psa_pake_input_req *input); -static bool encode_psa_pake_get_shared_key_req(zcbor_state_t *state, - const struct psa_pake_get_shared_key_req *input); -static bool encode_psa_pake_abort_req(zcbor_state_t *state, const struct psa_pake_abort_req *input); -static bool encode_psa_crypto_rsp(zcbor_state_t *state, const struct psa_crypto_rsp *input); -static bool encode_psa_crypto_req(zcbor_state_t *state, const struct psa_crypto_req *input); + const struct psa_pake_output_req *input); +static bool encode_psa_pake_input_req(zcbor_state_t *state, + const struct psa_pake_input_req *input); +static bool encode_psa_pake_get_shared_key_req( + zcbor_state_t *state, const struct psa_pake_get_shared_key_req *input); +static bool encode_psa_pake_abort_req(zcbor_state_t *state, + const struct psa_pake_abort_req *input); +static bool encode_psa_crypto_rsp(zcbor_state_t *state, + const struct psa_crypto_rsp *input); +static bool encode_psa_crypto_req(zcbor_state_t *state, + const struct psa_crypto_req *input); -static bool encode_ptr_attr(zcbor_state_t *state, const uint32_t *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_ptr_attr(zcbor_state_t *state, const uint32_t *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - ((zcbor_tag_put(state, 32772) && (zcbor_uint32_encode(state, (&(*input)))))); + bool res = ((zcbor_tag_put(state, 32772) && + (zcbor_uint32_encode(state, (&(*input)))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_get_key_attributes_req(zcbor_state_t *state, - const struct psa_get_key_attributes_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (11)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_get_key_attributes_req_key)))) && - ((encode_ptr_attr(state, (&(*input).psa_get_key_attributes_req_p_attributes))))))); +static bool encode_psa_get_key_attributes_req( + zcbor_state_t *state, const struct psa_get_key_attributes_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_put(state, (11)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_get_key_attributes_req_key)))) && + ((encode_ptr_attr( + state, (&(*input).psa_get_key_attributes_req_p_attributes))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_reset_key_attributes_req(zcbor_state_t *state, - const struct psa_reset_key_attributes_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (12)))) && - ((encode_ptr_attr(state, - (&(*input).psa_reset_key_attributes_req_p_attributes))))))); +static bool encode_psa_reset_key_attributes_req( + zcbor_state_t *state, const struct psa_reset_key_attributes_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_put(state, (12)))) && + ((encode_ptr_attr( + state, (&(*input).psa_reset_key_attributes_req_p_attributes))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_purge_key_req(zcbor_state_t *state, const struct psa_purge_key_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_psa_purge_key_req(zcbor_state_t *state, + const struct psa_purge_key_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((((zcbor_uint32_put(state, (13)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_purge_key_req_key))))))); + bool res = + (((((zcbor_uint32_put(state, (13)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_purge_key_req_key))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_ptr_key(zcbor_state_t *state, const uint32_t *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - ((zcbor_tag_put(state, 32773) && (zcbor_uint32_encode(state, (&(*input)))))); +static bool encode_ptr_key(zcbor_state_t *state, const uint32_t *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((zcbor_tag_put(state, 32773) && + (zcbor_uint32_encode(state, (&(*input)))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_copy_key_req(zcbor_state_t *state, const struct psa_copy_key_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_psa_copy_key_req(zcbor_state_t *state, + const struct psa_copy_key_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (14)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_copy_key_req_source_key)))) && - ((encode_ptr_attr(state, (&(*input).psa_copy_key_req_p_attributes)))) && - ((encode_ptr_key(state, (&(*input).psa_copy_key_req_p_target_key))))))); + bool res = ((( + ((zcbor_uint32_put(state, (14)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_copy_key_req_source_key)))) && + ((encode_ptr_attr(state, (&(*input).psa_copy_key_req_p_attributes)))) && + ((encode_ptr_key(state, (&(*input).psa_copy_key_req_p_target_key))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_destroy_key_req(zcbor_state_t *state, - const struct psa_destroy_key_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((((zcbor_uint32_put(state, (15)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_destroy_key_req_key))))))); +static bool +encode_psa_destroy_key_req(zcbor_state_t *state, + const struct psa_destroy_key_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_put(state, (15)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_destroy_key_req_key))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_ptr_buf(zcbor_state_t *state, const uint32_t *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_ptr_buf(zcbor_state_t *state, const uint32_t *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - ((zcbor_tag_put(state, 32770) && (zcbor_uint32_encode(state, (&(*input)))))); + bool res = ((zcbor_tag_put(state, 32770) && + (zcbor_uint32_encode(state, (&(*input)))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_buf_len(zcbor_state_t *state, const uint32_t *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_buf_len(zcbor_state_t *state, const uint32_t *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((zcbor_tag_put(state, 32771) && + (zcbor_uint32_encode(state, (&(*input)))))); - bool tmp_result = - ((zcbor_tag_put(state, 32771) && (zcbor_uint32_encode(state, (&(*input)))))); + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool encode_psa_import_key_req(zcbor_state_t *state, + const struct psa_import_key_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = ((( + ((zcbor_uint32_put(state, (16)))) && + ((encode_ptr_attr(state, (&(*input).psa_import_key_req_p_attributes)))) && + ((encode_ptr_buf(state, (&(*input).psa_import_key_req_p_data)))) && + ((encode_buf_len(state, (&(*input).psa_import_key_req_data_length)))) && + ((encode_ptr_key(state, (&(*input).psa_import_key_req_p_key))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_import_key_req(zcbor_state_t *state, const struct psa_import_key_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_ptr_uint(zcbor_state_t *state, const uint32_t *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (16)))) && - ((encode_ptr_attr(state, (&(*input).psa_import_key_req_p_attributes)))) && - ((encode_ptr_buf(state, (&(*input).psa_import_key_req_p_data)))) && - ((encode_buf_len(state, (&(*input).psa_import_key_req_data_length)))) && - ((encode_ptr_key(state, (&(*input).psa_import_key_req_p_key))))))); + bool res = ((zcbor_tag_put(state, 32774) && + (zcbor_uint32_encode(state, (&(*input)))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} - return tmp_result; +static bool encode_psa_export_key_req(zcbor_state_t *state, + const struct psa_export_key_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (17)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_export_key_req_key)))) && + ((encode_ptr_buf(state, (&(*input).psa_export_key_req_p_data)))) && + ((encode_buf_len(state, (&(*input).psa_export_key_req_data_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_export_key_req_p_data_length))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_ptr_uint(zcbor_state_t *state, const uint32_t *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - ((zcbor_tag_put(state, 32774) && (zcbor_uint32_encode(state, (&(*input)))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool encode_psa_export_public_key_req( + zcbor_state_t *state, const struct psa_export_public_key_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = ((( + ((zcbor_uint32_put(state, (18)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_export_public_key_req_key)))) && + ((encode_ptr_buf(state, (&(*input).psa_export_public_key_req_p_data)))) && + ((encode_buf_len(state, + (&(*input).psa_export_public_key_req_data_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_export_public_key_req_p_data_length))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_export_key_req(zcbor_state_t *state, const struct psa_export_key_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (17)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_export_key_req_key)))) && - ((encode_ptr_buf(state, (&(*input).psa_export_key_req_p_data)))) && - ((encode_buf_len(state, (&(*input).psa_export_key_req_data_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_export_key_req_p_data_length))))))); +static bool +encode_psa_hash_compute_req(zcbor_state_t *state, + const struct psa_hash_compute_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (( + (((zcbor_uint32_put(state, (19)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_compute_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_hash_compute_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_hash_compute_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_hash_compute_req_p_hash)))) && + ((encode_buf_len(state, (&(*input).psa_hash_compute_req_hash_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_hash_compute_req_p_hash_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_export_public_key_req(zcbor_state_t *state, - const struct psa_export_public_key_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_hash_compare_req(zcbor_state_t *state, + const struct psa_hash_compare_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (20)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_compare_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_hash_compare_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_hash_compare_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_hash_compare_req_p_hash)))) && + ((encode_buf_len(state, + (&(*input).psa_hash_compare_req_hash_length))))))); - bool tmp_result = (( - (((zcbor_uint32_put(state, (18)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_export_public_key_req_key)))) && - ((encode_ptr_buf(state, (&(*input).psa_export_public_key_req_p_data)))) && - ((encode_buf_len(state, (&(*input).psa_export_public_key_req_data_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_export_public_key_req_p_data_length))))))); + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool encode_psa_hash_setup_req(zcbor_state_t *state, + const struct psa_hash_setup_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = + (((((zcbor_uint32_put(state, (21)))) && + ((encode_ptr_uint(state, (&(*input).psa_hash_setup_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_hash_compute_req(zcbor_state_t *state, - const struct psa_hash_compute_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_hash_update_req(zcbor_state_t *state, + const struct psa_hash_update_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (19)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compute_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_hash_compute_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_hash_compute_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_hash_compute_req_p_hash)))) && - ((encode_buf_len(state, (&(*input).psa_hash_compute_req_hash_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_hash_compute_req_p_hash_length))))))); + bool res = + (((((zcbor_uint32_put(state, (22)))) && + ((encode_ptr_uint(state, (&(*input).psa_hash_update_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_hash_update_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_hash_update_req_input_length))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_hash_compare_req(zcbor_state_t *state, - const struct psa_hash_compare_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (20)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compare_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_hash_compare_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_hash_compare_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_hash_compare_req_p_hash)))) && - ((encode_buf_len(state, (&(*input).psa_hash_compare_req_hash_length))))))); +static bool +encode_psa_hash_finish_req(zcbor_state_t *state, + const struct psa_hash_finish_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_put(state, (23)))) && + ((encode_ptr_uint(state, (&(*input).psa_hash_finish_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_hash_finish_req_p_hash)))) && + ((encode_buf_len(state, (&(*input).psa_hash_finish_req_hash_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_hash_finish_req_p_hash_length))))))); - return tmp_result; -} + log_result(state, res, __func__); + return res; +} -static bool encode_psa_hash_setup_req(zcbor_state_t *state, const struct psa_hash_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_hash_verify_req(zcbor_state_t *state, + const struct psa_hash_verify_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((((zcbor_uint32_put(state, (21)))) && - ((encode_ptr_uint(state, (&(*input).psa_hash_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_setup_req_alg))))))); + bool res = ((( + ((zcbor_uint32_put(state, (24)))) && + ((encode_ptr_uint(state, (&(*input).psa_hash_verify_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_hash_verify_req_p_hash)))) && + ((encode_buf_len(state, (&(*input).psa_hash_verify_req_hash_length))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_hash_update_req(zcbor_state_t *state, - const struct psa_hash_update_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_psa_hash_abort_req(zcbor_state_t *state, + const struct psa_hash_abort_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (22)))) && - ((encode_ptr_uint(state, (&(*input).psa_hash_update_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_hash_update_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_hash_update_req_input_length))))))); + bool res = + (((((zcbor_uint32_put(state, (25)))) && + ((encode_ptr_uint(state, (&(*input).psa_hash_abort_req_p_handle))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_hash_clone_req(zcbor_state_t *state, + const struct psa_hash_clone_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = (( + (((zcbor_uint32_put(state, (26)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_clone_req_handle)))) && + ((encode_ptr_uint(state, (&(*input).psa_hash_clone_req_p_handle))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_hash_finish_req(zcbor_state_t *state, - const struct psa_hash_finish_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_mac_compute_req(zcbor_state_t *state, + const struct psa_mac_compute_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (27)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_mac_compute_req_p_input)))) && + ((encode_buf_len(state, (&(*input).psa_mac_compute_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_mac_compute_req_p_mac)))) && + ((encode_buf_len(state, (&(*input).psa_mac_compute_req_mac_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_mac_compute_req_p_mac_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_mac_verify_req(zcbor_state_t *state, + const struct psa_mac_verify_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (28)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_mac_verify_req_p_input)))) && + ((encode_buf_len(state, (&(*input).psa_mac_verify_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_mac_verify_req_p_mac)))) && + ((encode_buf_len(state, (&(*input).psa_mac_verify_req_mac_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (23)))) && - ((encode_ptr_uint(state, (&(*input).psa_hash_finish_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_hash_finish_req_p_hash)))) && - ((encode_buf_len(state, (&(*input).psa_hash_finish_req_hash_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_hash_finish_req_p_hash_length))))))); +static bool +encode_psa_mac_sign_setup_req(zcbor_state_t *state, + const struct psa_mac_sign_setup_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_put(state, (29)))) && + ((encode_ptr_uint(state, (&(*input).psa_mac_sign_setup_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_sign_setup_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_sign_setup_req_alg))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_hash_verify_req(zcbor_state_t *state, - const struct psa_hash_verify_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_mac_verify_setup_req(zcbor_state_t *state, + const struct psa_mac_verify_setup_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (30)))) && + ((encode_ptr_uint(state, + (&(*input).psa_mac_verify_setup_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_verify_setup_req_key)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_verify_setup_req_alg))))))); - bool tmp_result = - (((((zcbor_uint32_put(state, (24)))) && - ((encode_ptr_uint(state, (&(*input).psa_hash_verify_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_hash_verify_req_p_hash)))) && - ((encode_buf_len(state, (&(*input).psa_hash_verify_req_hash_length))))))); + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool encode_psa_mac_update_req(zcbor_state_t *state, + const struct psa_mac_update_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = ((( + ((zcbor_uint32_put(state, (31)))) && + ((encode_ptr_uint(state, (&(*input).psa_mac_update_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_mac_update_req_p_input)))) && + ((encode_buf_len(state, (&(*input).psa_mac_update_req_input_length))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_hash_abort_req(zcbor_state_t *state, const struct psa_hash_abort_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_mac_sign_finish_req(zcbor_state_t *state, + const struct psa_mac_sign_finish_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((((zcbor_uint32_put(state, (25)))) && - ((encode_ptr_uint(state, (&(*input).psa_hash_abort_req_p_handle))))))); + bool res = ((( + ((zcbor_uint32_put(state, (32)))) && + ((encode_ptr_uint(state, + (&(*input).psa_mac_sign_finish_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_mac_sign_finish_req_p_mac)))) && + ((encode_buf_len(state, (&(*input).psa_mac_sign_finish_req_mac_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_mac_sign_finish_req_p_mac_length))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_mac_verify_finish_req( + zcbor_state_t *state, const struct psa_mac_verify_finish_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = (( + (((zcbor_uint32_put(state, (33)))) && + ((encode_ptr_uint(state, + (&(*input).psa_mac_verify_finish_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_mac_verify_finish_req_p_mac)))) && + ((encode_buf_len(state, + (&(*input).psa_mac_verify_finish_req_mac_length))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_hash_clone_req(zcbor_state_t *state, const struct psa_hash_clone_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_psa_mac_abort_req(zcbor_state_t *state, + const struct psa_mac_abort_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (34)))) && + ((encode_ptr_uint(state, (&(*input).psa_mac_abort_req_p_handle))))))); - bool tmp_result = - (((((zcbor_uint32_put(state, (26)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_clone_req_handle)))) && - ((encode_ptr_uint(state, (&(*input).psa_hash_clone_req_p_handle))))))); + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool +encode_psa_cipher_encrypt_req(zcbor_state_t *state, + const struct psa_cipher_encrypt_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (35)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_encrypt_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_cipher_encrypt_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_encrypt_req_p_output)))) && + ((encode_buf_len(state, + (&(*input).psa_cipher_encrypt_req_output_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_cipher_encrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} - return tmp_result; +static bool +encode_psa_cipher_decrypt_req(zcbor_state_t *state, + const struct psa_cipher_decrypt_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (36)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_decrypt_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_cipher_decrypt_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_decrypt_req_p_output)))) && + ((encode_buf_len(state, + (&(*input).psa_cipher_decrypt_req_output_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_cipher_decrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_cipher_encrypt_setup_req( + zcbor_state_t *state, const struct psa_cipher_encrypt_setup_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (37)))) && + ((encode_ptr_uint( + state, (&(*input).psa_cipher_encrypt_setup_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_encrypt_setup_req_key)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_encrypt_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_cipher_decrypt_setup_req( + zcbor_state_t *state, const struct psa_cipher_decrypt_setup_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (38)))) && + ((encode_ptr_uint( + state, (&(*input).psa_cipher_decrypt_setup_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_decrypt_setup_req_key)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_decrypt_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_cipher_generate_iv_req( + zcbor_state_t *state, const struct psa_cipher_generate_iv_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (39)))) && + ((encode_ptr_uint(state, + (&(*input).psa_cipher_generate_iv_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_generate_iv_req_p_iv)))) && + ((encode_buf_len(state, + (&(*input).psa_cipher_generate_iv_req_iv_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_cipher_generate_iv_req_p_iv_length))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_mac_compute_req(zcbor_state_t *state, - const struct psa_mac_compute_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (27)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_mac_compute_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_mac_compute_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_mac_compute_req_p_mac)))) && - ((encode_buf_len(state, (&(*input).psa_mac_compute_req_mac_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_mac_compute_req_p_mac_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_mac_verify_req(zcbor_state_t *state, const struct psa_mac_verify_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (28)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_mac_verify_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_mac_verify_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_mac_verify_req_p_mac)))) && - ((encode_buf_len(state, (&(*input).psa_mac_verify_req_mac_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_mac_sign_setup_req(zcbor_state_t *state, - const struct psa_mac_sign_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (29)))) && - ((encode_ptr_uint(state, (&(*input).psa_mac_sign_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_sign_setup_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_sign_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_mac_verify_setup_req(zcbor_state_t *state, - const struct psa_mac_verify_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (30)))) && - ((encode_ptr_uint(state, (&(*input).psa_mac_verify_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_setup_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_mac_update_req(zcbor_state_t *state, const struct psa_mac_update_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (31)))) && - ((encode_ptr_uint(state, (&(*input).psa_mac_update_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_mac_update_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_mac_update_req_input_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_mac_sign_finish_req(zcbor_state_t *state, - const struct psa_mac_sign_finish_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (32)))) && - ((encode_ptr_uint(state, (&(*input).psa_mac_sign_finish_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_mac_sign_finish_req_p_mac)))) && - ((encode_buf_len(state, (&(*input).psa_mac_sign_finish_req_mac_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_mac_sign_finish_req_p_mac_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_mac_verify_finish_req(zcbor_state_t *state, - const struct psa_mac_verify_finish_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (33)))) && - ((encode_ptr_uint(state, (&(*input).psa_mac_verify_finish_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_mac_verify_finish_req_p_mac)))) && - ((encode_buf_len(state, (&(*input).psa_mac_verify_finish_req_mac_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_mac_abort_req(zcbor_state_t *state, const struct psa_mac_abort_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((((zcbor_uint32_put(state, (34)))) && - ((encode_ptr_uint(state, (&(*input).psa_mac_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_encrypt_req(zcbor_state_t *state, - const struct psa_cipher_encrypt_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (35)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_encrypt_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_encrypt_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_encrypt_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_encrypt_req_output_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_encrypt_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_decrypt_req(zcbor_state_t *state, - const struct psa_cipher_decrypt_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (36)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_decrypt_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_decrypt_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_decrypt_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_decrypt_req_output_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_decrypt_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_encrypt_setup_req(zcbor_state_t *state, - const struct psa_cipher_encrypt_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (37)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_encrypt_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_setup_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_decrypt_setup_req(zcbor_state_t *state, - const struct psa_cipher_decrypt_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (38)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_decrypt_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_setup_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_generate_iv_req(zcbor_state_t *state, - const struct psa_cipher_generate_iv_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (39)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_generate_iv_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_generate_iv_req_p_iv)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_generate_iv_req_iv_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_generate_iv_req_p_iv_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_set_iv_req(zcbor_state_t *state, - const struct psa_cipher_set_iv_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (40)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_set_iv_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_set_iv_req_p_iv)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_set_iv_req_iv_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_update_req(zcbor_state_t *state, - const struct psa_cipher_update_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (41)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_update_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_update_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_update_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_update_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_update_req_output_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_update_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_finish_req(zcbor_state_t *state, - const struct psa_cipher_finish_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (42)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_finish_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_cipher_finish_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_cipher_finish_req_output_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_finish_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_cipher_abort_req(zcbor_state_t *state, - const struct psa_cipher_abort_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (43)))) && - ((encode_ptr_uint(state, (&(*input).psa_cipher_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_encrypt_req(zcbor_state_t *state, - const struct psa_aead_encrypt_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (44)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_encrypt_req_p_nonce)))) && - ((encode_buf_len(state, (&(*input).psa_aead_encrypt_req_nonce_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_encrypt_req_p_additional_data)))) && - ((encode_buf_len(state, - (&(*input).psa_aead_encrypt_req_additional_data_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_encrypt_req_p_plaintext)))) && - ((encode_buf_len(state, (&(*input).psa_aead_encrypt_req_plaintext_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_encrypt_req_p_ciphertext)))) && - ((encode_buf_len(state, (&(*input).psa_aead_encrypt_req_ciphertext_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_encrypt_req_p_ciphertext_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_decrypt_req(zcbor_state_t *state, - const struct psa_aead_decrypt_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (45)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_decrypt_req_p_nonce)))) && - ((encode_buf_len(state, (&(*input).psa_aead_decrypt_req_nonce_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_decrypt_req_p_additional_data)))) && - ((encode_buf_len(state, - (&(*input).psa_aead_decrypt_req_additional_data_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_decrypt_req_p_ciphertext)))) && - ((encode_buf_len(state, (&(*input).psa_aead_decrypt_req_ciphertext_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_decrypt_req_p_plaintext)))) && - ((encode_buf_len(state, (&(*input).psa_aead_decrypt_req_plaintext_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_decrypt_req_p_plaintext_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_encrypt_setup_req(zcbor_state_t *state, - const struct psa_aead_encrypt_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (46)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_encrypt_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_setup_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_decrypt_setup_req(zcbor_state_t *state, - const struct psa_aead_decrypt_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (47)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_decrypt_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_setup_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_generate_nonce_req(zcbor_state_t *state, - const struct psa_aead_generate_nonce_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (48)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_generate_nonce_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_generate_nonce_req_p_nonce)))) && - ((encode_buf_len(state, (&(*input).psa_aead_generate_nonce_req_nonce_size)))) && - ((encode_ptr_uint(state, - (&(*input).psa_aead_generate_nonce_req_p_nonce_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_set_nonce_req(zcbor_state_t *state, - const struct psa_aead_set_nonce_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (49)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_set_nonce_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_set_nonce_req_p_nonce)))) && - ((encode_buf_len(state, (&(*input).psa_aead_set_nonce_req_nonce_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_set_lengths_req(zcbor_state_t *state, - const struct psa_aead_set_lengths_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (50)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_set_lengths_req_p_handle)))) && - ((encode_buf_len(state, (&(*input).psa_aead_set_lengths_req_ad_length)))) && - ((encode_buf_len(state, (&(*input).psa_aead_set_lengths_req_plaintext_length))))))); +static bool +encode_psa_cipher_set_iv_req(zcbor_state_t *state, + const struct psa_cipher_set_iv_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_update_ad_req(zcbor_state_t *state, - const struct psa_aead_update_ad_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (51)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_update_ad_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_update_ad_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_aead_update_ad_req_input_length))))))); + bool res = ((( + ((zcbor_uint32_put(state, (40)))) && + ((encode_ptr_uint(state, (&(*input).psa_cipher_set_iv_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_set_iv_req_p_iv)))) && + ((encode_buf_len(state, (&(*input).psa_cipher_set_iv_req_iv_length))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_aead_update_req(zcbor_state_t *state, - const struct psa_aead_update_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_cipher_update_req(zcbor_state_t *state, + const struct psa_cipher_update_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (41)))) && + ((encode_ptr_uint(state, (&(*input).psa_cipher_update_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_update_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_cipher_update_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_update_req_p_output)))) && + ((encode_buf_len(state, + (&(*input).psa_cipher_update_req_output_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_cipher_update_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (52)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_update_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_update_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_aead_update_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_update_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_aead_update_req_output_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_update_req_p_output_length))))))); +static bool +encode_psa_cipher_finish_req(zcbor_state_t *state, + const struct psa_cipher_finish_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (( + (((zcbor_uint32_put(state, (42)))) && + ((encode_ptr_uint(state, (&(*input).psa_cipher_finish_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_cipher_finish_req_p_output)))) && + ((encode_buf_len(state, + (&(*input).psa_cipher_finish_req_output_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_cipher_finish_req_p_output_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_aead_finish_req(zcbor_state_t *state, - const struct psa_aead_finish_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (53)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_finish_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_finish_req_p_ciphertext)))) && - ((encode_buf_len(state, (&(*input).psa_aead_finish_req_ciphertext_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_finish_req_p_ciphertext_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_finish_req_p_tag)))) && - ((encode_buf_len(state, (&(*input).psa_aead_finish_req_tag_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_finish_req_p_tag_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} +static bool +encode_psa_cipher_abort_req(zcbor_state_t *state, + const struct psa_cipher_abort_req *input) { + zcbor_log("%s\r\n", __func__); -static bool encode_psa_aead_verify_req(zcbor_state_t *state, - const struct psa_aead_verify_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (54)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_verify_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_verify_req_p_plaintext)))) && - ((encode_buf_len(state, (&(*input).psa_aead_verify_req_plaintext_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_verify_req_p_plaintext_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_aead_verify_req_p_tag)))) && - ((encode_buf_len(state, (&(*input).psa_aead_verify_req_tag_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_aead_abort_req(zcbor_state_t *state, const struct psa_aead_abort_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((((zcbor_uint32_put(state, (55)))) && - ((encode_ptr_uint(state, (&(*input).psa_aead_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_sign_message_req(zcbor_state_t *state, - const struct psa_sign_message_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (56)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_message_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_message_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_sign_message_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_sign_message_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_sign_message_req_p_signature)))) && - ((encode_buf_len(state, (&(*input).psa_sign_message_req_signature_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_sign_message_req_p_signature_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_verify_message_req(zcbor_state_t *state, - const struct psa_verify_message_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (57)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_message_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_message_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_verify_message_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_verify_message_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_verify_message_req_p_signature)))) && - ((encode_buf_len(state, (&(*input).psa_verify_message_req_signature_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_sign_hash_req(zcbor_state_t *state, const struct psa_sign_hash_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (58)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_sign_hash_req_p_hash)))) && - ((encode_buf_len(state, (&(*input).psa_sign_hash_req_hash_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_sign_hash_req_p_signature)))) && - ((encode_buf_len(state, (&(*input).psa_sign_hash_req_signature_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_sign_hash_req_p_signature_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + bool res = (( + (((zcbor_uint32_put(state, (43)))) && + ((encode_ptr_uint(state, (&(*input).psa_cipher_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_verify_hash_req(zcbor_state_t *state, - const struct psa_verify_hash_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (59)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_hash_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_hash_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_verify_hash_req_p_hash)))) && - ((encode_buf_len(state, (&(*input).psa_verify_hash_req_hash_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_verify_hash_req_p_signature)))) && - ((encode_buf_len(state, (&(*input).psa_verify_hash_req_signature_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_asymmetric_encrypt_req(zcbor_state_t *state, - const struct psa_asymmetric_encrypt_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (60)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_encrypt_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_encrypt_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_asymmetric_encrypt_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_asymmetric_encrypt_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_asymmetric_encrypt_req_p_salt)))) && - ((encode_buf_len(state, (&(*input).psa_asymmetric_encrypt_req_salt_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_asymmetric_encrypt_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_asymmetric_encrypt_req_output_size)))) && - ((encode_ptr_uint(state, - (&(*input).psa_asymmetric_encrypt_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_asymmetric_decrypt_req(zcbor_state_t *state, - const struct psa_asymmetric_decrypt_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (61)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_decrypt_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_decrypt_req_alg)))) && - ((encode_ptr_buf(state, (&(*input).psa_asymmetric_decrypt_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_asymmetric_decrypt_req_input_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_asymmetric_decrypt_req_p_salt)))) && - ((encode_buf_len(state, (&(*input).psa_asymmetric_decrypt_req_salt_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_asymmetric_decrypt_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_asymmetric_decrypt_req_output_size)))) && - ((encode_ptr_uint(state, - (&(*input).psa_asymmetric_decrypt_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_key_derivation_setup_req(zcbor_state_t *state, - const struct psa_key_derivation_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (62)))) && - ((encode_ptr_uint(state, (&(*input).psa_key_derivation_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_key_derivation_setup_req_alg))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +encode_psa_aead_encrypt_req(zcbor_state_t *state, + const struct psa_aead_encrypt_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (44)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_encrypt_req_p_nonce)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_encrypt_req_nonce_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_aead_encrypt_req_p_additional_data)))) && + ((encode_buf_len( + state, (&(*input).psa_aead_encrypt_req_additional_data_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_encrypt_req_p_plaintext)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_encrypt_req_plaintext_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_aead_encrypt_req_p_ciphertext)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_encrypt_req_ciphertext_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_aead_encrypt_req_p_ciphertext_length))))))); + + log_result(state, res, __func__); + return res; } static bool -encode_psa_key_derivation_get_capacity_req(zcbor_state_t *state, - const struct psa_key_derivation_get_capacity_req *input) -{ - zcbor_log("%s\r\n", __func__); +encode_psa_aead_decrypt_req(zcbor_state_t *state, + const struct psa_aead_decrypt_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (45)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_decrypt_req_p_nonce)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_decrypt_req_nonce_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_aead_decrypt_req_p_additional_data)))) && + ((encode_buf_len( + state, (&(*input).psa_aead_decrypt_req_additional_data_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_aead_decrypt_req_p_ciphertext)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_decrypt_req_ciphertext_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_decrypt_req_p_plaintext)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_decrypt_req_plaintext_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_aead_decrypt_req_p_plaintext_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_aead_encrypt_setup_req( + zcbor_state_t *state, const struct psa_aead_encrypt_setup_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (46)))) && + ((encode_ptr_uint(state, + (&(*input).psa_aead_encrypt_setup_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_encrypt_setup_req_key)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_encrypt_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_aead_decrypt_setup_req( + zcbor_state_t *state, const struct psa_aead_decrypt_setup_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (47)))) && + ((encode_ptr_uint(state, + (&(*input).psa_aead_decrypt_setup_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_decrypt_setup_req_key)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_decrypt_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_aead_generate_nonce_req( + zcbor_state_t *state, const struct psa_aead_generate_nonce_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (48)))) && + ((encode_ptr_uint(state, + (&(*input).psa_aead_generate_nonce_req_p_handle)))) && + ((encode_ptr_buf(state, + (&(*input).psa_aead_generate_nonce_req_p_nonce)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_generate_nonce_req_nonce_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_aead_generate_nonce_req_p_nonce_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (63)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_get_capacity_req_handle)))) && - ((encode_ptr_uint( - state, (&(*input).psa_key_derivation_get_capacity_req_p_capacity))))))); +static bool +encode_psa_aead_set_nonce_req(zcbor_state_t *state, + const struct psa_aead_set_nonce_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_put(state, (49)))) && + ((encode_ptr_uint(state, (&(*input).psa_aead_set_nonce_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_set_nonce_req_p_nonce)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_set_nonce_req_nonce_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } static bool -encode_psa_key_derivation_set_capacity_req(zcbor_state_t *state, - const struct psa_key_derivation_set_capacity_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (64)))) && - ((encode_ptr_uint(state, - (&(*input).psa_key_derivation_set_capacity_req_p_handle)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_set_capacity_req_capacity))))))); +encode_psa_aead_set_lengths_req(zcbor_state_t *state, + const struct psa_aead_set_lengths_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_put(state, (50)))) && + ((encode_ptr_uint(state, + (&(*input).psa_aead_set_lengths_req_p_handle)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_set_lengths_req_ad_length)))) && + ((encode_buf_len( + state, (&(*input).psa_aead_set_lengths_req_plaintext_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } static bool -encode_psa_key_derivation_input_bytes_req(zcbor_state_t *state, - const struct psa_key_derivation_input_bytes_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (65)))) && - ((encode_ptr_uint(state, - (&(*input).psa_key_derivation_input_bytes_req_p_handle)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_key_derivation_input_bytes_req_step)))) && - ((encode_ptr_buf(state, (&(*input).psa_key_derivation_input_bytes_req_p_data)))) && - ((encode_buf_len(state, - (&(*input).psa_key_derivation_input_bytes_req_data_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +encode_psa_aead_update_ad_req(zcbor_state_t *state, + const struct psa_aead_update_ad_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (51)))) && + ((encode_ptr_uint(state, (&(*input).psa_aead_update_ad_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_update_ad_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_update_ad_req_input_length))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_key_derivation_input_integer_req( - zcbor_state_t *state, const struct psa_key_derivation_input_integer_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_aead_update_req(zcbor_state_t *state, + const struct psa_aead_update_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (66)))) && - ((encode_ptr_uint(state, - (&(*input).psa_key_derivation_input_integer_req_p_handle)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_key_derivation_input_integer_req_step)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_input_integer_req_value))))))); + bool res = ((( + ((zcbor_uint32_put(state, (52)))) && + ((encode_ptr_uint(state, (&(*input).psa_aead_update_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_update_req_p_input)))) && + ((encode_buf_len(state, (&(*input).psa_aead_update_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_update_req_p_output)))) && + ((encode_buf_len(state, (&(*input).psa_aead_update_req_output_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_aead_update_req_p_output_length))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} - return tmp_result; +static bool +encode_psa_aead_finish_req(zcbor_state_t *state, + const struct psa_aead_finish_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (53)))) && + ((encode_ptr_uint(state, (&(*input).psa_aead_finish_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_finish_req_p_ciphertext)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_finish_req_ciphertext_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_aead_finish_req_p_ciphertext_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_finish_req_p_tag)))) && + ((encode_buf_len(state, (&(*input).psa_aead_finish_req_tag_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_aead_finish_req_p_tag_length))))))); + + log_result(state, res, __func__); + return res; } static bool -encode_psa_key_derivation_input_key_req(zcbor_state_t *state, - const struct psa_key_derivation_input_key_req *input) -{ - zcbor_log("%s\r\n", __func__); +encode_psa_aead_verify_req(zcbor_state_t *state, + const struct psa_aead_verify_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = ((( - ((zcbor_uint32_put(state, (67)))) && - ((encode_ptr_uint(state, (&(*input).psa_key_derivation_input_key_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_key_derivation_input_key_req_step)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_key_derivation_input_key_req_key))))))); + bool res = (( + (((zcbor_uint32_put(state, (54)))) && + ((encode_ptr_uint(state, (&(*input).psa_aead_verify_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_verify_req_p_plaintext)))) && + ((encode_buf_len(state, + (&(*input).psa_aead_verify_req_plaintext_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_aead_verify_req_p_plaintext_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_aead_verify_req_p_tag)))) && + ((encode_buf_len(state, (&(*input).psa_aead_verify_req_tag_length))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} - return tmp_result; +static bool encode_psa_aead_abort_req(zcbor_state_t *state, + const struct psa_aead_abort_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (55)))) && + ((encode_ptr_uint(state, (&(*input).psa_aead_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_key_derivation_key_agreement_req( - zcbor_state_t *state, const struct psa_key_derivation_key_agreement_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (68)))) && - ((encode_ptr_uint(state, - (&(*input).psa_key_derivation_key_agreement_req_p_handle)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_key_derivation_key_agreement_req_step)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_key_agreement_req_private_key)))) && - ((encode_ptr_buf( - state, (&(*input).psa_key_derivation_key_agreement_req_p_peer_key)))) && - ((encode_buf_len( - state, - (&(*input).psa_key_derivation_key_agreement_req_peer_key_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool +encode_psa_sign_message_req(zcbor_state_t *state, + const struct psa_sign_message_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (56)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_sign_message_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_sign_message_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_sign_message_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_sign_message_req_input_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_sign_message_req_p_signature)))) && + ((encode_buf_len(state, + (&(*input).psa_sign_message_req_signature_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_sign_message_req_p_signature_length))))))); + + log_result(state, res, __func__); + return res; } static bool -encode_psa_key_derivation_output_bytes_req(zcbor_state_t *state, - const struct psa_key_derivation_output_bytes_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (69)))) && - ((encode_ptr_uint(state, - (&(*input).psa_key_derivation_output_bytes_req_p_handle)))) && - ((encode_ptr_buf(state, - (&(*input).psa_key_derivation_output_bytes_req_p_output)))) && - ((encode_buf_len( - state, (&(*input).psa_key_derivation_output_bytes_req_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +encode_psa_verify_message_req(zcbor_state_t *state, + const struct psa_verify_message_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (57)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_verify_message_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_verify_message_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_verify_message_req_p_input)))) && + ((encode_buf_len(state, + (&(*input).psa_verify_message_req_input_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_verify_message_req_p_signature)))) && + ((encode_buf_len( + state, (&(*input).psa_verify_message_req_signature_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_sign_hash_req(zcbor_state_t *state, + const struct psa_sign_hash_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (58)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_sign_hash_req_p_hash)))) && + ((encode_buf_len(state, (&(*input).psa_sign_hash_req_hash_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_sign_hash_req_p_signature)))) && + ((encode_buf_len(state, (&(*input).psa_sign_hash_req_signature_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_sign_hash_req_p_signature_length))))))); + + log_result(state, res, __func__); + return res; } static bool -encode_psa_key_derivation_output_key_req(zcbor_state_t *state, - const struct psa_key_derivation_output_key_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (70)))) && - ((encode_ptr_attr(state, - (&(*input).psa_key_derivation_output_key_req_p_attributes)))) && - ((encode_ptr_uint(state, - (&(*input).psa_key_derivation_output_key_req_p_handle)))) && - ((encode_ptr_key(state, (&(*input).psa_key_derivation_output_key_req_p_key))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_key_derivation_abort_req(zcbor_state_t *state, - const struct psa_key_derivation_abort_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (71)))) && - ((encode_ptr_uint(state, (&(*input).psa_key_derivation_abort_req_p_handle))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_raw_key_agreement_req(zcbor_state_t *state, - const struct psa_raw_key_agreement_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (72)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_raw_key_agreement_req_alg)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_raw_key_agreement_req_private_key)))) && - ((encode_ptr_buf(state, (&(*input).psa_raw_key_agreement_req_p_peer_key)))) && - ((encode_buf_len(state, (&(*input).psa_raw_key_agreement_req_peer_key_length)))) && - ((encode_ptr_buf(state, (&(*input).psa_raw_key_agreement_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_raw_key_agreement_req_output_size)))) && - ((encode_ptr_uint(state, - (&(*input).psa_raw_key_agreement_req_p_output_length))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_generate_random_req(zcbor_state_t *state, - const struct psa_generate_random_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (73)))) && - ((encode_ptr_buf(state, (&(*input).psa_generate_random_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_generate_random_req_output_size))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_generate_key_req(zcbor_state_t *state, - const struct psa_generate_key_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (74)))) && - ((encode_ptr_attr(state, (&(*input).psa_generate_key_req_p_attributes)))) && - ((encode_ptr_key(state, (&(*input).psa_generate_key_req_p_key))))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_ptr_cipher(zcbor_state_t *state, const uint32_t *input) -{ - zcbor_log("%s\r\n", __func__); +encode_psa_verify_hash_req(zcbor_state_t *state, + const struct psa_verify_hash_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (59)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_verify_hash_req_key)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_verify_hash_req_alg)))) && + ((encode_ptr_buf(state, (&(*input).psa_verify_hash_req_p_hash)))) && + ((encode_buf_len(state, (&(*input).psa_verify_hash_req_hash_length)))) && + ((encode_ptr_buf(state, (&(*input).psa_verify_hash_req_p_signature)))) && + ((encode_buf_len(state, + (&(*input).psa_verify_hash_req_signature_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_asymmetric_encrypt_req( + zcbor_state_t *state, const struct psa_asymmetric_encrypt_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (60)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_asymmetric_encrypt_req_key)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_asymmetric_encrypt_req_alg)))) && + ((encode_ptr_buf(state, + (&(*input).psa_asymmetric_encrypt_req_p_input)))) && + ((encode_buf_len( + state, (&(*input).psa_asymmetric_encrypt_req_input_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_asymmetric_encrypt_req_p_salt)))) && + ((encode_buf_len(state, + (&(*input).psa_asymmetric_encrypt_req_salt_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_asymmetric_encrypt_req_p_output)))) && + ((encode_buf_len(state, + (&(*input).psa_asymmetric_encrypt_req_output_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_asymmetric_encrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_asymmetric_decrypt_req( + zcbor_state_t *state, const struct psa_asymmetric_decrypt_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (61)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_asymmetric_decrypt_req_key)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_asymmetric_decrypt_req_alg)))) && + ((encode_ptr_buf(state, + (&(*input).psa_asymmetric_decrypt_req_p_input)))) && + ((encode_buf_len( + state, (&(*input).psa_asymmetric_decrypt_req_input_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_asymmetric_decrypt_req_p_salt)))) && + ((encode_buf_len(state, + (&(*input).psa_asymmetric_decrypt_req_salt_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_asymmetric_decrypt_req_p_output)))) && + ((encode_buf_len(state, + (&(*input).psa_asymmetric_decrypt_req_output_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_asymmetric_decrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_key_derivation_setup_req( + zcbor_state_t *state, const struct psa_key_derivation_setup_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (62)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_setup_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_setup_req_alg))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_key_derivation_get_capacity_req( + zcbor_state_t *state, + const struct psa_key_derivation_get_capacity_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (63)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_get_capacity_req_handle)))) && + ((encode_ptr_uint( + state, + (&(*input).psa_key_derivation_get_capacity_req_p_capacity))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_key_derivation_set_capacity_req( + zcbor_state_t *state, + const struct psa_key_derivation_set_capacity_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (64)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_set_capacity_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_set_capacity_req_capacity))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_key_derivation_input_bytes_req( + zcbor_state_t *state, + const struct psa_key_derivation_input_bytes_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (65)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_input_bytes_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_input_bytes_req_step)))) && + ((encode_ptr_buf( + state, (&(*input).psa_key_derivation_input_bytes_req_p_data)))) && + ((encode_buf_len( + state, + (&(*input).psa_key_derivation_input_bytes_req_data_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - ((zcbor_tag_put(state, 32775) && (zcbor_uint32_encode(state, (&(*input)))))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_psa_pake_setup_req(zcbor_state_t *state, const struct psa_pake_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (79)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_setup_req_password_key)))) && - ((encode_ptr_cipher(state, (&(*input).psa_pake_setup_req_p_cipher_suite))))))); +static bool encode_psa_key_derivation_input_integer_req( + zcbor_state_t *state, + const struct psa_key_derivation_input_integer_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_put(state, (66)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_input_integer_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_input_integer_req_step)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_input_integer_req_value))))))); - return tmp_result; -} - -static bool encode_psa_pake_set_role_req(zcbor_state_t *state, - const struct psa_pake_set_role_req *input) -{ - zcbor_log("%s\r\n", __func__); + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (80)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_set_role_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_role_req_role))))))); +static bool encode_psa_key_derivation_input_key_req( + zcbor_state_t *state, + const struct psa_key_derivation_input_key_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_put(state, (67)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_input_key_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_input_key_req_step)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_input_key_req_key))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_pake_set_user_req(zcbor_state_t *state, - const struct psa_pake_set_user_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_psa_key_derivation_key_agreement_req( + zcbor_state_t *state, + const struct psa_key_derivation_key_agreement_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (68)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_key_agreement_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_key_agreement_req_step)))) && + ((zcbor_uint32_encode( + state, + (&(*input).psa_key_derivation_key_agreement_req_private_key)))) && + ((encode_ptr_buf( + state, + (&(*input).psa_key_derivation_key_agreement_req_p_peer_key)))) && + ((encode_buf_len( + state, + (&(*input) + .psa_key_derivation_key_agreement_req_peer_key_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_key_derivation_output_bytes_req( + zcbor_state_t *state, + const struct psa_key_derivation_output_bytes_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (69)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_output_bytes_req_p_handle)))) && + ((encode_ptr_buf( + state, (&(*input).psa_key_derivation_output_bytes_req_p_output)))) && + ((encode_buf_len( + state, + (&(*input).psa_key_derivation_output_bytes_req_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_key_derivation_output_key_req( + zcbor_state_t *state, + const struct psa_key_derivation_output_key_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (70)))) && + ((encode_ptr_attr( + state, + (&(*input).psa_key_derivation_output_key_req_p_attributes)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_output_key_req_p_handle)))) && + ((encode_ptr_key( + state, (&(*input).psa_key_derivation_output_key_req_p_key))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_key_derivation_abort_req( + zcbor_state_t *state, const struct psa_key_derivation_abort_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (71)))) && + ((encode_ptr_uint( + state, (&(*input).psa_key_derivation_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_raw_key_agreement_req( + zcbor_state_t *state, const struct psa_raw_key_agreement_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (72)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_raw_key_agreement_req_alg)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_raw_key_agreement_req_private_key)))) && + ((encode_ptr_buf(state, + (&(*input).psa_raw_key_agreement_req_p_peer_key)))) && + ((encode_buf_len( + state, (&(*input).psa_raw_key_agreement_req_peer_key_length)))) && + ((encode_ptr_buf(state, + (&(*input).psa_raw_key_agreement_req_p_output)))) && + ((encode_buf_len( + state, (&(*input).psa_raw_key_agreement_req_output_size)))) && + ((encode_ptr_uint( + state, (&(*input).psa_raw_key_agreement_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (81)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_set_user_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_pake_set_user_req_p_user_id)))) && - ((encode_buf_len(state, (&(*input).psa_pake_set_user_req_user_id_len))))))); +static bool +encode_psa_generate_random_req(zcbor_state_t *state, + const struct psa_generate_random_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_put(state, (73)))) && + ((encode_ptr_buf(state, (&(*input).psa_generate_random_req_p_output)))) && + ((encode_buf_len(state, + (&(*input).psa_generate_random_req_output_size))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_pake_set_peer_req(zcbor_state_t *state, - const struct psa_pake_set_peer_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (82)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_set_peer_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_pake_set_peer_req_p_peer_id)))) && - ((encode_buf_len(state, (&(*input).psa_pake_set_peer_req_peer_id_len))))))); +static bool +encode_psa_generate_key_req(zcbor_state_t *state, + const struct psa_generate_key_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((((zcbor_uint32_put(state, (74)))) && + ((encode_ptr_attr(state, + (&(*input).psa_generate_key_req_p_attributes)))) && + ((encode_ptr_key(state, (&(*input).psa_generate_key_req_p_key))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_pake_set_context_req(zcbor_state_t *state, - const struct psa_pake_set_context_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_ptr_cipher(zcbor_state_t *state, const uint32_t *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (83)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_set_context_req_p_handle)))) && - ((encode_ptr_buf(state, (&(*input).psa_pake_set_context_req_p_context)))) && - ((encode_buf_len(state, (&(*input).psa_pake_set_context_req_context_len))))))); + bool res = ((zcbor_tag_put(state, 32775) && + (zcbor_uint32_encode(state, (&(*input)))))); + + log_result(state, res, __func__); + return res; +} - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } +static bool encode_psa_pake_setup_req(zcbor_state_t *state, + const struct psa_pake_setup_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = + (((((zcbor_uint32_put(state, (79)))) && + ((encode_ptr_uint(state, (&(*input).psa_pake_setup_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_pake_setup_req_password_key)))) && + ((encode_ptr_cipher( + state, (&(*input).psa_pake_setup_req_p_cipher_suite))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_pake_output_req(zcbor_state_t *state, - const struct psa_pake_output_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (84)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_output_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_output_req_step)))) && - ((encode_ptr_buf(state, (&(*input).psa_pake_output_req_p_output)))) && - ((encode_buf_len(state, (&(*input).psa_pake_output_req_output_size)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_output_req_p_output_length))))))); +static bool +encode_psa_pake_set_role_req(zcbor_state_t *state, + const struct psa_pake_set_role_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = ((( + ((zcbor_uint32_put(state, (80)))) && + ((encode_ptr_uint(state, (&(*input).psa_pake_set_role_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_role_req_role))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_pake_input_req(zcbor_state_t *state, const struct psa_pake_input_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_pake_set_user_req(zcbor_state_t *state, + const struct psa_pake_set_user_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (85)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_input_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_input_req_step)))) && - ((encode_ptr_buf(state, (&(*input).psa_pake_input_req_p_input)))) && - ((encode_buf_len(state, (&(*input).psa_pake_input_req_input_length))))))); + bool res = (( + (((zcbor_uint32_put(state, (81)))) && + ((encode_ptr_uint(state, (&(*input).psa_pake_set_user_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_pake_set_user_req_p_user_id)))) && + ((encode_buf_len(state, + (&(*input).psa_pake_set_user_req_user_id_len))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} + +static bool +encode_psa_pake_set_peer_req(zcbor_state_t *state, + const struct psa_pake_set_peer_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = (( + (((zcbor_uint32_put(state, (82)))) && + ((encode_ptr_uint(state, (&(*input).psa_pake_set_peer_req_p_handle)))) && + ((encode_ptr_buf(state, (&(*input).psa_pake_set_peer_req_p_peer_id)))) && + ((encode_buf_len(state, + (&(*input).psa_pake_set_peer_req_peer_id_len))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_pake_get_shared_key_req(zcbor_state_t *state, - const struct psa_pake_get_shared_key_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool +encode_psa_pake_set_context_req(zcbor_state_t *state, + const struct psa_pake_set_context_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (( - (((zcbor_uint32_put(state, (86)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_get_shared_key_req_p_handle)))) && - ((encode_ptr_attr(state, (&(*input).psa_pake_get_shared_key_req_p_attributes)))) && - ((encode_ptr_key(state, (&(*input).psa_pake_get_shared_key_req_p_key))))))); + bool res = + (((((zcbor_uint32_put(state, (83)))) && + ((encode_ptr_uint(state, + (&(*input).psa_pake_set_context_req_p_handle)))) && + ((encode_ptr_buf(state, + (&(*input).psa_pake_set_context_req_p_context)))) && + ((encode_buf_len( + state, (&(*input).psa_pake_set_context_req_context_len))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +encode_psa_pake_output_req(zcbor_state_t *state, + const struct psa_pake_output_req *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (( + (((zcbor_uint32_put(state, (84)))) && + ((encode_ptr_uint(state, (&(*input).psa_pake_output_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_output_req_step)))) && + ((encode_ptr_buf(state, (&(*input).psa_pake_output_req_p_output)))) && + ((encode_buf_len(state, (&(*input).psa_pake_output_req_output_size)))) && + ((encode_ptr_uint(state, + (&(*input).psa_pake_output_req_p_output_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_pake_abort_req(zcbor_state_t *state, const struct psa_pake_abort_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_psa_pake_input_req(zcbor_state_t *state, + const struct psa_pake_input_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((((zcbor_uint32_put(state, (87)))) && - ((encode_ptr_uint(state, (&(*input).psa_pake_abort_req_p_handle))))))); + bool res = ((( + ((zcbor_uint32_put(state, (85)))) && + ((encode_ptr_uint(state, (&(*input).psa_pake_input_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_input_req_step)))) && + ((encode_ptr_buf(state, (&(*input).psa_pake_input_req_p_input)))) && + ((encode_buf_len(state, (&(*input).psa_pake_input_req_input_length))))))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_pake_get_shared_key_req( + zcbor_state_t *state, const struct psa_pake_get_shared_key_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = + (((((zcbor_uint32_put(state, (86)))) && + ((encode_ptr_uint( + state, (&(*input).psa_pake_get_shared_key_req_p_handle)))) && + ((encode_ptr_attr( + state, (&(*input).psa_pake_get_shared_key_req_p_attributes)))) && + ((encode_ptr_key(state, + (&(*input).psa_pake_get_shared_key_req_p_key))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_psa_crypto_rsp(zcbor_state_t *state, const struct psa_crypto_rsp *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_psa_pake_abort_req(zcbor_state_t *state, + const struct psa_pake_abort_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (87)))) && + ((encode_ptr_uint(state, (&(*input).psa_pake_abort_req_p_handle))))))); - bool tmp_result = (((zcbor_list_start_encode(state, 2) && - ((((zcbor_uint32_encode(state, (&(*input).psa_crypto_rsp_id)))) && - ((zcbor_int32_encode(state, (&(*input).psa_crypto_rsp_status))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 2)))); + log_result(state, res, __func__); + return res; +} + +static bool encode_psa_crypto_rsp(zcbor_state_t *state, + const struct psa_crypto_rsp *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = + (((zcbor_list_start_encode(state, 2) && + ((((zcbor_uint32_encode(state, (&(*input).psa_crypto_rsp_id)))) && + ((zcbor_int32_encode(state, (&(*input).psa_crypto_rsp_status))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 2)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_psa_crypto_req(zcbor_state_t *state, const struct psa_crypto_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_psa_crypto_req(zcbor_state_t *state, + const struct psa_crypto_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (((zcbor_list_start_encode(state, 12) && ((((((*input).psa_crypto_req_msg_choice == psa_crypto_req_msg_psa_crypto_init_req_m_c) ? ((zcbor_uint32_put(state, (10)))) + bool res = (((zcbor_list_start_encode(state, 12) && ((((((*input).psa_crypto_req_msg_choice == psa_crypto_req_msg_psa_crypto_init_req_m_c) ? ((zcbor_uint32_put(state, (10)))) : (((*input).psa_crypto_req_msg_choice == psa_crypto_req_msg_psa_get_key_attributes_req_m_c) ? ((encode_psa_get_key_attributes_req(state, (&(*input).psa_crypto_req_msg_psa_get_key_attributes_req_m)))) : (((*input).psa_crypto_req_msg_choice == psa_crypto_req_msg_psa_reset_key_attributes_req_m_c) ? ((encode_psa_reset_key_attributes_req(state, (&(*input).psa_crypto_req_msg_psa_reset_key_attributes_req_m)))) : (((*input).psa_crypto_req_msg_choice == psa_crypto_req_msg_psa_purge_key_req_m_c) ? ((encode_psa_purge_key_req(state, (&(*input).psa_crypto_req_msg_psa_purge_key_req_m)))) @@ -1981,32 +1668,28 @@ static bool encode_psa_crypto_req(zcbor_state_t *state, const struct psa_crypto_ : (((*input).psa_crypto_req_msg_choice == psa_crypto_req_msg_psa_pake_abort_req_m_c) ? ((encode_psa_pake_abort_req(state, (&(*input).psa_crypto_req_msg_psa_pake_abort_req_m)))) : false)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) || (zcbor_list_map_end_force_encode(state), false)) && zcbor_list_end_encode(state, 12)))); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; + log_result(state, res, __func__); + return res; } int cbor_encode_psa_crypto_req(uint8_t *payload, size_t payload_len, - const struct psa_crypto_req *input, size_t *payload_len_out) -{ - zcbor_state_t states[4]; + const struct psa_crypto_req *input, + size_t *payload_len_out) { + zcbor_state_t states[4]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_psa_crypto_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_psa_crypto_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } int cbor_encode_psa_crypto_rsp(uint8_t *payload, size_t payload_len, - const struct psa_crypto_rsp *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_psa_crypto_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + const struct psa_crypto_rsp *input, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_psa_crypto_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_encode.h b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_encode.h index 5933ac601bd6..60853c0d6d71 100644 --- a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_encode.h +++ b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_encode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,25 +13,28 @@ #ifndef PSA_CRYPTO_SERVICE_ENCODE_H__ #define PSA_CRYPTO_SERVICE_ENCODE_H__ -#include +#include "psa_crypto_service_types.h" #include #include +#include #include -#include "psa_crypto_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif int cbor_encode_psa_crypto_req(uint8_t *payload, size_t payload_len, - const struct psa_crypto_req *input, size_t *payload_len_out); + const struct psa_crypto_req *input, + size_t *payload_len_out); int cbor_encode_psa_crypto_rsp(uint8_t *payload, size_t payload_len, - const struct psa_crypto_rsp *input, size_t *payload_len_out); + const struct psa_crypto_rsp *input, + size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_types.h b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_types.h index 26e9c0a67367..0f1de12ec496 100644 --- a/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_types.h +++ b/subsys/sdfw_services/services/psa_crypto/zcbor_generated/psa_crypto_service_types.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.99 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,9 +13,9 @@ #ifndef PSA_CRYPTO_SERVICE_TYPES_H__ #define PSA_CRYPTO_SERVICE_TYPES_H__ -#include #include #include +#include #ifdef __cplusplus extern "C" { @@ -31,679 +31,693 @@ extern "C" { #define DEFAULT_MAX_QTY 3 struct psa_crypto_rsp { - uint32_t psa_crypto_rsp_id; - int32_t psa_crypto_rsp_status; + uint32_t psa_crypto_rsp_id; + int32_t psa_crypto_rsp_status; }; struct psa_get_key_attributes_req { - uint32_t psa_get_key_attributes_req_key; - uint32_t psa_get_key_attributes_req_p_attributes; + uint32_t psa_get_key_attributes_req_key; + uint32_t psa_get_key_attributes_req_p_attributes; }; struct psa_reset_key_attributes_req { - uint32_t psa_reset_key_attributes_req_p_attributes; + uint32_t psa_reset_key_attributes_req_p_attributes; }; struct psa_purge_key_req { - uint32_t psa_purge_key_req_key; + uint32_t psa_purge_key_req_key; }; struct psa_copy_key_req { - uint32_t psa_copy_key_req_source_key; - uint32_t psa_copy_key_req_p_attributes; - uint32_t psa_copy_key_req_p_target_key; + uint32_t psa_copy_key_req_source_key; + uint32_t psa_copy_key_req_p_attributes; + uint32_t psa_copy_key_req_p_target_key; }; struct psa_destroy_key_req { - uint32_t psa_destroy_key_req_key; + uint32_t psa_destroy_key_req_key; }; struct psa_import_key_req { - uint32_t psa_import_key_req_p_attributes; - uint32_t psa_import_key_req_p_data; - uint32_t psa_import_key_req_data_length; - uint32_t psa_import_key_req_p_key; + uint32_t psa_import_key_req_p_attributes; + uint32_t psa_import_key_req_p_data; + uint32_t psa_import_key_req_data_length; + uint32_t psa_import_key_req_p_key; }; struct psa_export_key_req { - uint32_t psa_export_key_req_key; - uint32_t psa_export_key_req_p_data; - uint32_t psa_export_key_req_data_size; - uint32_t psa_export_key_req_p_data_length; + uint32_t psa_export_key_req_key; + uint32_t psa_export_key_req_p_data; + uint32_t psa_export_key_req_data_size; + uint32_t psa_export_key_req_p_data_length; }; struct psa_export_public_key_req { - uint32_t psa_export_public_key_req_key; - uint32_t psa_export_public_key_req_p_data; - uint32_t psa_export_public_key_req_data_size; - uint32_t psa_export_public_key_req_p_data_length; + uint32_t psa_export_public_key_req_key; + uint32_t psa_export_public_key_req_p_data; + uint32_t psa_export_public_key_req_data_size; + uint32_t psa_export_public_key_req_p_data_length; }; struct psa_hash_compute_req { - uint32_t psa_hash_compute_req_alg; - uint32_t psa_hash_compute_req_p_input; - uint32_t psa_hash_compute_req_input_length; - uint32_t psa_hash_compute_req_p_hash; - uint32_t psa_hash_compute_req_hash_size; - uint32_t psa_hash_compute_req_p_hash_length; + uint32_t psa_hash_compute_req_alg; + uint32_t psa_hash_compute_req_p_input; + uint32_t psa_hash_compute_req_input_length; + uint32_t psa_hash_compute_req_p_hash; + uint32_t psa_hash_compute_req_hash_size; + uint32_t psa_hash_compute_req_p_hash_length; }; struct psa_hash_compare_req { - uint32_t psa_hash_compare_req_alg; - uint32_t psa_hash_compare_req_p_input; - uint32_t psa_hash_compare_req_input_length; - uint32_t psa_hash_compare_req_p_hash; - uint32_t psa_hash_compare_req_hash_length; + uint32_t psa_hash_compare_req_alg; + uint32_t psa_hash_compare_req_p_input; + uint32_t psa_hash_compare_req_input_length; + uint32_t psa_hash_compare_req_p_hash; + uint32_t psa_hash_compare_req_hash_length; }; struct psa_hash_setup_req { - uint32_t psa_hash_setup_req_p_handle; - uint32_t psa_hash_setup_req_alg; + uint32_t psa_hash_setup_req_p_handle; + uint32_t psa_hash_setup_req_alg; }; struct psa_hash_update_req { - uint32_t psa_hash_update_req_p_handle; - uint32_t psa_hash_update_req_p_input; - uint32_t psa_hash_update_req_input_length; + uint32_t psa_hash_update_req_p_handle; + uint32_t psa_hash_update_req_p_input; + uint32_t psa_hash_update_req_input_length; }; struct psa_hash_finish_req { - uint32_t psa_hash_finish_req_p_handle; - uint32_t psa_hash_finish_req_p_hash; - uint32_t psa_hash_finish_req_hash_size; - uint32_t psa_hash_finish_req_p_hash_length; + uint32_t psa_hash_finish_req_p_handle; + uint32_t psa_hash_finish_req_p_hash; + uint32_t psa_hash_finish_req_hash_size; + uint32_t psa_hash_finish_req_p_hash_length; }; struct psa_hash_verify_req { - uint32_t psa_hash_verify_req_p_handle; - uint32_t psa_hash_verify_req_p_hash; - uint32_t psa_hash_verify_req_hash_length; + uint32_t psa_hash_verify_req_p_handle; + uint32_t psa_hash_verify_req_p_hash; + uint32_t psa_hash_verify_req_hash_length; }; struct psa_hash_abort_req { - uint32_t psa_hash_abort_req_p_handle; + uint32_t psa_hash_abort_req_p_handle; }; struct psa_hash_clone_req { - uint32_t psa_hash_clone_req_handle; - uint32_t psa_hash_clone_req_p_handle; + uint32_t psa_hash_clone_req_handle; + uint32_t psa_hash_clone_req_p_handle; }; struct psa_mac_compute_req { - uint32_t psa_mac_compute_req_key; - uint32_t psa_mac_compute_req_alg; - uint32_t psa_mac_compute_req_p_input; - uint32_t psa_mac_compute_req_input_length; - uint32_t psa_mac_compute_req_p_mac; - uint32_t psa_mac_compute_req_mac_size; - uint32_t psa_mac_compute_req_p_mac_length; + uint32_t psa_mac_compute_req_key; + uint32_t psa_mac_compute_req_alg; + uint32_t psa_mac_compute_req_p_input; + uint32_t psa_mac_compute_req_input_length; + uint32_t psa_mac_compute_req_p_mac; + uint32_t psa_mac_compute_req_mac_size; + uint32_t psa_mac_compute_req_p_mac_length; }; struct psa_mac_verify_req { - uint32_t psa_mac_verify_req_key; - uint32_t psa_mac_verify_req_alg; - uint32_t psa_mac_verify_req_p_input; - uint32_t psa_mac_verify_req_input_length; - uint32_t psa_mac_verify_req_p_mac; - uint32_t psa_mac_verify_req_mac_length; + uint32_t psa_mac_verify_req_key; + uint32_t psa_mac_verify_req_alg; + uint32_t psa_mac_verify_req_p_input; + uint32_t psa_mac_verify_req_input_length; + uint32_t psa_mac_verify_req_p_mac; + uint32_t psa_mac_verify_req_mac_length; }; struct psa_mac_sign_setup_req { - uint32_t psa_mac_sign_setup_req_p_handle; - uint32_t psa_mac_sign_setup_req_key; - uint32_t psa_mac_sign_setup_req_alg; + uint32_t psa_mac_sign_setup_req_p_handle; + uint32_t psa_mac_sign_setup_req_key; + uint32_t psa_mac_sign_setup_req_alg; }; struct psa_mac_verify_setup_req { - uint32_t psa_mac_verify_setup_req_p_handle; - uint32_t psa_mac_verify_setup_req_key; - uint32_t psa_mac_verify_setup_req_alg; + uint32_t psa_mac_verify_setup_req_p_handle; + uint32_t psa_mac_verify_setup_req_key; + uint32_t psa_mac_verify_setup_req_alg; }; struct psa_mac_update_req { - uint32_t psa_mac_update_req_p_handle; - uint32_t psa_mac_update_req_p_input; - uint32_t psa_mac_update_req_input_length; + uint32_t psa_mac_update_req_p_handle; + uint32_t psa_mac_update_req_p_input; + uint32_t psa_mac_update_req_input_length; }; struct psa_mac_sign_finish_req { - uint32_t psa_mac_sign_finish_req_p_handle; - uint32_t psa_mac_sign_finish_req_p_mac; - uint32_t psa_mac_sign_finish_req_mac_size; - uint32_t psa_mac_sign_finish_req_p_mac_length; + uint32_t psa_mac_sign_finish_req_p_handle; + uint32_t psa_mac_sign_finish_req_p_mac; + uint32_t psa_mac_sign_finish_req_mac_size; + uint32_t psa_mac_sign_finish_req_p_mac_length; }; struct psa_mac_verify_finish_req { - uint32_t psa_mac_verify_finish_req_p_handle; - uint32_t psa_mac_verify_finish_req_p_mac; - uint32_t psa_mac_verify_finish_req_mac_length; + uint32_t psa_mac_verify_finish_req_p_handle; + uint32_t psa_mac_verify_finish_req_p_mac; + uint32_t psa_mac_verify_finish_req_mac_length; }; struct psa_mac_abort_req { - uint32_t psa_mac_abort_req_p_handle; + uint32_t psa_mac_abort_req_p_handle; }; struct psa_cipher_encrypt_req { - uint32_t psa_cipher_encrypt_req_key; - uint32_t psa_cipher_encrypt_req_alg; - uint32_t psa_cipher_encrypt_req_p_input; - uint32_t psa_cipher_encrypt_req_input_length; - uint32_t psa_cipher_encrypt_req_p_output; - uint32_t psa_cipher_encrypt_req_output_size; - uint32_t psa_cipher_encrypt_req_p_output_length; + uint32_t psa_cipher_encrypt_req_key; + uint32_t psa_cipher_encrypt_req_alg; + uint32_t psa_cipher_encrypt_req_p_input; + uint32_t psa_cipher_encrypt_req_input_length; + uint32_t psa_cipher_encrypt_req_p_output; + uint32_t psa_cipher_encrypt_req_output_size; + uint32_t psa_cipher_encrypt_req_p_output_length; }; struct psa_cipher_decrypt_req { - uint32_t psa_cipher_decrypt_req_key; - uint32_t psa_cipher_decrypt_req_alg; - uint32_t psa_cipher_decrypt_req_p_input; - uint32_t psa_cipher_decrypt_req_input_length; - uint32_t psa_cipher_decrypt_req_p_output; - uint32_t psa_cipher_decrypt_req_output_size; - uint32_t psa_cipher_decrypt_req_p_output_length; + uint32_t psa_cipher_decrypt_req_key; + uint32_t psa_cipher_decrypt_req_alg; + uint32_t psa_cipher_decrypt_req_p_input; + uint32_t psa_cipher_decrypt_req_input_length; + uint32_t psa_cipher_decrypt_req_p_output; + uint32_t psa_cipher_decrypt_req_output_size; + uint32_t psa_cipher_decrypt_req_p_output_length; }; struct psa_cipher_encrypt_setup_req { - uint32_t psa_cipher_encrypt_setup_req_p_handle; - uint32_t psa_cipher_encrypt_setup_req_key; - uint32_t psa_cipher_encrypt_setup_req_alg; + uint32_t psa_cipher_encrypt_setup_req_p_handle; + uint32_t psa_cipher_encrypt_setup_req_key; + uint32_t psa_cipher_encrypt_setup_req_alg; }; struct psa_cipher_decrypt_setup_req { - uint32_t psa_cipher_decrypt_setup_req_p_handle; - uint32_t psa_cipher_decrypt_setup_req_key; - uint32_t psa_cipher_decrypt_setup_req_alg; + uint32_t psa_cipher_decrypt_setup_req_p_handle; + uint32_t psa_cipher_decrypt_setup_req_key; + uint32_t psa_cipher_decrypt_setup_req_alg; }; struct psa_cipher_generate_iv_req { - uint32_t psa_cipher_generate_iv_req_p_handle; - uint32_t psa_cipher_generate_iv_req_p_iv; - uint32_t psa_cipher_generate_iv_req_iv_size; - uint32_t psa_cipher_generate_iv_req_p_iv_length; + uint32_t psa_cipher_generate_iv_req_p_handle; + uint32_t psa_cipher_generate_iv_req_p_iv; + uint32_t psa_cipher_generate_iv_req_iv_size; + uint32_t psa_cipher_generate_iv_req_p_iv_length; }; struct psa_cipher_set_iv_req { - uint32_t psa_cipher_set_iv_req_p_handle; - uint32_t psa_cipher_set_iv_req_p_iv; - uint32_t psa_cipher_set_iv_req_iv_length; + uint32_t psa_cipher_set_iv_req_p_handle; + uint32_t psa_cipher_set_iv_req_p_iv; + uint32_t psa_cipher_set_iv_req_iv_length; }; struct psa_cipher_update_req { - uint32_t psa_cipher_update_req_p_handle; - uint32_t psa_cipher_update_req_p_input; - uint32_t psa_cipher_update_req_input_length; - uint32_t psa_cipher_update_req_p_output; - uint32_t psa_cipher_update_req_output_size; - uint32_t psa_cipher_update_req_p_output_length; + uint32_t psa_cipher_update_req_p_handle; + uint32_t psa_cipher_update_req_p_input; + uint32_t psa_cipher_update_req_input_length; + uint32_t psa_cipher_update_req_p_output; + uint32_t psa_cipher_update_req_output_size; + uint32_t psa_cipher_update_req_p_output_length; }; struct psa_cipher_finish_req { - uint32_t psa_cipher_finish_req_p_handle; - uint32_t psa_cipher_finish_req_p_output; - uint32_t psa_cipher_finish_req_output_size; - uint32_t psa_cipher_finish_req_p_output_length; + uint32_t psa_cipher_finish_req_p_handle; + uint32_t psa_cipher_finish_req_p_output; + uint32_t psa_cipher_finish_req_output_size; + uint32_t psa_cipher_finish_req_p_output_length; }; struct psa_cipher_abort_req { - uint32_t psa_cipher_abort_req_p_handle; + uint32_t psa_cipher_abort_req_p_handle; }; struct psa_aead_encrypt_req { - uint32_t psa_aead_encrypt_req_key; - uint32_t psa_aead_encrypt_req_alg; - uint32_t psa_aead_encrypt_req_p_nonce; - uint32_t psa_aead_encrypt_req_nonce_length; - uint32_t psa_aead_encrypt_req_p_additional_data; - uint32_t psa_aead_encrypt_req_additional_data_length; - uint32_t psa_aead_encrypt_req_p_plaintext; - uint32_t psa_aead_encrypt_req_plaintext_length; - uint32_t psa_aead_encrypt_req_p_ciphertext; - uint32_t psa_aead_encrypt_req_ciphertext_size; - uint32_t psa_aead_encrypt_req_p_ciphertext_length; + uint32_t psa_aead_encrypt_req_key; + uint32_t psa_aead_encrypt_req_alg; + uint32_t psa_aead_encrypt_req_p_nonce; + uint32_t psa_aead_encrypt_req_nonce_length; + uint32_t psa_aead_encrypt_req_p_additional_data; + uint32_t psa_aead_encrypt_req_additional_data_length; + uint32_t psa_aead_encrypt_req_p_plaintext; + uint32_t psa_aead_encrypt_req_plaintext_length; + uint32_t psa_aead_encrypt_req_p_ciphertext; + uint32_t psa_aead_encrypt_req_ciphertext_size; + uint32_t psa_aead_encrypt_req_p_ciphertext_length; }; struct psa_aead_decrypt_req { - uint32_t psa_aead_decrypt_req_key; - uint32_t psa_aead_decrypt_req_alg; - uint32_t psa_aead_decrypt_req_p_nonce; - uint32_t psa_aead_decrypt_req_nonce_length; - uint32_t psa_aead_decrypt_req_p_additional_data; - uint32_t psa_aead_decrypt_req_additional_data_length; - uint32_t psa_aead_decrypt_req_p_ciphertext; - uint32_t psa_aead_decrypt_req_ciphertext_length; - uint32_t psa_aead_decrypt_req_p_plaintext; - uint32_t psa_aead_decrypt_req_plaintext_size; - uint32_t psa_aead_decrypt_req_p_plaintext_length; + uint32_t psa_aead_decrypt_req_key; + uint32_t psa_aead_decrypt_req_alg; + uint32_t psa_aead_decrypt_req_p_nonce; + uint32_t psa_aead_decrypt_req_nonce_length; + uint32_t psa_aead_decrypt_req_p_additional_data; + uint32_t psa_aead_decrypt_req_additional_data_length; + uint32_t psa_aead_decrypt_req_p_ciphertext; + uint32_t psa_aead_decrypt_req_ciphertext_length; + uint32_t psa_aead_decrypt_req_p_plaintext; + uint32_t psa_aead_decrypt_req_plaintext_size; + uint32_t psa_aead_decrypt_req_p_plaintext_length; }; struct psa_aead_encrypt_setup_req { - uint32_t psa_aead_encrypt_setup_req_p_handle; - uint32_t psa_aead_encrypt_setup_req_key; - uint32_t psa_aead_encrypt_setup_req_alg; + uint32_t psa_aead_encrypt_setup_req_p_handle; + uint32_t psa_aead_encrypt_setup_req_key; + uint32_t psa_aead_encrypt_setup_req_alg; }; struct psa_aead_decrypt_setup_req { - uint32_t psa_aead_decrypt_setup_req_p_handle; - uint32_t psa_aead_decrypt_setup_req_key; - uint32_t psa_aead_decrypt_setup_req_alg; + uint32_t psa_aead_decrypt_setup_req_p_handle; + uint32_t psa_aead_decrypt_setup_req_key; + uint32_t psa_aead_decrypt_setup_req_alg; }; struct psa_aead_generate_nonce_req { - uint32_t psa_aead_generate_nonce_req_p_handle; - uint32_t psa_aead_generate_nonce_req_p_nonce; - uint32_t psa_aead_generate_nonce_req_nonce_size; - uint32_t psa_aead_generate_nonce_req_p_nonce_length; + uint32_t psa_aead_generate_nonce_req_p_handle; + uint32_t psa_aead_generate_nonce_req_p_nonce; + uint32_t psa_aead_generate_nonce_req_nonce_size; + uint32_t psa_aead_generate_nonce_req_p_nonce_length; }; struct psa_aead_set_nonce_req { - uint32_t psa_aead_set_nonce_req_p_handle; - uint32_t psa_aead_set_nonce_req_p_nonce; - uint32_t psa_aead_set_nonce_req_nonce_length; + uint32_t psa_aead_set_nonce_req_p_handle; + uint32_t psa_aead_set_nonce_req_p_nonce; + uint32_t psa_aead_set_nonce_req_nonce_length; }; struct psa_aead_set_lengths_req { - uint32_t psa_aead_set_lengths_req_p_handle; - uint32_t psa_aead_set_lengths_req_ad_length; - uint32_t psa_aead_set_lengths_req_plaintext_length; + uint32_t psa_aead_set_lengths_req_p_handle; + uint32_t psa_aead_set_lengths_req_ad_length; + uint32_t psa_aead_set_lengths_req_plaintext_length; }; struct psa_aead_update_ad_req { - uint32_t psa_aead_update_ad_req_p_handle; - uint32_t psa_aead_update_ad_req_p_input; - uint32_t psa_aead_update_ad_req_input_length; + uint32_t psa_aead_update_ad_req_p_handle; + uint32_t psa_aead_update_ad_req_p_input; + uint32_t psa_aead_update_ad_req_input_length; }; struct psa_aead_update_req { - uint32_t psa_aead_update_req_p_handle; - uint32_t psa_aead_update_req_p_input; - uint32_t psa_aead_update_req_input_length; - uint32_t psa_aead_update_req_p_output; - uint32_t psa_aead_update_req_output_size; - uint32_t psa_aead_update_req_p_output_length; + uint32_t psa_aead_update_req_p_handle; + uint32_t psa_aead_update_req_p_input; + uint32_t psa_aead_update_req_input_length; + uint32_t psa_aead_update_req_p_output; + uint32_t psa_aead_update_req_output_size; + uint32_t psa_aead_update_req_p_output_length; }; struct psa_aead_finish_req { - uint32_t psa_aead_finish_req_p_handle; - uint32_t psa_aead_finish_req_p_ciphertext; - uint32_t psa_aead_finish_req_ciphertext_size; - uint32_t psa_aead_finish_req_p_ciphertext_length; - uint32_t psa_aead_finish_req_p_tag; - uint32_t psa_aead_finish_req_tag_size; - uint32_t psa_aead_finish_req_p_tag_length; + uint32_t psa_aead_finish_req_p_handle; + uint32_t psa_aead_finish_req_p_ciphertext; + uint32_t psa_aead_finish_req_ciphertext_size; + uint32_t psa_aead_finish_req_p_ciphertext_length; + uint32_t psa_aead_finish_req_p_tag; + uint32_t psa_aead_finish_req_tag_size; + uint32_t psa_aead_finish_req_p_tag_length; }; struct psa_aead_verify_req { - uint32_t psa_aead_verify_req_p_handle; - uint32_t psa_aead_verify_req_p_plaintext; - uint32_t psa_aead_verify_req_plaintext_size; - uint32_t psa_aead_verify_req_p_plaintext_length; - uint32_t psa_aead_verify_req_p_tag; - uint32_t psa_aead_verify_req_tag_length; + uint32_t psa_aead_verify_req_p_handle; + uint32_t psa_aead_verify_req_p_plaintext; + uint32_t psa_aead_verify_req_plaintext_size; + uint32_t psa_aead_verify_req_p_plaintext_length; + uint32_t psa_aead_verify_req_p_tag; + uint32_t psa_aead_verify_req_tag_length; }; struct psa_aead_abort_req { - uint32_t psa_aead_abort_req_p_handle; + uint32_t psa_aead_abort_req_p_handle; }; struct psa_sign_message_req { - uint32_t psa_sign_message_req_key; - uint32_t psa_sign_message_req_alg; - uint32_t psa_sign_message_req_p_input; - uint32_t psa_sign_message_req_input_length; - uint32_t psa_sign_message_req_p_signature; - uint32_t psa_sign_message_req_signature_size; - uint32_t psa_sign_message_req_p_signature_length; + uint32_t psa_sign_message_req_key; + uint32_t psa_sign_message_req_alg; + uint32_t psa_sign_message_req_p_input; + uint32_t psa_sign_message_req_input_length; + uint32_t psa_sign_message_req_p_signature; + uint32_t psa_sign_message_req_signature_size; + uint32_t psa_sign_message_req_p_signature_length; }; struct psa_verify_message_req { - uint32_t psa_verify_message_req_key; - uint32_t psa_verify_message_req_alg; - uint32_t psa_verify_message_req_p_input; - uint32_t psa_verify_message_req_input_length; - uint32_t psa_verify_message_req_p_signature; - uint32_t psa_verify_message_req_signature_length; + uint32_t psa_verify_message_req_key; + uint32_t psa_verify_message_req_alg; + uint32_t psa_verify_message_req_p_input; + uint32_t psa_verify_message_req_input_length; + uint32_t psa_verify_message_req_p_signature; + uint32_t psa_verify_message_req_signature_length; }; struct psa_sign_hash_req { - uint32_t psa_sign_hash_req_key; - uint32_t psa_sign_hash_req_alg; - uint32_t psa_sign_hash_req_p_hash; - uint32_t psa_sign_hash_req_hash_length; - uint32_t psa_sign_hash_req_p_signature; - uint32_t psa_sign_hash_req_signature_size; - uint32_t psa_sign_hash_req_p_signature_length; + uint32_t psa_sign_hash_req_key; + uint32_t psa_sign_hash_req_alg; + uint32_t psa_sign_hash_req_p_hash; + uint32_t psa_sign_hash_req_hash_length; + uint32_t psa_sign_hash_req_p_signature; + uint32_t psa_sign_hash_req_signature_size; + uint32_t psa_sign_hash_req_p_signature_length; }; struct psa_verify_hash_req { - uint32_t psa_verify_hash_req_key; - uint32_t psa_verify_hash_req_alg; - uint32_t psa_verify_hash_req_p_hash; - uint32_t psa_verify_hash_req_hash_length; - uint32_t psa_verify_hash_req_p_signature; - uint32_t psa_verify_hash_req_signature_length; + uint32_t psa_verify_hash_req_key; + uint32_t psa_verify_hash_req_alg; + uint32_t psa_verify_hash_req_p_hash; + uint32_t psa_verify_hash_req_hash_length; + uint32_t psa_verify_hash_req_p_signature; + uint32_t psa_verify_hash_req_signature_length; }; struct psa_asymmetric_encrypt_req { - uint32_t psa_asymmetric_encrypt_req_key; - uint32_t psa_asymmetric_encrypt_req_alg; - uint32_t psa_asymmetric_encrypt_req_p_input; - uint32_t psa_asymmetric_encrypt_req_input_length; - uint32_t psa_asymmetric_encrypt_req_p_salt; - uint32_t psa_asymmetric_encrypt_req_salt_length; - uint32_t psa_asymmetric_encrypt_req_p_output; - uint32_t psa_asymmetric_encrypt_req_output_size; - uint32_t psa_asymmetric_encrypt_req_p_output_length; + uint32_t psa_asymmetric_encrypt_req_key; + uint32_t psa_asymmetric_encrypt_req_alg; + uint32_t psa_asymmetric_encrypt_req_p_input; + uint32_t psa_asymmetric_encrypt_req_input_length; + uint32_t psa_asymmetric_encrypt_req_p_salt; + uint32_t psa_asymmetric_encrypt_req_salt_length; + uint32_t psa_asymmetric_encrypt_req_p_output; + uint32_t psa_asymmetric_encrypt_req_output_size; + uint32_t psa_asymmetric_encrypt_req_p_output_length; }; struct psa_asymmetric_decrypt_req { - uint32_t psa_asymmetric_decrypt_req_key; - uint32_t psa_asymmetric_decrypt_req_alg; - uint32_t psa_asymmetric_decrypt_req_p_input; - uint32_t psa_asymmetric_decrypt_req_input_length; - uint32_t psa_asymmetric_decrypt_req_p_salt; - uint32_t psa_asymmetric_decrypt_req_salt_length; - uint32_t psa_asymmetric_decrypt_req_p_output; - uint32_t psa_asymmetric_decrypt_req_output_size; - uint32_t psa_asymmetric_decrypt_req_p_output_length; + uint32_t psa_asymmetric_decrypt_req_key; + uint32_t psa_asymmetric_decrypt_req_alg; + uint32_t psa_asymmetric_decrypt_req_p_input; + uint32_t psa_asymmetric_decrypt_req_input_length; + uint32_t psa_asymmetric_decrypt_req_p_salt; + uint32_t psa_asymmetric_decrypt_req_salt_length; + uint32_t psa_asymmetric_decrypt_req_p_output; + uint32_t psa_asymmetric_decrypt_req_output_size; + uint32_t psa_asymmetric_decrypt_req_p_output_length; }; struct psa_key_derivation_setup_req { - uint32_t psa_key_derivation_setup_req_p_handle; - uint32_t psa_key_derivation_setup_req_alg; + uint32_t psa_key_derivation_setup_req_p_handle; + uint32_t psa_key_derivation_setup_req_alg; }; struct psa_key_derivation_get_capacity_req { - uint32_t psa_key_derivation_get_capacity_req_handle; - uint32_t psa_key_derivation_get_capacity_req_p_capacity; + uint32_t psa_key_derivation_get_capacity_req_handle; + uint32_t psa_key_derivation_get_capacity_req_p_capacity; }; struct psa_key_derivation_set_capacity_req { - uint32_t psa_key_derivation_set_capacity_req_p_handle; - uint32_t psa_key_derivation_set_capacity_req_capacity; + uint32_t psa_key_derivation_set_capacity_req_p_handle; + uint32_t psa_key_derivation_set_capacity_req_capacity; }; struct psa_key_derivation_input_bytes_req { - uint32_t psa_key_derivation_input_bytes_req_p_handle; - uint32_t psa_key_derivation_input_bytes_req_step; - uint32_t psa_key_derivation_input_bytes_req_p_data; - uint32_t psa_key_derivation_input_bytes_req_data_length; + uint32_t psa_key_derivation_input_bytes_req_p_handle; + uint32_t psa_key_derivation_input_bytes_req_step; + uint32_t psa_key_derivation_input_bytes_req_p_data; + uint32_t psa_key_derivation_input_bytes_req_data_length; }; struct psa_key_derivation_input_integer_req { - uint32_t psa_key_derivation_input_integer_req_p_handle; - uint32_t psa_key_derivation_input_integer_req_step; - uint32_t psa_key_derivation_input_integer_req_value; + uint32_t psa_key_derivation_input_integer_req_p_handle; + uint32_t psa_key_derivation_input_integer_req_step; + uint32_t psa_key_derivation_input_integer_req_value; }; struct psa_key_derivation_input_key_req { - uint32_t psa_key_derivation_input_key_req_p_handle; - uint32_t psa_key_derivation_input_key_req_step; - uint32_t psa_key_derivation_input_key_req_key; + uint32_t psa_key_derivation_input_key_req_p_handle; + uint32_t psa_key_derivation_input_key_req_step; + uint32_t psa_key_derivation_input_key_req_key; }; struct psa_key_derivation_key_agreement_req { - uint32_t psa_key_derivation_key_agreement_req_p_handle; - uint32_t psa_key_derivation_key_agreement_req_step; - uint32_t psa_key_derivation_key_agreement_req_private_key; - uint32_t psa_key_derivation_key_agreement_req_p_peer_key; - uint32_t psa_key_derivation_key_agreement_req_peer_key_length; + uint32_t psa_key_derivation_key_agreement_req_p_handle; + uint32_t psa_key_derivation_key_agreement_req_step; + uint32_t psa_key_derivation_key_agreement_req_private_key; + uint32_t psa_key_derivation_key_agreement_req_p_peer_key; + uint32_t psa_key_derivation_key_agreement_req_peer_key_length; }; struct psa_key_derivation_output_bytes_req { - uint32_t psa_key_derivation_output_bytes_req_p_handle; - uint32_t psa_key_derivation_output_bytes_req_p_output; - uint32_t psa_key_derivation_output_bytes_req_output_length; + uint32_t psa_key_derivation_output_bytes_req_p_handle; + uint32_t psa_key_derivation_output_bytes_req_p_output; + uint32_t psa_key_derivation_output_bytes_req_output_length; }; struct psa_key_derivation_output_key_req { - uint32_t psa_key_derivation_output_key_req_p_attributes; - uint32_t psa_key_derivation_output_key_req_p_handle; - uint32_t psa_key_derivation_output_key_req_p_key; + uint32_t psa_key_derivation_output_key_req_p_attributes; + uint32_t psa_key_derivation_output_key_req_p_handle; + uint32_t psa_key_derivation_output_key_req_p_key; }; struct psa_key_derivation_abort_req { - uint32_t psa_key_derivation_abort_req_p_handle; + uint32_t psa_key_derivation_abort_req_p_handle; }; struct psa_raw_key_agreement_req { - uint32_t psa_raw_key_agreement_req_alg; - uint32_t psa_raw_key_agreement_req_private_key; - uint32_t psa_raw_key_agreement_req_p_peer_key; - uint32_t psa_raw_key_agreement_req_peer_key_length; - uint32_t psa_raw_key_agreement_req_p_output; - uint32_t psa_raw_key_agreement_req_output_size; - uint32_t psa_raw_key_agreement_req_p_output_length; + uint32_t psa_raw_key_agreement_req_alg; + uint32_t psa_raw_key_agreement_req_private_key; + uint32_t psa_raw_key_agreement_req_p_peer_key; + uint32_t psa_raw_key_agreement_req_peer_key_length; + uint32_t psa_raw_key_agreement_req_p_output; + uint32_t psa_raw_key_agreement_req_output_size; + uint32_t psa_raw_key_agreement_req_p_output_length; }; struct psa_generate_random_req { - uint32_t psa_generate_random_req_p_output; - uint32_t psa_generate_random_req_output_size; + uint32_t psa_generate_random_req_p_output; + uint32_t psa_generate_random_req_output_size; }; struct psa_generate_key_req { - uint32_t psa_generate_key_req_p_attributes; - uint32_t psa_generate_key_req_p_key; + uint32_t psa_generate_key_req_p_attributes; + uint32_t psa_generate_key_req_p_key; }; struct psa_pake_setup_req { - uint32_t psa_pake_setup_req_p_handle; - uint32_t psa_pake_setup_req_password_key; - uint32_t psa_pake_setup_req_p_cipher_suite; + uint32_t psa_pake_setup_req_p_handle; + uint32_t psa_pake_setup_req_password_key; + uint32_t psa_pake_setup_req_p_cipher_suite; }; struct psa_pake_set_role_req { - uint32_t psa_pake_set_role_req_p_handle; - uint32_t psa_pake_set_role_req_role; + uint32_t psa_pake_set_role_req_p_handle; + uint32_t psa_pake_set_role_req_role; }; struct psa_pake_set_user_req { - uint32_t psa_pake_set_user_req_p_handle; - uint32_t psa_pake_set_user_req_p_user_id; - uint32_t psa_pake_set_user_req_user_id_len; + uint32_t psa_pake_set_user_req_p_handle; + uint32_t psa_pake_set_user_req_p_user_id; + uint32_t psa_pake_set_user_req_user_id_len; }; struct psa_pake_set_peer_req { - uint32_t psa_pake_set_peer_req_p_handle; - uint32_t psa_pake_set_peer_req_p_peer_id; - uint32_t psa_pake_set_peer_req_peer_id_len; + uint32_t psa_pake_set_peer_req_p_handle; + uint32_t psa_pake_set_peer_req_p_peer_id; + uint32_t psa_pake_set_peer_req_peer_id_len; }; struct psa_pake_set_context_req { - uint32_t psa_pake_set_context_req_p_handle; - uint32_t psa_pake_set_context_req_p_context; - uint32_t psa_pake_set_context_req_context_len; + uint32_t psa_pake_set_context_req_p_handle; + uint32_t psa_pake_set_context_req_p_context; + uint32_t psa_pake_set_context_req_context_len; }; struct psa_pake_output_req { - uint32_t psa_pake_output_req_p_handle; - uint32_t psa_pake_output_req_step; - uint32_t psa_pake_output_req_p_output; - uint32_t psa_pake_output_req_output_size; - uint32_t psa_pake_output_req_p_output_length; + uint32_t psa_pake_output_req_p_handle; + uint32_t psa_pake_output_req_step; + uint32_t psa_pake_output_req_p_output; + uint32_t psa_pake_output_req_output_size; + uint32_t psa_pake_output_req_p_output_length; }; struct psa_pake_input_req { - uint32_t psa_pake_input_req_p_handle; - uint32_t psa_pake_input_req_step; - uint32_t psa_pake_input_req_p_input; - uint32_t psa_pake_input_req_input_length; + uint32_t psa_pake_input_req_p_handle; + uint32_t psa_pake_input_req_step; + uint32_t psa_pake_input_req_p_input; + uint32_t psa_pake_input_req_input_length; }; struct psa_pake_get_shared_key_req { - uint32_t psa_pake_get_shared_key_req_p_handle; - uint32_t psa_pake_get_shared_key_req_p_attributes; - uint32_t psa_pake_get_shared_key_req_p_key; + uint32_t psa_pake_get_shared_key_req_p_handle; + uint32_t psa_pake_get_shared_key_req_p_attributes; + uint32_t psa_pake_get_shared_key_req_p_key; }; struct psa_pake_abort_req { - uint32_t psa_pake_abort_req_p_handle; + uint32_t psa_pake_abort_req_p_handle; }; struct psa_crypto_req { - union { - struct psa_get_key_attributes_req psa_crypto_req_msg_psa_get_key_attributes_req_m; - struct psa_reset_key_attributes_req - psa_crypto_req_msg_psa_reset_key_attributes_req_m; - struct psa_purge_key_req psa_crypto_req_msg_psa_purge_key_req_m; - struct psa_copy_key_req psa_crypto_req_msg_psa_copy_key_req_m; - struct psa_destroy_key_req psa_crypto_req_msg_psa_destroy_key_req_m; - struct psa_import_key_req psa_crypto_req_msg_psa_import_key_req_m; - struct psa_export_key_req psa_crypto_req_msg_psa_export_key_req_m; - struct psa_export_public_key_req psa_crypto_req_msg_psa_export_public_key_req_m; - struct psa_hash_compute_req psa_crypto_req_msg_psa_hash_compute_req_m; - struct psa_hash_compare_req psa_crypto_req_msg_psa_hash_compare_req_m; - struct psa_hash_setup_req psa_crypto_req_msg_psa_hash_setup_req_m; - struct psa_hash_update_req psa_crypto_req_msg_psa_hash_update_req_m; - struct psa_hash_finish_req psa_crypto_req_msg_psa_hash_finish_req_m; - struct psa_hash_verify_req psa_crypto_req_msg_psa_hash_verify_req_m; - struct psa_hash_abort_req psa_crypto_req_msg_psa_hash_abort_req_m; - struct psa_hash_clone_req psa_crypto_req_msg_psa_hash_clone_req_m; - struct psa_mac_compute_req psa_crypto_req_msg_psa_mac_compute_req_m; - struct psa_mac_verify_req psa_crypto_req_msg_psa_mac_verify_req_m; - struct psa_mac_sign_setup_req psa_crypto_req_msg_psa_mac_sign_setup_req_m; - struct psa_mac_verify_setup_req psa_crypto_req_msg_psa_mac_verify_setup_req_m; - struct psa_mac_update_req psa_crypto_req_msg_psa_mac_update_req_m; - struct psa_mac_sign_finish_req psa_crypto_req_msg_psa_mac_sign_finish_req_m; - struct psa_mac_verify_finish_req psa_crypto_req_msg_psa_mac_verify_finish_req_m; - struct psa_mac_abort_req psa_crypto_req_msg_psa_mac_abort_req_m; - struct psa_cipher_encrypt_req psa_crypto_req_msg_psa_cipher_encrypt_req_m; - struct psa_cipher_decrypt_req psa_crypto_req_msg_psa_cipher_decrypt_req_m; - struct psa_cipher_encrypt_setup_req - psa_crypto_req_msg_psa_cipher_encrypt_setup_req_m; - struct psa_cipher_decrypt_setup_req - psa_crypto_req_msg_psa_cipher_decrypt_setup_req_m; - struct psa_cipher_generate_iv_req psa_crypto_req_msg_psa_cipher_generate_iv_req_m; - struct psa_cipher_set_iv_req psa_crypto_req_msg_psa_cipher_set_iv_req_m; - struct psa_cipher_update_req psa_crypto_req_msg_psa_cipher_update_req_m; - struct psa_cipher_finish_req psa_crypto_req_msg_psa_cipher_finish_req_m; - struct psa_cipher_abort_req psa_crypto_req_msg_psa_cipher_abort_req_m; - struct psa_aead_encrypt_req psa_crypto_req_msg_psa_aead_encrypt_req_m; - struct psa_aead_decrypt_req psa_crypto_req_msg_psa_aead_decrypt_req_m; - struct psa_aead_encrypt_setup_req psa_crypto_req_msg_psa_aead_encrypt_setup_req_m; - struct psa_aead_decrypt_setup_req psa_crypto_req_msg_psa_aead_decrypt_setup_req_m; - struct psa_aead_generate_nonce_req psa_crypto_req_msg_psa_aead_generate_nonce_req_m; - struct psa_aead_set_nonce_req psa_crypto_req_msg_psa_aead_set_nonce_req_m; - struct psa_aead_set_lengths_req psa_crypto_req_msg_psa_aead_set_lengths_req_m; - struct psa_aead_update_ad_req psa_crypto_req_msg_psa_aead_update_ad_req_m; - struct psa_aead_update_req psa_crypto_req_msg_psa_aead_update_req_m; - struct psa_aead_finish_req psa_crypto_req_msg_psa_aead_finish_req_m; - struct psa_aead_verify_req psa_crypto_req_msg_psa_aead_verify_req_m; - struct psa_aead_abort_req psa_crypto_req_msg_psa_aead_abort_req_m; - struct psa_sign_message_req psa_crypto_req_msg_psa_sign_message_req_m; - struct psa_verify_message_req psa_crypto_req_msg_psa_verify_message_req_m; - struct psa_sign_hash_req psa_crypto_req_msg_psa_sign_hash_req_m; - struct psa_verify_hash_req psa_crypto_req_msg_psa_verify_hash_req_m; - struct psa_asymmetric_encrypt_req psa_crypto_req_msg_psa_asymmetric_encrypt_req_m; - struct psa_asymmetric_decrypt_req psa_crypto_req_msg_psa_asymmetric_decrypt_req_m; - struct psa_key_derivation_setup_req - psa_crypto_req_msg_psa_key_derivation_setup_req_m; - struct psa_key_derivation_get_capacity_req - psa_crypto_req_msg_psa_key_derivation_get_capacity_req_m; - struct psa_key_derivation_set_capacity_req - psa_crypto_req_msg_psa_key_derivation_set_capacity_req_m; - struct psa_key_derivation_input_bytes_req - psa_crypto_req_msg_psa_key_derivation_input_bytes_req_m; - struct psa_key_derivation_input_integer_req - psa_crypto_req_msg_psa_key_derivation_input_integer_req_m; - struct psa_key_derivation_input_key_req - psa_crypto_req_msg_psa_key_derivation_input_key_req_m; - struct psa_key_derivation_key_agreement_req - psa_crypto_req_msg_psa_key_derivation_key_agreement_req_m; - struct psa_key_derivation_output_bytes_req - psa_crypto_req_msg_psa_key_derivation_output_bytes_req_m; - struct psa_key_derivation_output_key_req - psa_crypto_req_msg_psa_key_derivation_output_key_req_m; - struct psa_key_derivation_abort_req - psa_crypto_req_msg_psa_key_derivation_abort_req_m; - struct psa_raw_key_agreement_req psa_crypto_req_msg_psa_raw_key_agreement_req_m; - struct psa_generate_random_req psa_crypto_req_msg_psa_generate_random_req_m; - struct psa_generate_key_req psa_crypto_req_msg_psa_generate_key_req_m; - struct psa_pake_setup_req psa_crypto_req_msg_psa_pake_setup_req_m; - struct psa_pake_set_role_req psa_crypto_req_msg_psa_pake_set_role_req_m; - struct psa_pake_set_user_req psa_crypto_req_msg_psa_pake_set_user_req_m; - struct psa_pake_set_peer_req psa_crypto_req_msg_psa_pake_set_peer_req_m; - struct psa_pake_set_context_req psa_crypto_req_msg_psa_pake_set_context_req_m; - struct psa_pake_output_req psa_crypto_req_msg_psa_pake_output_req_m; - struct psa_pake_input_req psa_crypto_req_msg_psa_pake_input_req_m; - struct psa_pake_get_shared_key_req psa_crypto_req_msg_psa_pake_get_shared_key_req_m; - struct psa_pake_abort_req psa_crypto_req_msg_psa_pake_abort_req_m; - }; - enum { - psa_crypto_req_msg_psa_crypto_init_req_m_c, - psa_crypto_req_msg_psa_get_key_attributes_req_m_c, - psa_crypto_req_msg_psa_reset_key_attributes_req_m_c, - psa_crypto_req_msg_psa_purge_key_req_m_c, - psa_crypto_req_msg_psa_copy_key_req_m_c, - psa_crypto_req_msg_psa_destroy_key_req_m_c, - psa_crypto_req_msg_psa_import_key_req_m_c, - psa_crypto_req_msg_psa_export_key_req_m_c, - psa_crypto_req_msg_psa_export_public_key_req_m_c, - psa_crypto_req_msg_psa_hash_compute_req_m_c, - psa_crypto_req_msg_psa_hash_compare_req_m_c, - psa_crypto_req_msg_psa_hash_setup_req_m_c, - psa_crypto_req_msg_psa_hash_update_req_m_c, - psa_crypto_req_msg_psa_hash_finish_req_m_c, - psa_crypto_req_msg_psa_hash_verify_req_m_c, - psa_crypto_req_msg_psa_hash_abort_req_m_c, - psa_crypto_req_msg_psa_hash_clone_req_m_c, - psa_crypto_req_msg_psa_mac_compute_req_m_c, - psa_crypto_req_msg_psa_mac_verify_req_m_c, - psa_crypto_req_msg_psa_mac_sign_setup_req_m_c, - psa_crypto_req_msg_psa_mac_verify_setup_req_m_c, - psa_crypto_req_msg_psa_mac_update_req_m_c, - psa_crypto_req_msg_psa_mac_sign_finish_req_m_c, - psa_crypto_req_msg_psa_mac_verify_finish_req_m_c, - psa_crypto_req_msg_psa_mac_abort_req_m_c, - psa_crypto_req_msg_psa_cipher_encrypt_req_m_c, - psa_crypto_req_msg_psa_cipher_decrypt_req_m_c, - psa_crypto_req_msg_psa_cipher_encrypt_setup_req_m_c, - psa_crypto_req_msg_psa_cipher_decrypt_setup_req_m_c, - psa_crypto_req_msg_psa_cipher_generate_iv_req_m_c, - psa_crypto_req_msg_psa_cipher_set_iv_req_m_c, - psa_crypto_req_msg_psa_cipher_update_req_m_c, - psa_crypto_req_msg_psa_cipher_finish_req_m_c, - psa_crypto_req_msg_psa_cipher_abort_req_m_c, - psa_crypto_req_msg_psa_aead_encrypt_req_m_c, - psa_crypto_req_msg_psa_aead_decrypt_req_m_c, - psa_crypto_req_msg_psa_aead_encrypt_setup_req_m_c, - psa_crypto_req_msg_psa_aead_decrypt_setup_req_m_c, - psa_crypto_req_msg_psa_aead_generate_nonce_req_m_c, - psa_crypto_req_msg_psa_aead_set_nonce_req_m_c, - psa_crypto_req_msg_psa_aead_set_lengths_req_m_c, - psa_crypto_req_msg_psa_aead_update_ad_req_m_c, - psa_crypto_req_msg_psa_aead_update_req_m_c, - psa_crypto_req_msg_psa_aead_finish_req_m_c, - psa_crypto_req_msg_psa_aead_verify_req_m_c, - psa_crypto_req_msg_psa_aead_abort_req_m_c, - psa_crypto_req_msg_psa_sign_message_req_m_c, - psa_crypto_req_msg_psa_verify_message_req_m_c, - psa_crypto_req_msg_psa_sign_hash_req_m_c, - psa_crypto_req_msg_psa_verify_hash_req_m_c, - psa_crypto_req_msg_psa_asymmetric_encrypt_req_m_c, - psa_crypto_req_msg_psa_asymmetric_decrypt_req_m_c, - psa_crypto_req_msg_psa_key_derivation_setup_req_m_c, - psa_crypto_req_msg_psa_key_derivation_get_capacity_req_m_c, - psa_crypto_req_msg_psa_key_derivation_set_capacity_req_m_c, - psa_crypto_req_msg_psa_key_derivation_input_bytes_req_m_c, - psa_crypto_req_msg_psa_key_derivation_input_integer_req_m_c, - psa_crypto_req_msg_psa_key_derivation_input_key_req_m_c, - psa_crypto_req_msg_psa_key_derivation_key_agreement_req_m_c, - psa_crypto_req_msg_psa_key_derivation_output_bytes_req_m_c, - psa_crypto_req_msg_psa_key_derivation_output_key_req_m_c, - psa_crypto_req_msg_psa_key_derivation_abort_req_m_c, - psa_crypto_req_msg_psa_raw_key_agreement_req_m_c, - psa_crypto_req_msg_psa_generate_random_req_m_c, - psa_crypto_req_msg_psa_generate_key_req_m_c, - psa_crypto_req_msg_psa_pake_setup_req_m_c, - psa_crypto_req_msg_psa_pake_set_role_req_m_c, - psa_crypto_req_msg_psa_pake_set_user_req_m_c, - psa_crypto_req_msg_psa_pake_set_peer_req_m_c, - psa_crypto_req_msg_psa_pake_set_context_req_m_c, - psa_crypto_req_msg_psa_pake_output_req_m_c, - psa_crypto_req_msg_psa_pake_input_req_m_c, - psa_crypto_req_msg_psa_pake_get_shared_key_req_m_c, - psa_crypto_req_msg_psa_pake_abort_req_m_c, - } psa_crypto_req_msg_choice; + union { + struct psa_get_key_attributes_req + psa_crypto_req_msg_psa_get_key_attributes_req_m; + struct psa_reset_key_attributes_req + psa_crypto_req_msg_psa_reset_key_attributes_req_m; + struct psa_purge_key_req psa_crypto_req_msg_psa_purge_key_req_m; + struct psa_copy_key_req psa_crypto_req_msg_psa_copy_key_req_m; + struct psa_destroy_key_req psa_crypto_req_msg_psa_destroy_key_req_m; + struct psa_import_key_req psa_crypto_req_msg_psa_import_key_req_m; + struct psa_export_key_req psa_crypto_req_msg_psa_export_key_req_m; + struct psa_export_public_key_req + psa_crypto_req_msg_psa_export_public_key_req_m; + struct psa_hash_compute_req psa_crypto_req_msg_psa_hash_compute_req_m; + struct psa_hash_compare_req psa_crypto_req_msg_psa_hash_compare_req_m; + struct psa_hash_setup_req psa_crypto_req_msg_psa_hash_setup_req_m; + struct psa_hash_update_req psa_crypto_req_msg_psa_hash_update_req_m; + struct psa_hash_finish_req psa_crypto_req_msg_psa_hash_finish_req_m; + struct psa_hash_verify_req psa_crypto_req_msg_psa_hash_verify_req_m; + struct psa_hash_abort_req psa_crypto_req_msg_psa_hash_abort_req_m; + struct psa_hash_clone_req psa_crypto_req_msg_psa_hash_clone_req_m; + struct psa_mac_compute_req psa_crypto_req_msg_psa_mac_compute_req_m; + struct psa_mac_verify_req psa_crypto_req_msg_psa_mac_verify_req_m; + struct psa_mac_sign_setup_req psa_crypto_req_msg_psa_mac_sign_setup_req_m; + struct psa_mac_verify_setup_req + psa_crypto_req_msg_psa_mac_verify_setup_req_m; + struct psa_mac_update_req psa_crypto_req_msg_psa_mac_update_req_m; + struct psa_mac_sign_finish_req psa_crypto_req_msg_psa_mac_sign_finish_req_m; + struct psa_mac_verify_finish_req + psa_crypto_req_msg_psa_mac_verify_finish_req_m; + struct psa_mac_abort_req psa_crypto_req_msg_psa_mac_abort_req_m; + struct psa_cipher_encrypt_req psa_crypto_req_msg_psa_cipher_encrypt_req_m; + struct psa_cipher_decrypt_req psa_crypto_req_msg_psa_cipher_decrypt_req_m; + struct psa_cipher_encrypt_setup_req + psa_crypto_req_msg_psa_cipher_encrypt_setup_req_m; + struct psa_cipher_decrypt_setup_req + psa_crypto_req_msg_psa_cipher_decrypt_setup_req_m; + struct psa_cipher_generate_iv_req + psa_crypto_req_msg_psa_cipher_generate_iv_req_m; + struct psa_cipher_set_iv_req psa_crypto_req_msg_psa_cipher_set_iv_req_m; + struct psa_cipher_update_req psa_crypto_req_msg_psa_cipher_update_req_m; + struct psa_cipher_finish_req psa_crypto_req_msg_psa_cipher_finish_req_m; + struct psa_cipher_abort_req psa_crypto_req_msg_psa_cipher_abort_req_m; + struct psa_aead_encrypt_req psa_crypto_req_msg_psa_aead_encrypt_req_m; + struct psa_aead_decrypt_req psa_crypto_req_msg_psa_aead_decrypt_req_m; + struct psa_aead_encrypt_setup_req + psa_crypto_req_msg_psa_aead_encrypt_setup_req_m; + struct psa_aead_decrypt_setup_req + psa_crypto_req_msg_psa_aead_decrypt_setup_req_m; + struct psa_aead_generate_nonce_req + psa_crypto_req_msg_psa_aead_generate_nonce_req_m; + struct psa_aead_set_nonce_req psa_crypto_req_msg_psa_aead_set_nonce_req_m; + struct psa_aead_set_lengths_req + psa_crypto_req_msg_psa_aead_set_lengths_req_m; + struct psa_aead_update_ad_req psa_crypto_req_msg_psa_aead_update_ad_req_m; + struct psa_aead_update_req psa_crypto_req_msg_psa_aead_update_req_m; + struct psa_aead_finish_req psa_crypto_req_msg_psa_aead_finish_req_m; + struct psa_aead_verify_req psa_crypto_req_msg_psa_aead_verify_req_m; + struct psa_aead_abort_req psa_crypto_req_msg_psa_aead_abort_req_m; + struct psa_sign_message_req psa_crypto_req_msg_psa_sign_message_req_m; + struct psa_verify_message_req psa_crypto_req_msg_psa_verify_message_req_m; + struct psa_sign_hash_req psa_crypto_req_msg_psa_sign_hash_req_m; + struct psa_verify_hash_req psa_crypto_req_msg_psa_verify_hash_req_m; + struct psa_asymmetric_encrypt_req + psa_crypto_req_msg_psa_asymmetric_encrypt_req_m; + struct psa_asymmetric_decrypt_req + psa_crypto_req_msg_psa_asymmetric_decrypt_req_m; + struct psa_key_derivation_setup_req + psa_crypto_req_msg_psa_key_derivation_setup_req_m; + struct psa_key_derivation_get_capacity_req + psa_crypto_req_msg_psa_key_derivation_get_capacity_req_m; + struct psa_key_derivation_set_capacity_req + psa_crypto_req_msg_psa_key_derivation_set_capacity_req_m; + struct psa_key_derivation_input_bytes_req + psa_crypto_req_msg_psa_key_derivation_input_bytes_req_m; + struct psa_key_derivation_input_integer_req + psa_crypto_req_msg_psa_key_derivation_input_integer_req_m; + struct psa_key_derivation_input_key_req + psa_crypto_req_msg_psa_key_derivation_input_key_req_m; + struct psa_key_derivation_key_agreement_req + psa_crypto_req_msg_psa_key_derivation_key_agreement_req_m; + struct psa_key_derivation_output_bytes_req + psa_crypto_req_msg_psa_key_derivation_output_bytes_req_m; + struct psa_key_derivation_output_key_req + psa_crypto_req_msg_psa_key_derivation_output_key_req_m; + struct psa_key_derivation_abort_req + psa_crypto_req_msg_psa_key_derivation_abort_req_m; + struct psa_raw_key_agreement_req + psa_crypto_req_msg_psa_raw_key_agreement_req_m; + struct psa_generate_random_req psa_crypto_req_msg_psa_generate_random_req_m; + struct psa_generate_key_req psa_crypto_req_msg_psa_generate_key_req_m; + struct psa_pake_setup_req psa_crypto_req_msg_psa_pake_setup_req_m; + struct psa_pake_set_role_req psa_crypto_req_msg_psa_pake_set_role_req_m; + struct psa_pake_set_user_req psa_crypto_req_msg_psa_pake_set_user_req_m; + struct psa_pake_set_peer_req psa_crypto_req_msg_psa_pake_set_peer_req_m; + struct psa_pake_set_context_req + psa_crypto_req_msg_psa_pake_set_context_req_m; + struct psa_pake_output_req psa_crypto_req_msg_psa_pake_output_req_m; + struct psa_pake_input_req psa_crypto_req_msg_psa_pake_input_req_m; + struct psa_pake_get_shared_key_req + psa_crypto_req_msg_psa_pake_get_shared_key_req_m; + struct psa_pake_abort_req psa_crypto_req_msg_psa_pake_abort_req_m; + }; + enum { + psa_crypto_req_msg_psa_crypto_init_req_m_c, + psa_crypto_req_msg_psa_get_key_attributes_req_m_c, + psa_crypto_req_msg_psa_reset_key_attributes_req_m_c, + psa_crypto_req_msg_psa_purge_key_req_m_c, + psa_crypto_req_msg_psa_copy_key_req_m_c, + psa_crypto_req_msg_psa_destroy_key_req_m_c, + psa_crypto_req_msg_psa_import_key_req_m_c, + psa_crypto_req_msg_psa_export_key_req_m_c, + psa_crypto_req_msg_psa_export_public_key_req_m_c, + psa_crypto_req_msg_psa_hash_compute_req_m_c, + psa_crypto_req_msg_psa_hash_compare_req_m_c, + psa_crypto_req_msg_psa_hash_setup_req_m_c, + psa_crypto_req_msg_psa_hash_update_req_m_c, + psa_crypto_req_msg_psa_hash_finish_req_m_c, + psa_crypto_req_msg_psa_hash_verify_req_m_c, + psa_crypto_req_msg_psa_hash_abort_req_m_c, + psa_crypto_req_msg_psa_hash_clone_req_m_c, + psa_crypto_req_msg_psa_mac_compute_req_m_c, + psa_crypto_req_msg_psa_mac_verify_req_m_c, + psa_crypto_req_msg_psa_mac_sign_setup_req_m_c, + psa_crypto_req_msg_psa_mac_verify_setup_req_m_c, + psa_crypto_req_msg_psa_mac_update_req_m_c, + psa_crypto_req_msg_psa_mac_sign_finish_req_m_c, + psa_crypto_req_msg_psa_mac_verify_finish_req_m_c, + psa_crypto_req_msg_psa_mac_abort_req_m_c, + psa_crypto_req_msg_psa_cipher_encrypt_req_m_c, + psa_crypto_req_msg_psa_cipher_decrypt_req_m_c, + psa_crypto_req_msg_psa_cipher_encrypt_setup_req_m_c, + psa_crypto_req_msg_psa_cipher_decrypt_setup_req_m_c, + psa_crypto_req_msg_psa_cipher_generate_iv_req_m_c, + psa_crypto_req_msg_psa_cipher_set_iv_req_m_c, + psa_crypto_req_msg_psa_cipher_update_req_m_c, + psa_crypto_req_msg_psa_cipher_finish_req_m_c, + psa_crypto_req_msg_psa_cipher_abort_req_m_c, + psa_crypto_req_msg_psa_aead_encrypt_req_m_c, + psa_crypto_req_msg_psa_aead_decrypt_req_m_c, + psa_crypto_req_msg_psa_aead_encrypt_setup_req_m_c, + psa_crypto_req_msg_psa_aead_decrypt_setup_req_m_c, + psa_crypto_req_msg_psa_aead_generate_nonce_req_m_c, + psa_crypto_req_msg_psa_aead_set_nonce_req_m_c, + psa_crypto_req_msg_psa_aead_set_lengths_req_m_c, + psa_crypto_req_msg_psa_aead_update_ad_req_m_c, + psa_crypto_req_msg_psa_aead_update_req_m_c, + psa_crypto_req_msg_psa_aead_finish_req_m_c, + psa_crypto_req_msg_psa_aead_verify_req_m_c, + psa_crypto_req_msg_psa_aead_abort_req_m_c, + psa_crypto_req_msg_psa_sign_message_req_m_c, + psa_crypto_req_msg_psa_verify_message_req_m_c, + psa_crypto_req_msg_psa_sign_hash_req_m_c, + psa_crypto_req_msg_psa_verify_hash_req_m_c, + psa_crypto_req_msg_psa_asymmetric_encrypt_req_m_c, + psa_crypto_req_msg_psa_asymmetric_decrypt_req_m_c, + psa_crypto_req_msg_psa_key_derivation_setup_req_m_c, + psa_crypto_req_msg_psa_key_derivation_get_capacity_req_m_c, + psa_crypto_req_msg_psa_key_derivation_set_capacity_req_m_c, + psa_crypto_req_msg_psa_key_derivation_input_bytes_req_m_c, + psa_crypto_req_msg_psa_key_derivation_input_integer_req_m_c, + psa_crypto_req_msg_psa_key_derivation_input_key_req_m_c, + psa_crypto_req_msg_psa_key_derivation_key_agreement_req_m_c, + psa_crypto_req_msg_psa_key_derivation_output_bytes_req_m_c, + psa_crypto_req_msg_psa_key_derivation_output_key_req_m_c, + psa_crypto_req_msg_psa_key_derivation_abort_req_m_c, + psa_crypto_req_msg_psa_raw_key_agreement_req_m_c, + psa_crypto_req_msg_psa_generate_random_req_m_c, + psa_crypto_req_msg_psa_generate_key_req_m_c, + psa_crypto_req_msg_psa_pake_setup_req_m_c, + psa_crypto_req_msg_psa_pake_set_role_req_m_c, + psa_crypto_req_msg_psa_pake_set_user_req_m_c, + psa_crypto_req_msg_psa_pake_set_peer_req_m_c, + psa_crypto_req_msg_psa_pake_set_context_req_m_c, + psa_crypto_req_msg_psa_pake_output_req_m_c, + psa_crypto_req_msg_psa_pake_input_req_m_c, + psa_crypto_req_msg_psa_pake_get_shared_key_req_m_c, + psa_crypto_req_msg_psa_pake_abort_req_m_c, + } psa_crypto_req_msg_choice; }; #ifdef __cplusplus diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c index 0ec42dfada5e..afc10674f479 100644 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c @@ -5,112 +5,107 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "reset_evt_service_decode.h" +#include "zcbor_decode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_decode.h" -#include "reset_evt_service_decode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -static bool decode_reset_evt_notif(zcbor_state_t *state, struct reset_evt_notif *result); +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + +static bool decode_reset_evt_notif(zcbor_state_t *state, + struct reset_evt_notif *result); static bool decode_reset_evt_sub_rsp(zcbor_state_t *state, int32_t *result); static bool decode_reset_evt_sub_req(zcbor_state_t *state, bool *result); -static bool decode_reset_evt_notif(zcbor_state_t *state, struct reset_evt_notif *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((zcbor_list_start_decode(state) && - ((((zcbor_uint32_decode(state, (&(*result).reset_evt_notif_domains)))) && - ((zcbor_uint32_decode(state, (&(*result).reset_evt_notif_delay_ms))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} +static bool decode_reset_evt_notif(zcbor_state_t *state, + struct reset_evt_notif *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (zcbor_list_start_decode(state) && + ((((zcbor_uint32_decode(state, (&(*result).reset_evt_notif_domains)))) && + ((zcbor_uint32_decode(state, + (&(*result).reset_evt_notif_delay_ms))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); -static bool decode_reset_evt_sub_rsp(zcbor_state_t *state, int32_t *result) -{ - zcbor_log("%s\r\n", __func__); + log_result(state, res, __func__); + return res; +} - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_int32_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); +static bool decode_reset_evt_sub_rsp(zcbor_state_t *state, int32_t *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_reset_evt_sub_req(zcbor_state_t *state, bool *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_bool_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); +static bool decode_reset_evt_sub_req(zcbor_state_t *state, bool *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((zcbor_list_start_decode(state) && + ((((zcbor_bool_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -int cbor_decode_reset_evt_sub_req(const uint8_t *payload, size_t payload_len, bool *result, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; +int cbor_decode_reset_evt_sub_req(const uint8_t *payload, size_t payload_len, + bool *result, size_t *payload_len_out) { + zcbor_state_t states[3]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_reset_evt_sub_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_reset_evt_sub_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_decode_reset_evt_sub_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; +int cbor_decode_reset_evt_sub_rsp(const uint8_t *payload, size_t payload_len, + int32_t *result, size_t *payload_len_out) { + zcbor_state_t states[3]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_reset_evt_sub_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_reset_evt_sub_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } int cbor_decode_reset_evt_notif(const uint8_t *payload, size_t payload_len, - struct reset_evt_notif *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_reset_evt_notif, - sizeof(states) / sizeof(zcbor_state_t), 1); + struct reset_evt_notif *result, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_reset_evt_notif, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h index 73ebfb26e965..b2110ed503fc 100644 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,28 +13,30 @@ #ifndef RESET_EVT_SERVICE_DECODE_H__ #define RESET_EVT_SERVICE_DECODE_H__ -#include +#include "reset_evt_service_types.h" #include #include +#include #include -#include "reset_evt_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -int cbor_decode_reset_evt_sub_req(const uint8_t *payload, size_t payload_len, bool *result, - size_t *payload_len_out); +int cbor_decode_reset_evt_sub_req(const uint8_t *payload, size_t payload_len, + bool *result, size_t *payload_len_out); -int cbor_decode_reset_evt_sub_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out); +int cbor_decode_reset_evt_sub_rsp(const uint8_t *payload, size_t payload_len, + int32_t *result, size_t *payload_len_out); int cbor_decode_reset_evt_notif(const uint8_t *payload, size_t payload_len, - struct reset_evt_notif *result, size_t *payload_len_out); + struct reset_evt_notif *result, + size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c index f3d096c77f07..5bc2ae1748a8 100644 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c @@ -5,112 +5,109 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "reset_evt_service_encode.h" +#include "zcbor_encode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_encode.h" -#include "reset_evt_service_encode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -static bool encode_reset_evt_notif(zcbor_state_t *state, const struct reset_evt_notif *input); -static bool encode_reset_evt_sub_rsp(zcbor_state_t *state, const int32_t *input); +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) + +static bool encode_reset_evt_notif(zcbor_state_t *state, + const struct reset_evt_notif *input); +static bool encode_reset_evt_sub_rsp(zcbor_state_t *state, + const int32_t *input); static bool encode_reset_evt_sub_req(zcbor_state_t *state, const bool *input); -static bool encode_reset_evt_notif(zcbor_state_t *state, const struct reset_evt_notif *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((zcbor_list_start_encode(state, 2) && - ((((zcbor_uint32_encode(state, (&(*input).reset_evt_notif_domains)))) && - ((zcbor_uint32_encode(state, (&(*input).reset_evt_notif_delay_ms))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 2)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} +static bool encode_reset_evt_notif(zcbor_state_t *state, + const struct reset_evt_notif *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + zcbor_list_start_encode(state, 2) && + ((((zcbor_uint32_encode(state, (&(*input).reset_evt_notif_domains)))) && + ((zcbor_uint32_encode(state, (&(*input).reset_evt_notif_delay_ms))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 2)))); -static bool encode_reset_evt_sub_rsp(zcbor_state_t *state, const int32_t *input) -{ - zcbor_log("%s\r\n", __func__); + log_result(state, res, __func__); + return res; +} - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_int32_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); +static bool encode_reset_evt_sub_rsp(zcbor_state_t *state, + const int32_t *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_int32_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_reset_evt_sub_req(zcbor_state_t *state, const bool *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_bool_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); +static bool encode_reset_evt_sub_req(zcbor_state_t *state, const bool *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_bool_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -int cbor_encode_reset_evt_sub_req(uint8_t *payload, size_t payload_len, const bool *input, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; +int cbor_encode_reset_evt_sub_req(uint8_t *payload, size_t payload_len, + const bool *input, size_t *payload_len_out) { + zcbor_state_t states[3]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_reset_evt_sub_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_reset_evt_sub_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_encode_reset_evt_sub_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; +int cbor_encode_reset_evt_sub_rsp(uint8_t *payload, size_t payload_len, + const int32_t *input, + size_t *payload_len_out) { + zcbor_state_t states[3]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_reset_evt_sub_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_reset_evt_sub_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } int cbor_encode_reset_evt_notif(uint8_t *payload, size_t payload_len, - const struct reset_evt_notif *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_reset_evt_notif, - sizeof(states) / sizeof(zcbor_state_t), 1); + const struct reset_evt_notif *input, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_reset_evt_notif, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h index 5892b17ea8f5..6b11de3651ea 100644 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,28 +13,31 @@ #ifndef RESET_EVT_SERVICE_ENCODE_H__ #define RESET_EVT_SERVICE_ENCODE_H__ -#include +#include "reset_evt_service_types.h" #include #include +#include #include -#include "reset_evt_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -int cbor_encode_reset_evt_sub_req(uint8_t *payload, size_t payload_len, const bool *input, - size_t *payload_len_out); +int cbor_encode_reset_evt_sub_req(uint8_t *payload, size_t payload_len, + const bool *input, size_t *payload_len_out); -int cbor_encode_reset_evt_sub_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out); +int cbor_encode_reset_evt_sub_rsp(uint8_t *payload, size_t payload_len, + const int32_t *input, + size_t *payload_len_out); int cbor_encode_reset_evt_notif(uint8_t *payload, size_t payload_len, - const struct reset_evt_notif *input, size_t *payload_len_out); + const struct reset_evt_notif *input, + size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h index e7b9b242189a..ce4ed3f2f0b0 100644 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,9 +13,9 @@ #ifndef RESET_EVT_SERVICE_TYPES_H__ #define RESET_EVT_SERVICE_TYPES_H__ -#include #include #include +#include #ifdef __cplusplus extern "C" { @@ -31,8 +31,8 @@ extern "C" { #define DEFAULT_MAX_QTY 3 struct reset_evt_notif { - uint32_t reset_evt_notif_domains; - uint32_t reset_evt_notif_delay_ms; + uint32_t reset_evt_notif_domains; + uint32_t reset_evt_notif_delay_ms; }; #ifdef __cplusplus diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c index 25640e21ae7e..8a54ca727f5a 100644 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c @@ -5,85 +5,89 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "sdfw_update_service_decode.h" +#include "zcbor_decode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_decode.h" -#include "sdfw_update_service_decode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -static bool decode_sdfw_update_rsp(zcbor_state_t *state, int32_t *result); -static bool decode_sdfw_update_req(zcbor_state_t *state, struct sdfw_update_req *result); +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) -static bool decode_sdfw_update_rsp(zcbor_state_t *state, int32_t *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_sdfw_update_rsp(zcbor_state_t *state, int32_t *result); +static bool decode_sdfw_update_req(zcbor_state_t *state, + struct sdfw_update_req *result); - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_int32_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); +static bool decode_sdfw_update_rsp(zcbor_state_t *state, int32_t *result) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_sdfw_update_req(zcbor_state_t *state, struct sdfw_update_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_decode(state) && - ((((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_tbs_addr)))) && - ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_max)))) && - ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_fw)))) && - ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_pk)))) && - ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_signature))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool decode_sdfw_update_req(zcbor_state_t *state, + struct sdfw_update_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + zcbor_list_start_decode(state) && + ((((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_tbs_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_max)))) && + ((zcbor_uint32_decode(state, + (&(*result).sdfw_update_req_dl_addr_fw)))) && + ((zcbor_uint32_decode(state, + (&(*result).sdfw_update_req_dl_addr_pk)))) && + ((zcbor_uint32_decode( + state, (&(*result).sdfw_update_req_dl_addr_signature))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + log_result(state, res, __func__); + return res; } int cbor_decode_sdfw_update_req(const uint8_t *payload, size_t payload_len, - struct sdfw_update_req *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_sdfw_update_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + struct sdfw_update_req *result, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_sdfw_update_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_decode_sdfw_update_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; +int cbor_decode_sdfw_update_rsp(const uint8_t *payload, size_t payload_len, + int32_t *result, size_t *payload_len_out) { + zcbor_state_t states[3]; - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_sdfw_update_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_sdfw_update_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h index a869f949d749..423fe20fb9cd 100644 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,25 +13,27 @@ #ifndef SDFW_UPDATE_SERVICE_DECODE_H__ #define SDFW_UPDATE_SERVICE_DECODE_H__ -#include +#include "sdfw_update_service_types.h" #include #include +#include #include -#include "sdfw_update_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif int cbor_decode_sdfw_update_req(const uint8_t *payload, size_t payload_len, - struct sdfw_update_req *result, size_t *payload_len_out); + struct sdfw_update_req *result, + size_t *payload_len_out); -int cbor_decode_sdfw_update_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out); +int cbor_decode_sdfw_update_rsp(const uint8_t *payload, size_t payload_len, + int32_t *result, size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c index be58fb2e1a5c..b5349f86771e 100644 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c @@ -5,85 +5,89 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ -#include +#include "sdfw_update_service_encode.h" +#include "zcbor_encode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_encode.h" -#include "sdfw_update_service_encode.h" -#include "zcbor_print.h" #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif -static bool encode_sdfw_update_rsp(zcbor_state_t *state, const int32_t *input); -static bool encode_sdfw_update_req(zcbor_state_t *state, const struct sdfw_update_req *input); +#define log_result(state, result, func) \ + do { \ + if (!result) { \ + zcbor_trace_file(state); \ + zcbor_log("%s error: %s\r\n", func, \ + zcbor_error_str(zcbor_peek_error(state))); \ + } else { \ + zcbor_log("%s success\r\n", func); \ + } \ + } while (0) -static bool encode_sdfw_update_rsp(zcbor_state_t *state, const int32_t *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_sdfw_update_rsp(zcbor_state_t *state, const int32_t *input); +static bool encode_sdfw_update_req(zcbor_state_t *state, + const struct sdfw_update_req *input); - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_int32_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); +static bool encode_sdfw_update_rsp(zcbor_state_t *state, const int32_t *input) { + zcbor_log("%s\r\n", __func__); - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } + bool res = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_int32_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool encode_sdfw_update_req(zcbor_state_t *state, const struct sdfw_update_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (zcbor_list_start_encode(state, 5) && - ((((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_tbs_addr)))) && - ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_max)))) && - ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_fw)))) && - ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_pk)))) && - ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_signature))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 5)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; +static bool encode_sdfw_update_req(zcbor_state_t *state, + const struct sdfw_update_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (zcbor_list_start_encode(state, 5) && + ((((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_tbs_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_max)))) && + ((zcbor_uint32_encode(state, + (&(*input).sdfw_update_req_dl_addr_fw)))) && + ((zcbor_uint32_encode(state, + (&(*input).sdfw_update_req_dl_addr_pk)))) && + ((zcbor_uint32_encode( + state, (&(*input).sdfw_update_req_dl_addr_signature))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 5)))); + + log_result(state, res, __func__); + return res; } int cbor_encode_sdfw_update_req(uint8_t *payload, size_t payload_len, - const struct sdfw_update_req *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_sdfw_update_req, - sizeof(states) / sizeof(zcbor_state_t), 1); + const struct sdfw_update_req *input, + size_t *payload_len_out) { + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_sdfw_update_req, + sizeof(states) / sizeof(zcbor_state_t), 1); } -int cbor_encode_sdfw_update_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; +int cbor_encode_sdfw_update_rsp(uint8_t *payload, size_t payload_len, + const int32_t *input, size_t *payload_len_out) { + zcbor_state_t states[3]; - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_sdfw_update_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_sdfw_update_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h index 94f0d7b477f5..19956ae4fec3 100644 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,25 +13,27 @@ #ifndef SDFW_UPDATE_SERVICE_ENCODE_H__ #define SDFW_UPDATE_SERVICE_ENCODE_H__ -#include +#include "sdfw_update_service_types.h" #include #include +#include #include -#include "sdfw_update_service_types.h" #ifdef __cplusplus extern "C" { #endif #if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" +#error \ + "The type file was generated with a different default_max_qty than this file" #endif int cbor_encode_sdfw_update_req(uint8_t *payload, size_t payload_len, - const struct sdfw_update_req *input, size_t *payload_len_out); + const struct sdfw_update_req *input, + size_t *payload_len_out); -int cbor_encode_sdfw_update_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out); +int cbor_encode_sdfw_update_rsp(uint8_t *payload, size_t payload_len, + const int32_t *input, size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h index ecf3d6c40239..1a86735e0837 100644 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h @@ -5,7 +5,7 @@ */ /* - * Generated using zcbor version 0.8.1 + * Generated using zcbor version 0.9.0 * https://github.com/NordicSemiconductor/zcbor * Generated with a --default-max-qty of 3 */ @@ -13,9 +13,9 @@ #ifndef SDFW_UPDATE_SERVICE_TYPES_H__ #define SDFW_UPDATE_SERVICE_TYPES_H__ -#include #include #include +#include #ifdef __cplusplus extern "C" { @@ -31,11 +31,11 @@ extern "C" { #define DEFAULT_MAX_QTY 3 struct sdfw_update_req { - uint32_t sdfw_update_req_tbs_addr; - uint32_t sdfw_update_req_dl_max; - uint32_t sdfw_update_req_dl_addr_fw; - uint32_t sdfw_update_req_dl_addr_pk; - uint32_t sdfw_update_req_dl_addr_signature; + uint32_t sdfw_update_req_tbs_addr; + uint32_t sdfw_update_req_dl_max; + uint32_t sdfw_update_req_dl_addr_fw; + uint32_t sdfw_update_req_dl_addr_pk; + uint32_t sdfw_update_req_dl_addr_signature; }; #ifdef __cplusplus