From 15a4fe9c94efa67e60c695514cc8737c6a91f0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20R=C3=B8nningstad?= Date: Thu, 22 Aug 2024 16:34:26 +0200 Subject: [PATCH] sdfw_services: Regenerate zcbor-generated client code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using zcbor 0.9.0 Signed-off-by: Øyvind Rønningstad --- .../releases/release-notes-changelog.rst | 5 + .../zcbor_generated/echo_service_decode.c | 118 +- .../zcbor_generated/echo_service_decode.h | 15 +- .../zcbor_generated/echo_service_encode.c | 118 +- .../zcbor_generated/echo_service_encode.h | 15 +- .../echo/zcbor_generated/echo_service_types.h | 8 +- .../zcbor_generated/enc_fw_service_decode.c | 193 +- .../zcbor_generated/enc_fw_service_decode.h | 17 +- .../zcbor_generated/enc_fw_service_encode.c | 189 +- .../zcbor_generated/enc_fw_service_encode.h | 18 +- .../zcbor_generated/enc_fw_service_types.h | 38 +- .../zcbor_generated/extmem_service_decode.c | 659 ++- .../zcbor_generated/extmem_service_decode.h | 21 +- .../zcbor_generated/extmem_service_encode.c | 633 ++- .../zcbor_generated/extmem_service_encode.h | 24 +- .../zcbor_generated/extmem_service_types.h | 132 +- .../psa_crypto/zcbor_generated/CMakeLists.txt | 2 +- .../psa_crypto_service_decode.c | 4426 ++++++++--------- .../psa_crypto_service_decode.h | 15 +- .../psa_crypto_service_encode.c | 3170 ++++++------ .../psa_crypto_service_encode.h | 15 +- .../psa_crypto_service_types.h | 920 ++-- .../reset_evt_service_decode.c | 149 +- .../reset_evt_service_decode.h | 20 +- .../reset_evt_service_encode.c | 153 +- .../reset_evt_service_encode.h | 21 +- .../zcbor_generated/reset_evt_service_types.h | 8 +- .../sdfw_update_service_decode.c | 120 +- .../sdfw_update_service_decode.h | 16 +- .../sdfw_update_service_encode.c | 120 +- .../sdfw_update_service_encode.h | 16 +- .../sdfw_update_service_types.h | 14 +- .../zcbor_generated/suit_service_decode.c | 1902 ++++--- .../zcbor_generated/suit_service_decode.h | 21 +- .../zcbor_generated/suit_service_encode.c | 1751 ++++--- .../zcbor_generated/suit_service_encode.h | 21 +- .../zcbor_generated/suit_service_types.h | 327 +- 37 files changed, 7376 insertions(+), 8034 deletions(-) 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 c1af6113c33f..c6a79c6bb029 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -837,6 +837,11 @@ Shell libraries |no_changes_yet_note| +sdfw +---- + +* sdfw_services: Regenerated generated code files using zcbor 0.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 76be9b4b2202..1ed4436d0d7a 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,2401 +5,2179 @@ */ /* - * 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 -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_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_import_key_req(zcbor_state_t *state, struct psa_import_key_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); +#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_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_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_import_key_req(zcbor_state_t *state, + struct psa_import_key_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_key_derivation_get_capacity_req(zcbor_state_t *state, - struct psa_key_derivation_get_capacity_req *result); +decode_psa_aead_decrypt_setup_req(zcbor_state_t *state, + struct psa_aead_decrypt_setup_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_generate_nonce_req(zcbor_state_t *state, + struct psa_aead_generate_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_nonce_req(zcbor_state_t *state, + struct psa_aead_set_nonce_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_set_lengths_req(zcbor_state_t *state, + struct psa_aead_set_lengths_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_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_key_agreement_req(zcbor_state_t *state, - struct psa_key_derivation_key_agreement_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_output_bytes_req(zcbor_state_t *state, - struct psa_key_derivation_output_bytes_req *result); +decode_psa_asymmetric_encrypt_req(zcbor_state_t *state, + struct psa_asymmetric_encrypt_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); -static bool decode_psa_pake_setup_req(zcbor_state_t *state, struct psa_pake_setup_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_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_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_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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_get_key_attributes_req_p_attributes))))))); + + 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 tmp_result = - (((((zcbor_uint32_expect(state, (11)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_get_key_attributes_req_key)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_get_key_attributes_req_p_attributes))))))); - - 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_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_uint32_expect(state, (12)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_reset_key_attributes_req_p_attributes))))))); - - 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_purge_key_req(zcbor_state_t *state, struct psa_purge_key_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((((zcbor_uint32_expect(state, (13)))) && - ((zcbor_uint32_decode(state, (&(*result).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; -} - -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, (14)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_copy_key_req_source_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_copy_key_req_p_attributes)))) && - ((zcbor_uint32_decode(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__); - } - - return tmp_result; -} - -static bool decode_psa_destroy_key_req(zcbor_state_t *state, struct psa_destroy_key_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (15)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_destroy_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; -} - -static bool decode_psa_import_key_req(zcbor_state_t *state, struct psa_import_key_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (16)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_import_key_req_p_attributes)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_import_key_req_p_data)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_import_key_req_data_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_import_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_reset_key_attributes_req( + zcbor_state_t *state, struct psa_reset_key_attributes_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (12)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_reset_key_attributes_req_p_attributes))))))); + + 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__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (17)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_key_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_key_req_p_data)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_key_req_data_size)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_key_req_p_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__); - } +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))))))); - return tmp_result; + 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__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (18)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_public_key_req_key)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_public_key_req_p_data)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_export_public_key_req_data_size)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_export_public_key_req_p_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; -} - -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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compute_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compute_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compute_req_p_hash)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compute_req_hash_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compare_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compare_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compare_req_p_hash)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_compare_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_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)))) && - ((zcbor_uint32_decode(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__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (22)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_update_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_update_req_p_input)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_finish_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_finish_req_p_hash)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_finish_req_hash_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_verify_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_hash_verify_req_p_hash)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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; +static bool decode_psa_copy_key_req(zcbor_state_t *state, + struct psa_copy_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (14)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_copy_key_req_source_key)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_copy_key_req_p_attributes)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_copy_key_req_p_target_key))))))); + + 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__); + + 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_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)))) && - ((zcbor_uint32_decode(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_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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_import_key_req_p_attributes)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_import_key_req_p_data)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_import_key_req_data_length)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_import_key_req_p_key))))))); + + 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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_p_mac)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_mac_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_p_mac)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_update_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_update_req_p_input)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_sign_finish_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_sign_finish_req_p_mac)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_sign_finish_req_mac_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_finish_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_finish_req_p_mac)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_req_p_output)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_encrypt_req_output_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_req_p_output)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_decrypt_req_output_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_generate_iv_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_generate_iv_req_p_iv)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_generate_iv_req_iv_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_set_iv_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_set_iv_req_p_iv)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_update_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_update_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_update_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_update_req_p_output)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_update_req_output_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_finish_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_finish_req_p_output)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_cipher_finish_req_output_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_p_nonce)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_nonce_length)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_aead_encrypt_req_p_additional_data)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_aead_encrypt_req_additional_data_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_p_plaintext)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_aead_encrypt_req_plaintext_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_p_ciphertext)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_encrypt_req_ciphertext_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_p_nonce)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_nonce_length)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_aead_decrypt_req_p_additional_data)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_aead_decrypt_req_additional_data_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_p_ciphertext)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_aead_decrypt_req_ciphertext_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_p_plaintext)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_decrypt_req_plaintext_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_generate_nonce_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_generate_nonce_req_p_nonce)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_aead_generate_nonce_req_nonce_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_set_nonce_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_set_nonce_req_p_nonce)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_set_lengths_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_set_lengths_req_ad_length)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_update_ad_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_update_ad_req_p_input)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_update_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_update_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_update_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_update_req_p_output)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_update_req_output_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_finish_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_finish_req_p_ciphertext)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_finish_req_ciphertext_size)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_aead_finish_req_p_ciphertext_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_finish_req_p_tag)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_finish_req_tag_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_verify_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_verify_req_p_plaintext)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_verify_req_plaintext_size)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_aead_verify_req_p_plaintext_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_aead_verify_req_p_tag)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_message_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_message_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_message_req_p_signature)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_message_req_signature_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_message_req_p_input)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_message_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_message_req_p_signature)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_p_hash)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_hash_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_p_signature)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_signature_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_hash_req_p_hash)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_hash_req_hash_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_verify_hash_req_p_signature)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_encrypt_req_p_input)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_asymmetric_encrypt_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_encrypt_req_p_salt)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_asymmetric_encrypt_req_salt_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_encrypt_req_p_output)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_asymmetric_encrypt_req_output_size)))) && - ((zcbor_uint32_decode( - 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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_decrypt_req_p_input)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_asymmetric_decrypt_req_input_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_decrypt_req_p_salt)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_asymmetric_decrypt_req_salt_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_asymmetric_decrypt_req_p_output)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_asymmetric_decrypt_req_output_size)))) && - ((zcbor_uint32_decode( - 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)))) && - ((zcbor_uint32_decode(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_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)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_export_key_req_p_data)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_export_key_req_data_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_export_key_req_p_data_length))))))); + + 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_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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_export_public_key_req_p_data)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_export_public_key_req_data_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_export_public_key_req_p_data_length))))))); + + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_compute_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_hash_compute_req_input_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_compute_req_p_hash)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_compute_req_hash_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_hash_compute_req_p_hash_length))))))); + + log_result(state, res, __func__); + return res; +} + +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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_compare_req_p_input)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_compare_req_input_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_compare_req_p_hash)))) && + ((zcbor_uint32_decode(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)))) && + ((zcbor_uint32_decode(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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_hash_update_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_hash_update_req_p_input)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_finish_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_hash_finish_req_p_hash)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_finish_req_hash_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_verify_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_hash_verify_req_p_hash)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_hash_verify_req_hash_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_hash_abort_req(zcbor_state_t *state, + struct psa_hash_abort_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_expect(state, (25)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_hash_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_expect(state, (63)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_get_capacity_req_handle)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_get_capacity_req_p_capacity))))))); +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)))) && + ((zcbor_uint32_decode(state, + (&(*result).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 decode_psa_mac_compute_req(zcbor_state_t *state, + struct psa_mac_compute_req *result) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_compute_req_p_input)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_compute_req_input_length)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_compute_req_p_mac)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_compute_req_mac_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_mac_compute_req_p_mac_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_mac_verify_req(zcbor_state_t *state, + struct psa_mac_verify_req *result) { + zcbor_log("%s\r\n", __func__); + + 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)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_p_input)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_verify_req_input_length)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_verify_req_p_mac)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_verify_req_mac_length))))))); + + 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_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, (64)))) && - ((zcbor_uint32_decode( - 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, (29)))) && + ((zcbor_uint32_decode(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__); - } + log_result(state, res, __func__); + return res; +} + +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__); - return tmp_result; + bool res = (((((zcbor_uint32_expect(state, (30)))) && + ((zcbor_uint32_decode( + 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; +} + +static bool decode_psa_mac_update_req(zcbor_state_t *state, + struct psa_mac_update_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (31)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_update_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_mac_update_req_p_input)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_update_req_input_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)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_input_bytes_req_p_handle)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_key_derivation_input_bytes_req_step)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_input_bytes_req_p_data)))) && - ((zcbor_uint32_decode( - 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_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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_mac_sign_finish_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_mac_sign_finish_req_p_mac)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_mac_sign_finish_req_mac_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_mac_sign_finish_req_p_mac_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)))) && - ((zcbor_uint32_decode( - 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)))) && - ((zcbor_uint32_decode( - 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_mac_verify_finish_req(zcbor_state_t *state, + struct psa_mac_verify_finish_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (33)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_mac_verify_finish_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_mac_verify_finish_req_p_mac)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_mac_verify_finish_req_mac_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_mac_abort_req(zcbor_state_t *state, + struct psa_mac_abort_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_expect(state, (34)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_mac_abort_req_p_handle))))))); + + 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)))) && - ((zcbor_uint32_decode( - 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)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_key_agreement_req_p_peer_key)))) && - ((zcbor_uint32_decode( - 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_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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_encrypt_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_encrypt_req_input_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_encrypt_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_encrypt_req_output_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_encrypt_req_p_output_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 tmp_result = ((( - ((zcbor_uint32_expect(state, (69)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_output_bytes_req_p_handle)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_output_bytes_req_p_output)))) && - ((zcbor_uint32_decode( - 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_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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_decrypt_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_decrypt_req_input_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_decrypt_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_decrypt_req_output_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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; } 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)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_output_key_req_p_attributes)))) && - ((zcbor_uint32_decode( - state, (&(*result).psa_key_derivation_output_key_req_p_handle)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_raw_key_agreement_req_p_peer_key)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_raw_key_agreement_req_peer_key_length)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_raw_key_agreement_req_p_output)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_raw_key_agreement_req_output_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_generate_random_req_p_output)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_generate_key_req_p_attributes)))) && - ((zcbor_uint32_decode(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__); - } - - return tmp_result; -} - -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, (79)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_setup_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_setup_req_password_key)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_role_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_role_req_role))))))); - - 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_user_req(zcbor_state_t *state, struct psa_pake_set_user_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (81)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_user_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_user_req_p_user_id)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_user_req_user_id_len))))))); +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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_generate_iv_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_generate_iv_req_p_iv)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_generate_iv_req_iv_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_generate_iv_req_p_iv_length))))))); - 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__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (82)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_peer_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_peer_req_p_peer_id)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_peer_req_peer_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__); - } - - 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 res = ((( + ((zcbor_uint32_expect(state, (40)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_set_iv_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_cipher_set_iv_req_p_iv)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_set_iv_req_iv_length))))))); + + 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__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (83)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_context_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_set_context_req_p_context)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_pake_set_context_req_context_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_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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_output_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_output_req_step)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_output_req_p_output)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_output_req_output_size)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_input_req_p_handle)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_input_req_step)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_input_req_p_input)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(state, (&(*result).psa_pake_get_shared_key_req_p_handle)))) && - ((zcbor_uint32_decode(state, - (&(*result).psa_pake_get_shared_key_req_p_attributes)))) && - ((zcbor_uint32_decode(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)))) && - ((zcbor_uint32_decode(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_cipher_update_req(zcbor_state_t *state, + struct psa_cipher_update_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (41)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_update_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_update_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_update_req_input_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_update_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_update_req_output_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_finish_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_cipher_finish_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_cipher_finish_req_output_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_encrypt_req_p_nonce)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_encrypt_req_nonce_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_encrypt_req_p_additional_data)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_encrypt_req_additional_data_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_encrypt_req_p_plaintext)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_encrypt_req_plaintext_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_encrypt_req_p_ciphertext)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_encrypt_req_ciphertext_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_decrypt_req_p_nonce)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_decrypt_req_nonce_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_decrypt_req_p_additional_data)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_decrypt_req_additional_data_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_decrypt_req_p_ciphertext)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_decrypt_req_ciphertext_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_decrypt_req_p_plaintext)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_decrypt_req_plaintext_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_decrypt_req_p_plaintext_length))))))); + + log_result(state, res, __func__); + return res; +} + +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)))) && + ((zcbor_uint32_decode( + 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_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)))) && + ((zcbor_uint32_decode( + 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_aead_generate_nonce_req(zcbor_state_t *state, + struct psa_aead_generate_nonce_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (48)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_generate_nonce_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_generate_nonce_req_p_nonce)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_generate_nonce_req_nonce_size)))) && + ((zcbor_uint32_decode( + 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__); + + bool res = + (((((zcbor_uint32_expect(state, (49)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_set_nonce_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_set_nonce_req_p_nonce)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_set_nonce_req_nonce_length))))))); + + log_result(state, res, __func__); + return res; +} + +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 res = (( + (((zcbor_uint32_expect(state, (50)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_set_lengths_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_set_lengths_req_ad_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_set_lengths_req_plaintext_length))))))); + + log_result(state, res, __func__); + return res; +} + +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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_update_ad_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_update_ad_req_p_input)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_update_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_update_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_update_req_input_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_update_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_update_req_output_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_finish_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_finish_req_p_ciphertext)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_finish_req_ciphertext_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_finish_req_p_ciphertext_length)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_aead_finish_req_p_tag)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_finish_req_tag_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_verify_req_p_handle)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_aead_verify_req_p_plaintext)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_verify_req_plaintext_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_aead_verify_req_p_plaintext_length)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_aead_verify_req_p_tag)))) && + ((zcbor_uint32_decode(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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_sign_message_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_sign_message_req_input_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_sign_message_req_p_signature)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_sign_message_req_signature_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_sign_message_req_p_signature_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_verify_message_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_verify_message_req_input_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_verify_message_req_p_signature)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_sign_hash_req_p_hash)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_sign_hash_req_hash_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_sign_hash_req_p_signature)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_sign_hash_req_signature_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_verify_hash_req_p_hash)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_verify_hash_req_hash_length)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_verify_hash_req_p_signature)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_verify_hash_req_signature_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_encrypt_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_encrypt_req_input_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_encrypt_req_p_salt)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_encrypt_req_salt_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_encrypt_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_encrypt_req_output_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_encrypt_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_decrypt_req_p_input)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_decrypt_req_input_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_decrypt_req_p_salt)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_decrypt_req_salt_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_decrypt_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_asymmetric_decrypt_req_output_size)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_input_bytes_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_input_bytes_req_step)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_input_bytes_req_p_data)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + state, + (&(*result).psa_key_derivation_key_agreement_req_p_peer_key)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_output_bytes_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_output_bytes_req_p_output)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + state, + (&(*result).psa_key_derivation_output_key_req_p_attributes)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_output_key_req_p_handle)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_key_derivation_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; +} + +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 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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_raw_key_agreement_req_p_peer_key)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_raw_key_agreement_req_peer_key_length)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_raw_key_agreement_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_raw_key_agreement_req_output_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_raw_key_agreement_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +decode_psa_generate_random_req(zcbor_state_t *state, + struct psa_generate_random_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (73)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_generate_random_req_p_output)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_generate_random_req_output_size))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_generate_key_req(zcbor_state_t *state, + struct psa_generate_key_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_expect(state, (74)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_generate_key_req_p_attributes)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_generate_key_req_p_key))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_psa_pake_setup_req(zcbor_state_t *state, + struct psa_pake_setup_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_expect(state, (79)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_setup_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_setup_req_password_key)))) && + ((zcbor_uint32_decode( + 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__); + + bool res = (((((zcbor_uint32_expect(state, (80)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_role_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_role_req_role))))))); + + 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__); + + bool res = (((((zcbor_uint32_expect(state, (81)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_user_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_user_req_p_user_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_user_req_user_id_len))))))); + + 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__); + + bool res = (((((zcbor_uint32_expect(state, (82)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_peer_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_peer_req_p_peer_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_peer_req_peer_id_len))))))); + + 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__); + + bool res = + (((((zcbor_uint32_expect(state, (83)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_context_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_context_req_p_context)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_set_context_req_context_len))))))); + + 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 res = (( + (((zcbor_uint32_expect(state, (84)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_pake_output_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_pake_output_req_step)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_pake_output_req_p_output)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_pake_output_req_output_size)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_output_req_p_output_length))))))); + + log_result(state, res, __func__); + return res; +} + +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)))) && + ((zcbor_uint32_decode(state, + (&(*result).psa_pake_input_req_p_handle)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_pake_input_req_step)))) && + ((zcbor_uint32_decode(state, (&(*result).psa_pake_input_req_p_input)))) && + ((zcbor_uint32_decode(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)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_get_shared_key_req_p_handle)))) && + ((zcbor_uint32_decode( + state, (&(*result).psa_pake_get_shared_key_req_p_attributes)))) && + ((zcbor_uint32_decode( + 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)))) && + ((zcbor_uint32_decode( + 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 6e1ca8f86d41..55542f440dda 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,1833 +5,1595 @@ */ /* - * 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 -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_copy_key_req(zcbor_state_t *state, const struct psa_copy_key_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_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_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); -static bool encode_psa_import_key_req(zcbor_state_t *state, const struct psa_import_key_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); + const struct psa_destroy_key_req *input); +static bool encode_psa_import_key_req(zcbor_state_t *state, + const struct psa_import_key_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); + 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); + 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); +static bool encode_psa_key_derivation_key_agreement_req( + 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_key_derivation_get_capacity_req(zcbor_state_t *state, - const struct psa_key_derivation_get_capacity_req *input); +encode_psa_raw_key_agreement_req(zcbor_state_t *state, + const struct psa_raw_key_agreement_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_generate_random_req(zcbor_state_t *state, + const struct psa_generate_random_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); +encode_psa_generate_key_req(zcbor_state_t *state, + const struct psa_generate_key_req *input); +static bool encode_psa_pake_setup_req(zcbor_state_t *state, + const struct psa_pake_setup_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); +encode_psa_pake_set_role_req(zcbor_state_t *state, + const struct psa_pake_set_role_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_pake_set_user_req(zcbor_state_t *state, + const struct psa_pake_set_user_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); -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); +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_psa_get_key_attributes_req( + zcbor_state_t *state, const struct psa_get_key_attributes_req *input) { + zcbor_log("%s\r\n", __func__); -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 res = + (((((zcbor_uint32_put(state, (11)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_get_key_attributes_req_key)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_get_key_attributes_req_p_attributes))))))); - bool tmp_result = - (((((zcbor_uint32_put(state, (11)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_get_key_attributes_req_key)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_get_key_attributes_req_p_attributes))))))); + 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_reset_key_attributes_req( + zcbor_state_t *state, const struct psa_reset_key_attributes_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = + (((((zcbor_uint32_put(state, (12)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_reset_key_attributes_req_p_attributes))))))); + + 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__); +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 res = + (((((zcbor_uint32_put(state, (13)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_purge_key_req_key))))))); - bool tmp_result = - (((((zcbor_uint32_put(state, (12)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_reset_key_attributes_req_p_attributes))))))); + 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__); - 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, (14)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_copy_key_req_source_key)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_copy_key_req_p_attributes)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_copy_key_req_p_target_key))))))); - 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_destroy_key_req(zcbor_state_t *state, + const struct psa_destroy_key_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (15)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_destroy_key_req_key))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = (((((zcbor_uint32_put(state, (13)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_purge_key_req_key))))))); +static bool encode_psa_import_key_req(zcbor_state_t *state, + const struct psa_import_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, (16)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_import_key_req_p_attributes)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_import_key_req_p_data)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_import_key_req_data_length)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_import_key_req_p_key))))))); - 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_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)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_export_key_req_p_data)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_export_key_req_data_size)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_export_key_req_p_data_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (14)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_copy_key_req_source_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_copy_key_req_p_attributes)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_copy_key_req_p_target_key))))))); +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__); - 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, (18)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_export_public_key_req_key)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_export_public_key_req_p_data)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_export_public_key_req_data_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_export_public_key_req_p_data_length))))))); - 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))))))); - - 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_import_key_req(zcbor_state_t *state, const struct psa_import_key_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (16)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_import_key_req_p_attributes)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_import_key_req_p_data)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_import_key_req_data_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_import_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_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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_export_key_req_p_data)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_export_key_req_data_size)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_export_key_req_p_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; -} - -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__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (18)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_export_public_key_req_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_export_public_key_req_p_data)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_export_public_key_req_data_size)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_export_public_key_req_p_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; -} - -static bool encode_psa_hash_compute_req(zcbor_state_t *state, - const struct psa_hash_compute_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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compute_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compute_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compute_req_p_hash)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compute_req_hash_size)))) && - ((zcbor_uint32_encode(state, (&(*input).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 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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compare_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compare_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compare_req_p_hash)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_compare_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 encode_psa_hash_setup_req(zcbor_state_t *state, const struct psa_hash_setup_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (21)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).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 +encode_psa_hash_compute_req(zcbor_state_t *state, + const struct psa_hash_compute_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (19)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_compute_req_alg)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_compute_req_p_input)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_compute_req_input_length)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_compute_req_p_hash)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_compute_req_hash_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_hash_compute_req_p_hash_length))))))); + + 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_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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_compare_req_p_input)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_compare_req_input_length)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_compare_req_p_hash)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_compare_req_hash_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (22)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_update_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_update_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_update_req_input_length))))))); +static bool encode_psa_hash_setup_req(zcbor_state_t *state, + const struct psa_hash_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, (21)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_setup_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_setup_req_alg))))))); - return tmp_result; + 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_hash_update_req(zcbor_state_t *state, + const struct psa_hash_update_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (22)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_update_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_update_req_p_input)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_update_req_input_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (23)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_finish_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_finish_req_p_hash)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_finish_req_hash_size)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_finish_req_p_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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_finish_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_finish_req_p_hash)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_finish_req_hash_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_hash_finish_req_p_hash_length))))))); - 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_hash_verify_req(zcbor_state_t *state, + const struct psa_hash_verify_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (24)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_verify_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_verify_req_p_hash)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_hash_verify_req_hash_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (24)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_verify_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_verify_req_p_hash)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_verify_req_hash_length))))))); +static bool encode_psa_hash_abort_req(zcbor_state_t *state, + const struct psa_hash_abort_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, (25)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_hash_abort_req_p_handle))))))); - return tmp_result; + 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_hash_clone_req(zcbor_state_t *state, + const struct psa_hash_clone_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (25)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_abort_req_p_handle))))))); + bool res = (( + (((zcbor_uint32_put(state, (26)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_hash_clone_req_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).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__); - } + log_result(state, res, __func__); + return res; +} - return tmp_result; +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)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_p_input)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_compute_req_input_length)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_p_mac)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_compute_req_mac_size)))) && + ((zcbor_uint32_encode(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)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_p_input)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_verify_req_input_length)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_p_mac)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_verify_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_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, (26)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_clone_req_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_hash_clone_req_p_handle))))))); + bool res = ((( + ((zcbor_uint32_put(state, (29)))) && + ((zcbor_uint32_encode(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__); - } + log_result(state, res, __func__); + return res; +} - 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 res = (((((zcbor_uint32_put(state, (30)))) && + ((zcbor_uint32_encode( + 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))))))); + + 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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_p_mac)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_compute_req_mac_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_req_p_mac)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_update_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_update_req_p_input)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_sign_finish_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_sign_finish_req_p_mac)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_sign_finish_req_mac_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_finish_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_mac_verify_finish_req_p_mac)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_req_p_output)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_encrypt_req_output_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_req_p_output)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_decrypt_req_output_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_generate_iv_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_generate_iv_req_p_iv)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_generate_iv_req_iv_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_set_iv_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_set_iv_req_p_iv)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_update_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_update_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_update_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_update_req_p_output)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_update_req_output_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_finish_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_finish_req_p_output)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_cipher_finish_req_output_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_p_nonce)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_nonce_length)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_aead_encrypt_req_p_additional_data)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_aead_encrypt_req_additional_data_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_p_plaintext)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_plaintext_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_p_ciphertext)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_encrypt_req_ciphertext_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_p_nonce)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_nonce_length)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_aead_decrypt_req_p_additional_data)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_aead_decrypt_req_additional_data_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_p_ciphertext)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_aead_decrypt_req_ciphertext_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_p_plaintext)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_decrypt_req_plaintext_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_generate_nonce_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_generate_nonce_req_p_nonce)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_aead_generate_nonce_req_nonce_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_set_nonce_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_set_nonce_req_p_nonce)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_set_lengths_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_set_lengths_req_ad_length)))) && - ((zcbor_uint32_encode( - state, (&(*input).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 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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_ad_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_ad_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_ad_req_input_length))))))); +static bool encode_psa_mac_update_req(zcbor_state_t *state, + const struct psa_mac_update_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; + bool res = ((( + ((zcbor_uint32_put(state, (31)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_update_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_update_req_p_input)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_update_req_input_length))))))); + + 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_mac_sign_finish_req(zcbor_state_t *state, + const struct psa_mac_sign_finish_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (32)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_mac_sign_finish_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_sign_finish_req_p_mac)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_mac_sign_finish_req_mac_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_mac_sign_finish_req_p_mac_length))))))); - bool tmp_result = (( - (((zcbor_uint32_put(state, (52)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_req_p_output)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_req_output_size)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_req_p_output_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_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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_mac_verify_finish_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_mac_verify_finish_req_p_mac)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_mac_verify_finish_req_mac_length))))))); + + 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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_finish_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_finish_req_p_ciphertext)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_finish_req_ciphertext_size)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_aead_finish_req_p_ciphertext_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_finish_req_p_tag)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_finish_req_tag_size)))) && - ((zcbor_uint32_encode(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_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)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_mac_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; } -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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_verify_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_verify_req_p_plaintext)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_verify_req_plaintext_size)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_aead_verify_req_p_plaintext_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_aead_verify_req_p_tag)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_message_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_message_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_message_req_p_signature)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_message_req_signature_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_message_req_p_input)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_message_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_message_req_p_signature)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_p_hash)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_hash_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_p_signature)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_signature_size)))) && - ((zcbor_uint32_encode(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; +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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_encrypt_req_p_input)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_encrypt_req_input_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_encrypt_req_p_output)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_encrypt_req_output_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_encrypt_req_p_output_length))))))); + + 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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_hash_req_p_hash)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_hash_req_hash_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_verify_hash_req_p_signature)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_encrypt_req_p_input)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_asymmetric_encrypt_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_encrypt_req_p_salt)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_asymmetric_encrypt_req_salt_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_encrypt_req_p_output)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_asymmetric_encrypt_req_output_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_decrypt_req_p_input)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_asymmetric_decrypt_req_input_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_decrypt_req_p_salt)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_asymmetric_decrypt_req_salt_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_asymmetric_decrypt_req_p_output)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_asymmetric_decrypt_req_output_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(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_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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_decrypt_req_p_input)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_decrypt_req_input_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_decrypt_req_p_output)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_decrypt_req_output_size)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_generate_iv_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_generate_iv_req_p_iv)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_generate_iv_req_iv_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_generate_iv_req_p_iv_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_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, (63)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_get_capacity_req_handle)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_get_capacity_req_p_capacity))))))); + bool res = (( + (((zcbor_uint32_put(state, (40)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_set_iv_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_cipher_set_iv_req_p_iv)))) && + ((zcbor_uint32_encode(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__); - } + log_result(state, res, __func__); + return res; +} - 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 res = + (((((zcbor_uint32_put(state, (41)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_update_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_update_req_p_input)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_update_req_input_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_update_req_p_output)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_update_req_output_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_update_req_p_output_length))))))); + + 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__); +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, (64)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_set_capacity_req_p_handle)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_set_capacity_req_capacity))))))); + bool res = + (((((zcbor_uint32_put(state, (42)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_finish_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_cipher_finish_req_p_output)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_finish_req_output_size)))) && + ((zcbor_uint32_encode( + 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__); - } + log_result(state, res, __func__); + return res; +} + +static bool +encode_psa_cipher_abort_req(zcbor_state_t *state, + const struct psa_cipher_abort_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = (((((zcbor_uint32_put(state, (43)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_cipher_abort_req_p_handle))))))); + + 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)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_input_bytes_req_p_handle)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_key_derivation_input_bytes_req_step)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_key_derivation_input_bytes_req_p_data)))) && - ((zcbor_uint32_encode( - 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_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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_encrypt_req_p_nonce)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_encrypt_req_nonce_length)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_encrypt_req_p_additional_data)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_encrypt_req_additional_data_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_encrypt_req_p_plaintext)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_encrypt_req_plaintext_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_encrypt_req_p_ciphertext)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_encrypt_req_ciphertext_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_encrypt_req_p_ciphertext_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_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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_decrypt_req_p_nonce)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_decrypt_req_nonce_length)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_decrypt_req_p_additional_data)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_decrypt_req_additional_data_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_decrypt_req_p_ciphertext)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_decrypt_req_ciphertext_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_decrypt_req_p_plaintext)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_decrypt_req_plaintext_size)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_generate_nonce_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_generate_nonce_req_p_nonce)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_generate_nonce_req_nonce_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_generate_nonce_req_p_nonce_length))))))); + + log_result(state, res, __func__); + return res; +} + +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 res = + (((((zcbor_uint32_put(state, (49)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_set_nonce_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_set_nonce_req_p_nonce)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_set_nonce_req_nonce_length))))))); + + log_result(state, res, __func__); + return res; +} + +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 res = + (((((zcbor_uint32_put(state, (50)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_set_lengths_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_set_lengths_req_ad_length)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_set_lengths_req_plaintext_length))))))); + + log_result(state, res, __func__); + return res; +} + +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, (66)))) && - ((zcbor_uint32_encode( - 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, (51)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_update_ad_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_update_ad_req_p_input)))) && + ((zcbor_uint32_encode( + state, (&(*input).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__); - } + log_result(state, res, __func__); + return res; +} - return tmp_result; +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 res = ((( + ((zcbor_uint32_put(state, (52)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_update_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_aead_update_req_p_input)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_update_req_input_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_update_req_p_output)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_update_req_output_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_update_req_p_output_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_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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_finish_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_finish_req_p_ciphertext)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_finish_req_ciphertext_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_finish_req_p_ciphertext_length)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_aead_finish_req_p_tag)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_finish_req_tag_size)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_finish_req_p_tag_length))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = ((( - ((zcbor_uint32_put(state, (67)))) && - ((zcbor_uint32_encode(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))))))); +static bool +encode_psa_aead_verify_req(zcbor_state_t *state, + const struct psa_aead_verify_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, (54)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_verify_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_verify_req_p_plaintext)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_verify_req_plaintext_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_verify_req_p_plaintext_length)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_aead_verify_req_p_tag)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_aead_verify_req_tag_length))))))); - return tmp_result; + log_result(state, res, __func__); + return res; +} + +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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_aead_abort_req_p_handle))))))); + + log_result(state, res, __func__); + return res; +} + +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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_sign_message_req_p_input)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_sign_message_req_input_length)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_sign_message_req_p_signature)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_sign_message_req_signature_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_sign_message_req_p_signature_length))))))); + + log_result(state, res, __func__); + return res; +} + +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 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)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_verify_message_req_p_input)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_verify_message_req_input_length)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_verify_message_req_p_signature)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_sign_hash_req_p_hash)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_sign_hash_req_hash_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_sign_hash_req_p_signature)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_sign_hash_req_signature_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_sign_hash_req_p_signature_length))))))); + + 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 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)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_verify_hash_req_p_hash)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_verify_hash_req_hash_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_verify_hash_req_p_signature)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_encrypt_req_p_input)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_encrypt_req_input_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_asymmetric_encrypt_req_p_salt)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_encrypt_req_salt_length)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_encrypt_req_p_output)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_encrypt_req_output_size)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_decrypt_req_p_input)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_decrypt_req_input_length)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_asymmetric_decrypt_req_p_salt)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_decrypt_req_salt_length)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_decrypt_req_p_output)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_asymmetric_decrypt_req_output_size)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_input_bytes_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_input_bytes_req_step)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_input_bytes_req_p_data)))) && + ((zcbor_uint32_encode( + state, + (&(*input).psa_key_derivation_input_bytes_req_data_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__); + + bool res = ((( + ((zcbor_uint32_put(state, (66)))) && + ((zcbor_uint32_encode( + 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))))))); + + 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__); + + bool res = + (((((zcbor_uint32_put(state, (67)))) && + ((zcbor_uint32_encode( + 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))))))); + + 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)))) && - ((zcbor_uint32_encode( - 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)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_key_agreement_req_p_peer_key)))) && - ((zcbor_uint32_encode( - 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; + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, + (&(*input).psa_key_derivation_key_agreement_req_p_peer_key)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_output_bytes_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_output_bytes_req_p_output)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, + (&(*input).psa_key_derivation_output_key_req_p_attributes)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_key_derivation_output_key_req_p_handle)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + 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)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_raw_key_agreement_req_p_peer_key)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_raw_key_agreement_req_peer_key_length)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_raw_key_agreement_req_p_output)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_raw_key_agreement_req_output_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_raw_key_agreement_req_p_output_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)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_key_derivation_output_bytes_req_p_handle)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_key_derivation_output_bytes_req_p_output)))) && - ((zcbor_uint32_encode( - 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_generate_random_req(zcbor_state_t *state, + const struct psa_generate_random_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (73)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_generate_random_req_p_output)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_generate_random_req_output_size))))))); + + 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)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_output_key_req_p_attributes)))) && - ((zcbor_uint32_encode( - state, (&(*input).psa_key_derivation_output_key_req_p_handle)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode( - 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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_raw_key_agreement_req_p_peer_key)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_raw_key_agreement_req_peer_key_length)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_raw_key_agreement_req_p_output)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_raw_key_agreement_req_output_size)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_generate_random_req_p_output)))) && - ((zcbor_uint32_encode(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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_generate_key_req_p_attributes)))) && - ((zcbor_uint32_encode(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_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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_setup_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_setup_req_password_key)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_setup_req_p_cipher_suite))))))); +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__); - } - - 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__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (80)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_role_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_role_req_role))))))); + bool res = ((( + ((zcbor_uint32_put(state, (74)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_generate_key_req_p_attributes)))) && + ((zcbor_uint32_encode(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_psa_pake_set_user_req(zcbor_state_t *state, - const struct psa_pake_set_user_req *input) -{ - zcbor_log("%s\r\n", __func__); + log_result(state, res, __func__); + return res; +} - bool tmp_result = - (((((zcbor_uint32_put(state, (81)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_user_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_user_req_p_user_id)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_user_req_user_id_len))))))); +static bool encode_psa_pake_setup_req(zcbor_state_t *state, + const struct psa_pake_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, (79)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_setup_req_p_handle)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_pake_setup_req_password_key)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_pake_setup_req_p_cipher_suite))))))); - 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__); +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__); - bool tmp_result = - (((((zcbor_uint32_put(state, (82)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_peer_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_peer_req_p_peer_id)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_peer_req_peer_id_len))))))); + bool res = ((( + ((zcbor_uint32_put(state, (80)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_pake_set_role_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_role_req_role))))))); - 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_pake_set_user_req(zcbor_state_t *state, + const struct psa_pake_set_user_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_put(state, (81)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_user_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_user_req_p_user_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_user_req_user_id_len))))))); + + 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_psa_pake_set_peer_req(zcbor_state_t *state, + const struct psa_pake_set_peer_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_put(state, (82)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_peer_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_peer_req_p_peer_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_peer_req_peer_id_len))))))); - bool tmp_result = ((( - ((zcbor_uint32_put(state, (83)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_context_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_context_req_p_context)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_set_context_req_context_len))))))); + 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__); - 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, (83)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_context_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_context_req_p_context)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_set_context_req_context_len))))))); - return tmp_result; + 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)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_output_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_output_req_step)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_output_req_p_output)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_output_req_output_size)))) && - ((zcbor_uint32_encode(state, (&(*input).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 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, (85)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_input_req_p_handle)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_input_req_step)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_input_req_p_input)))) && - ((zcbor_uint32_encode(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__); - } - - return tmp_result; -} - -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__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (86)))) && - ((zcbor_uint32_encode(state, (&(*input).psa_pake_get_shared_key_req_p_handle)))) && - ((zcbor_uint32_encode(state, - (&(*input).psa_pake_get_shared_key_req_p_attributes)))) && - ((zcbor_uint32_encode(state, (&(*input).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 encode_psa_pake_abort_req(zcbor_state_t *state, const struct psa_pake_abort_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (87)))) && - ((zcbor_uint32_encode(state, (&(*input).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 encode_psa_crypto_rsp(zcbor_state_t *state, const struct psa_crypto_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - 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)))); - - 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_output_req(zcbor_state_t *state, + const struct psa_pake_output_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (84)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_pake_output_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_output_req_step)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_pake_output_req_p_output)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_pake_output_req_output_size)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_output_req_p_output_length))))))); + + 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__); + + bool res = ((( + ((zcbor_uint32_put(state, (85)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_input_req_p_handle)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_input_req_step)))) && + ((zcbor_uint32_encode(state, (&(*input).psa_pake_input_req_p_input)))) && + ((zcbor_uint32_encode(state, + (&(*input).psa_pake_input_req_input_length))))))); + + 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__); + + bool res = + (((((zcbor_uint32_put(state, (86)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_get_shared_key_req_p_handle)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_get_shared_key_req_p_attributes)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_get_shared_key_req_p_key))))))); + + 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_pake_abort_req(zcbor_state_t *state, + const struct psa_pake_abort_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_uint32_put(state, (87)))) && + ((zcbor_uint32_encode( + state, (&(*input).psa_pake_abort_req_p_handle))))))); + + 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__); + + 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)))); + + 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__); + + 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)))) @@ -1907,32 +1669,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 diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.c b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.c index 759d65071ac1..d1579a797271 100644 --- a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.c +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.c @@ -5,1105 +5,991 @@ */ /* - * 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 "suit_service_decode.h" +#include "zcbor_decode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_decode.h" -#include "suit_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_suit_missing_image_evt_nfy(zcbor_state_t *state, - struct suit_missing_image_evt_nfy *result); -static bool decode_suit_chunk_status_evt_nfy(zcbor_state_t *state, - struct suit_chunk_status_evt_nfy *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_suit_missing_image_evt_nfy(zcbor_state_t *state, + struct suit_missing_image_evt_nfy *result); +static bool +decode_suit_chunk_status_evt_nfy(zcbor_state_t *state, + struct suit_chunk_status_evt_nfy *result); static bool decode_suit_cache_info_entry(zcbor_state_t *state, - struct suit_cache_info_entry *result); -static bool decode_suit_trigger_update_req(zcbor_state_t *state, - struct suit_trigger_update_req *result); -static bool decode_suit_check_installed_component_digest_req( - zcbor_state_t *state, struct suit_check_installed_component_digest_req *result); + struct suit_cache_info_entry *result); static bool -decode_suit_get_installed_manifest_info_req(zcbor_state_t *state, - struct suit_get_installed_manifest_info_req *result); -static bool decode_suit_authenticate_manifest_req(zcbor_state_t *state, - struct suit_authenticate_manifest_req *result); +decode_suit_trigger_update_req(zcbor_state_t *state, + struct suit_trigger_update_req *result); +static bool decode_suit_check_installed_component_digest_req( + zcbor_state_t *state, + struct suit_check_installed_component_digest_req *result); +static bool decode_suit_get_installed_manifest_info_req( + zcbor_state_t *state, struct suit_get_installed_manifest_info_req *result); +static bool decode_suit_authenticate_manifest_req( + zcbor_state_t *state, struct suit_authenticate_manifest_req *result); +static bool decode_suit_authorize_unsigned_manifest_req( + zcbor_state_t *state, struct suit_authorize_unsigned_manifest_req *result); static bool -decode_suit_authorize_unsigned_manifest_req(zcbor_state_t *state, - struct suit_authorize_unsigned_manifest_req *result); -static bool decode_suit_authorize_seq_num_req(zcbor_state_t *state, - struct suit_authorize_seq_num_req *result); +decode_suit_authorize_seq_num_req(zcbor_state_t *state, + struct suit_authorize_seq_num_req *result); static bool decode_suit_check_component_compatibility_req( - zcbor_state_t *state, struct suit_check_component_compatibility_req *result); -static bool -decode_suit_get_supported_manifest_info_req(zcbor_state_t *state, - struct suit_get_supported_manifest_info_req *result); + zcbor_state_t *state, + struct suit_check_component_compatibility_req *result); +static bool decode_suit_get_supported_manifest_info_req( + zcbor_state_t *state, struct suit_get_supported_manifest_info_req *result); +static bool decode_suit_authorize_process_dependency_req( + zcbor_state_t *state, struct suit_authorize_process_dependency_req *result); +static bool decode_suit_evt_sub_req(zcbor_state_t *state, + struct suit_evt_sub_req *result); static bool -decode_suit_authorize_process_dependency_req(zcbor_state_t *state, - struct suit_authorize_process_dependency_req *result); -static bool decode_suit_evt_sub_req(zcbor_state_t *state, struct suit_evt_sub_req *result); -static bool decode_suit_chunk_enqueue_req(zcbor_state_t *state, - struct suit_chunk_enqueue_req *result); +decode_suit_chunk_enqueue_req(zcbor_state_t *state, + struct suit_chunk_enqueue_req *result); static bool decode_suit_chunk_status_req(zcbor_state_t *state, - struct suit_chunk_status_req *result); -static bool decode_suit_trigger_update_rsp(zcbor_state_t *state, - struct suit_trigger_update_rsp *result); -static bool decode_suit_check_installed_component_digest_rsp( - zcbor_state_t *state, struct suit_check_installed_component_digest_rsp *result); -static bool -decode_suit_get_installed_manifest_info_rsp(zcbor_state_t *state, - struct suit_get_installed_manifest_info_rsp *result); + struct suit_chunk_status_req *result); static bool -decode_suit_get_install_candidate_info_rsp(zcbor_state_t *state, - struct suit_get_install_candidate_info_rsp *result); -static bool decode_suit_authenticate_manifest_rsp(zcbor_state_t *state, - struct suit_authenticate_manifest_rsp *result); +decode_suit_trigger_update_rsp(zcbor_state_t *state, + struct suit_trigger_update_rsp *result); +static bool decode_suit_check_installed_component_digest_rsp( + zcbor_state_t *state, + struct suit_check_installed_component_digest_rsp *result); +static bool decode_suit_get_installed_manifest_info_rsp( + zcbor_state_t *state, struct suit_get_installed_manifest_info_rsp *result); +static bool decode_suit_get_install_candidate_info_rsp( + zcbor_state_t *state, struct suit_get_install_candidate_info_rsp *result); +static bool decode_suit_authenticate_manifest_rsp( + zcbor_state_t *state, struct suit_authenticate_manifest_rsp *result); +static bool decode_suit_authorize_unsigned_manifest_rsp( + zcbor_state_t *state, struct suit_authorize_unsigned_manifest_rsp *result); static bool -decode_suit_authorize_unsigned_manifest_rsp(zcbor_state_t *state, - struct suit_authorize_unsigned_manifest_rsp *result); -static bool decode_suit_authorize_seq_num_rsp(zcbor_state_t *state, - struct suit_authorize_seq_num_rsp *result); +decode_suit_authorize_seq_num_rsp(zcbor_state_t *state, + struct suit_authorize_seq_num_rsp *result); static bool decode_suit_check_component_compatibility_rsp( - zcbor_state_t *state, struct suit_check_component_compatibility_rsp *result); -static bool -decode_suit_get_supported_manifest_roles_rsp(zcbor_state_t *state, - struct suit_get_supported_manifest_roles_rsp *result); -static bool -decode_suit_get_supported_manifest_info_rsp(zcbor_state_t *state, - struct suit_get_supported_manifest_info_rsp *result); + zcbor_state_t *state, + struct suit_check_component_compatibility_rsp *result); +static bool decode_suit_get_supported_manifest_roles_rsp( + zcbor_state_t *state, struct suit_get_supported_manifest_roles_rsp *result); +static bool decode_suit_get_supported_manifest_info_rsp( + zcbor_state_t *state, struct suit_get_supported_manifest_info_rsp *result); +static bool decode_suit_authorize_process_dependency_rsp( + zcbor_state_t *state, struct suit_authorize_process_dependency_rsp *result); +static bool decode_suit_evt_sub_rsp(zcbor_state_t *state, + struct suit_evt_sub_rsp *result); static bool -decode_suit_authorize_process_dependency_rsp(zcbor_state_t *state, - struct suit_authorize_process_dependency_rsp *result); -static bool decode_suit_evt_sub_rsp(zcbor_state_t *state, struct suit_evt_sub_rsp *result); -static bool decode_suit_chunk_enqueue_rsp(zcbor_state_t *state, - struct suit_chunk_enqueue_rsp *result); +decode_suit_chunk_enqueue_rsp(zcbor_state_t *state, + struct suit_chunk_enqueue_rsp *result); static bool decode_suit_chunk_info_entry(zcbor_state_t *state, - struct suit_chunk_info_entry *result); + struct suit_chunk_info_entry *result); static bool decode_suit_chunk_status_rsp(zcbor_state_t *state, - struct suit_chunk_status_rsp *result); + struct suit_chunk_status_rsp *result); static bool decode_suit_nfy(zcbor_state_t *state, struct suit_nfy *result); static bool decode_suit_rsp(zcbor_state_t *state, struct suit_rsp *result); static bool decode_suit_req(zcbor_state_t *state, struct suit_req *result); -static bool decode_suit_missing_image_evt_nfy(zcbor_state_t *state, - struct suit_missing_image_evt_nfy *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (41)))) && - ((zcbor_bstr_decode(state, (&(*result).suit_missing_image_evt_nfy_resource_id)))) && - ((zcbor_uint32_decode( - state, (&(*result).suit_missing_image_evt_nfy_stream_session_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_suit_chunk_status_evt_nfy(zcbor_state_t *state, - struct suit_chunk_status_evt_nfy *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (42)))) && - ((zcbor_uint32_decode( - state, (&(*result).suit_chunk_status_evt_nfy_stream_session_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_suit_cache_info_entry(zcbor_state_t *state, struct suit_cache_info_entry *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_decode(state, (&(*result).suit_cache_info_entry_addr)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_cache_info_entry_size))))))); +static bool +decode_suit_missing_image_evt_nfy(zcbor_state_t *state, + struct suit_missing_image_evt_nfy *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, (41)))) && + ((zcbor_bstr_decode( + state, (&(*result).suit_missing_image_evt_nfy_resource_id)))) && + ((zcbor_uint32_decode( + state, + (&(*result).suit_missing_image_evt_nfy_stream_session_id))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_suit_trigger_update_req(zcbor_state_t *state, - struct suit_trigger_update_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (1)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_trigger_update_req_addr)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_trigger_update_req_size)))) && - ((zcbor_list_start_decode(state) && - ((zcbor_multi_decode( - 0, 6, - &(*result).suit_trigger_update_req_caches_suit_cache_info_entry_m_count, - (zcbor_decoder_t *)decode_suit_cache_info_entry, state, - (&(*result).suit_trigger_update_req_caches_suit_cache_info_entry_m), - sizeof(struct suit_cache_info_entry))) || - (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_suit_chunk_status_evt_nfy(zcbor_state_t *state, + struct suit_chunk_status_evt_nfy *result) { + zcbor_log("%s\r\n", __func__); -static bool decode_suit_check_installed_component_digest_req( - zcbor_state_t *state, struct suit_check_installed_component_digest_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (2)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_check_installed_component_digest_req_component_id)))) && - ((zcbor_int32_decode( - state, (&(*result).suit_check_installed_component_digest_req_alg_id)))) && - ((zcbor_bstr_decode( - state, (&(*result).suit_check_installed_component_digest_req_digest))))))); - - 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, (42)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_chunk_status_evt_nfy_stream_session_id))))))); -static bool -decode_suit_get_installed_manifest_info_req(zcbor_state_t *state, - struct suit_get_installed_manifest_info_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (3)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_get_installed_manifest_info_req_manifest_class_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; + log_result(state, res, __func__); + return res; } -static bool decode_suit_authenticate_manifest_req(zcbor_state_t *state, - struct suit_authenticate_manifest_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (10)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_authenticate_manifest_req_manifest_component_id)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_authenticate_manifest_req_alg_id)))) && - ((zcbor_bstr_decode(state, (&(*result).suit_authenticate_manifest_req_key_id)))) && - ((zcbor_bstr_decode(state, - (&(*result).suit_authenticate_manifest_req_signature)))) && - ((zcbor_uint32_decode(state, - (&(*result).suit_authenticate_manifest_req_data_addr)))) && - ((zcbor_uint32_decode(state, - (&(*result).suit_authenticate_manifest_req_data_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_suit_cache_info_entry(zcbor_state_t *state, + struct suit_cache_info_entry *result) { + zcbor_log("%s\r\n", __func__); -static bool -decode_suit_authorize_unsigned_manifest_req(zcbor_state_t *state, - struct suit_authorize_unsigned_manifest_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (11)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_authorize_unsigned_manifest_req_manifest_component_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; -} + bool res = ((( + ((zcbor_uint32_decode(state, (&(*result).suit_cache_info_entry_addr)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_cache_info_entry_size))))))); -static bool decode_suit_authorize_seq_num_req(zcbor_state_t *state, - struct suit_authorize_seq_num_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (12)))) && - ((zcbor_bstr_decode( - state, (&(*result).suit_authorize_seq_num_req_manifest_component_id)))) && - ((zcbor_uint32_decode(state, - (&(*result).suit_authorize_seq_num_req_command_seq)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_authorize_seq_num_req_seq_num))))))); - - 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_suit_check_component_compatibility_req(zcbor_state_t *state, - struct suit_check_component_compatibility_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (13)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_check_component_compatibility_req_manifest_class_id)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_check_component_compatibility_req_component_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; +decode_suit_trigger_update_req(zcbor_state_t *state, + struct suit_trigger_update_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (1)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_trigger_update_req_addr)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_trigger_update_req_size)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 6, + &(*result) + .suit_trigger_update_req_caches_suit_cache_info_entry_m_count, + (zcbor_decoder_t *)decode_suit_cache_info_entry, state, + (*&(*result) + .suit_trigger_update_req_caches_suit_cache_info_entry_m), + sizeof(struct suit_cache_info_entry))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))))); + + if (false) { + /* For testing that the types of the arguments are correct. + * A compiler error here means a bug in zcbor. + */ + decode_suit_cache_info_entry( + state, + (*&(*result).suit_trigger_update_req_caches_suit_cache_info_entry_m)); + } + + log_result(state, res, __func__); + return res; } -static bool -decode_suit_get_supported_manifest_info_req(zcbor_state_t *state, - struct suit_get_supported_manifest_info_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (19)))) && - ((zcbor_int32_decode( - state, (&(*result).suit_get_supported_manifest_info_req_role))))))); - - 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_suit_check_installed_component_digest_req( + zcbor_state_t *state, + struct suit_check_installed_component_digest_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (2)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_check_installed_component_digest_req_component_id)))) && + ((zcbor_int32_decode( + state, + (&(*result).suit_check_installed_component_digest_req_alg_id)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_check_installed_component_digest_req_digest))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_get_installed_manifest_info_req( + zcbor_state_t *state, struct suit_get_installed_manifest_info_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (3)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_get_installed_manifest_info_req_manifest_class_id))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_authenticate_manifest_req( + zcbor_state_t *state, struct suit_authenticate_manifest_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (10)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_authenticate_manifest_req_manifest_component_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_authenticate_manifest_req_alg_id)))) && + ((zcbor_bstr_decode( + state, (&(*result).suit_authenticate_manifest_req_key_id)))) && + ((zcbor_bstr_decode( + state, (&(*result).suit_authenticate_manifest_req_signature)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_authenticate_manifest_req_data_addr)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_authenticate_manifest_req_data_size))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_authorize_unsigned_manifest_req( + zcbor_state_t *state, struct suit_authorize_unsigned_manifest_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (11)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_authorize_unsigned_manifest_req_manifest_component_id))))))); + + log_result(state, res, __func__); + return res; } static bool -decode_suit_authorize_process_dependency_req(zcbor_state_t *state, - struct suit_authorize_process_dependency_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (21)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_authorize_process_dependency_req_dependee_class_id)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_authorize_process_dependency_req_dependent_class_id)))) && - ((zcbor_int32_decode( - state, (&(*result).suit_authorize_process_dependency_req_seq_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_suit_evt_sub_req(zcbor_state_t *state, struct suit_evt_sub_req *result) -{ - zcbor_log("%s\r\n", __func__); +decode_suit_authorize_seq_num_req(zcbor_state_t *state, + struct suit_authorize_seq_num_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_expect(state, (40)))) && - ((zcbor_bool_decode(state, (&(*result).suit_evt_sub_req_subscribe))))))); + bool res = + (((((zcbor_uint32_expect(state, (12)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_authorize_seq_num_req_manifest_component_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_authorize_seq_num_req_command_seq)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_authorize_seq_num_req_seq_num))))))); - 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_suit_chunk_enqueue_req(zcbor_state_t *state, - struct suit_chunk_enqueue_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (43)))) && - ((zcbor_uint32_decode(state, - (&(*result).suit_chunk_enqueue_req_stream_session_id)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_chunk_enqueue_req_chunk_id)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_chunk_enqueue_req_offset)))) && - ((zcbor_bool_decode(state, (&(*result).suit_chunk_enqueue_req_last_chunk)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_chunk_enqueue_req_addr)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_chunk_enqueue_req_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; + log_result(state, res, __func__); + return res; } -static bool decode_suit_chunk_status_req(zcbor_state_t *state, struct suit_chunk_status_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (44)))) && - ((zcbor_uint32_decode(state, - (&(*result).suit_chunk_status_req_stream_session_id))))))); +static bool decode_suit_check_component_compatibility_req( + zcbor_state_t *state, + struct suit_check_component_compatibility_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, (13)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_check_component_compatibility_req_manifest_class_id)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_check_component_compatibility_req_component_id))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_suit_trigger_update_rsp(zcbor_state_t *state, - struct suit_trigger_update_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (1)))) && - ((zcbor_int32_decode(state, (&(*result).suit_trigger_update_rsp_ret))))))); +static bool decode_suit_get_supported_manifest_info_req( + zcbor_state_t *state, struct suit_get_supported_manifest_info_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, (19)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_supported_manifest_info_req_role))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_suit_check_installed_component_digest_rsp( - zcbor_state_t *state, struct suit_check_installed_component_digest_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (2)))) && - ((zcbor_int32_decode( - state, (&(*result).suit_check_installed_component_digest_rsp_ret))))))); - - 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_suit_authorize_process_dependency_req( + zcbor_state_t *state, + struct suit_authorize_process_dependency_req *result) { + zcbor_log("%s\r\n", __func__); -static bool -decode_suit_get_installed_manifest_info_rsp(zcbor_state_t *state, - struct suit_get_installed_manifest_info_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (3)))) && - ((zcbor_int32_decode(state, - (&(*result).suit_get_installed_manifest_info_rsp_ret)))) && - ((zcbor_uint32_decode( - state, (&(*result).suit_get_installed_manifest_info_rsp_seq_num)))) && - ((zcbor_list_start_decode(state) && - ((zcbor_multi_decode( - 0, 5, &(*result).suit_get_installed_manifest_info_rsp_semver_int_count, - (zcbor_decoder_t *)zcbor_int32_decode, state, - (&(*result).suit_get_installed_manifest_info_rsp_semver_int), - sizeof(int32_t))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state))) && - ((zcbor_int32_decode( - state, (&(*result).suit_get_installed_manifest_info_rsp_digest_status)))) && - ((zcbor_int32_decode(state, - (&(*result).suit_get_installed_manifest_info_rsp_alg_id)))) && - ((zcbor_bstr_decode(state, - (&(*result).suit_get_installed_manifest_info_rsp_digest))))))); - - 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, (21)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_authorize_process_dependency_req_dependee_class_id)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_authorize_process_dependency_req_dependent_class_id)))) && + ((zcbor_int32_decode( + state, + (&(*result).suit_authorize_process_dependency_req_seq_id))))))); -static bool -decode_suit_get_install_candidate_info_rsp(zcbor_state_t *state, - struct suit_get_install_candidate_info_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (4)))) && - ((zcbor_int32_decode(state, - (&(*result).suit_get_install_candidate_info_rsp_ret)))) && - ((zcbor_bstr_decode( - state, - (&(*result).suit_get_install_candidate_info_rsp_manifest_class_id)))) && - ((zcbor_uint32_decode(state, - (&(*result).suit_get_install_candidate_info_rsp_seq_num)))) && - ((zcbor_list_start_decode(state) && - ((zcbor_multi_decode( - 0, 5, &(*result).suit_get_install_candidate_info_rsp_semver_int_count, - (zcbor_decoder_t *)zcbor_int32_decode, state, - (&(*result).suit_get_install_candidate_info_rsp_semver_int), - sizeof(int32_t))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state))) && - ((zcbor_int32_decode(state, - (&(*result).suit_get_install_candidate_info_rsp_alg_id)))) && - ((zcbor_bstr_decode(state, - (&(*result).suit_get_install_candidate_info_rsp_digest))))))); - - 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_suit_authenticate_manifest_rsp(zcbor_state_t *state, - struct suit_authenticate_manifest_rsp *result) -{ - zcbor_log("%s\r\n", __func__); +static bool decode_suit_evt_sub_req(zcbor_state_t *state, + struct suit_evt_sub_req *result) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = (( - (((zcbor_uint32_expect(state, (10)))) && - ((zcbor_int32_decode(state, (&(*result).suit_authenticate_manifest_rsp_ret))))))); + bool res = (( + (((zcbor_uint32_expect(state, (40)))) && + ((zcbor_bool_decode(state, (&(*result).suit_evt_sub_req_subscribe))))))); - 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_suit_authorize_unsigned_manifest_rsp(zcbor_state_t *state, - struct suit_authorize_unsigned_manifest_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (11)))) && - ((zcbor_int32_decode(state, - (&(*result).suit_authorize_unsigned_manifest_rsp_ret))))))); - - 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_suit_chunk_enqueue_req(zcbor_state_t *state, + struct suit_chunk_enqueue_req *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (43)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_chunk_enqueue_req_stream_session_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_chunk_enqueue_req_chunk_id)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_chunk_enqueue_req_offset)))) && + ((zcbor_bool_decode( + state, (&(*result).suit_chunk_enqueue_req_last_chunk)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_chunk_enqueue_req_addr)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_chunk_enqueue_req_size))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_suit_authorize_seq_num_rsp(zcbor_state_t *state, - struct suit_authorize_seq_num_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (12)))) && - ((zcbor_int32_decode(state, (&(*result).suit_authorize_seq_num_rsp_ret))))))); - - 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_suit_chunk_status_req(zcbor_state_t *state, + struct suit_chunk_status_req *result) { + zcbor_log("%s\r\n", __func__); - return tmp_result; -} + bool res = + (((((zcbor_uint32_expect(state, (44)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_chunk_status_req_stream_session_id))))))); -static bool -decode_suit_check_component_compatibility_rsp(zcbor_state_t *state, - struct suit_check_component_compatibility_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (13)))) && - ((zcbor_int32_decode( - state, (&(*result).suit_check_component_compatibility_rsp_ret))))))); - - 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_suit_get_supported_manifest_roles_rsp(zcbor_state_t *state, - struct suit_get_supported_manifest_roles_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_expect(state, (18)))) && - ((zcbor_int32_decode(state, - (&(*result).suit_get_supported_manifest_roles_rsp_ret)))) && - ((zcbor_list_start_decode(state) && - ((zcbor_multi_decode( - 0, 20, &(*result).suit_get_supported_manifest_roles_rsp_roles_int_count, - (zcbor_decoder_t *)zcbor_int32_decode, state, - (&(*result).suit_get_supported_manifest_roles_rsp_roles_int), - sizeof(int32_t))) || - (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; -} +decode_suit_trigger_update_rsp(zcbor_state_t *state, + struct suit_trigger_update_rsp *result) { + zcbor_log("%s\r\n", __func__); -static bool -decode_suit_get_supported_manifest_info_rsp(zcbor_state_t *state, - struct suit_get_supported_manifest_info_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (19)))) && - ((zcbor_int32_decode(state, - (&(*result).suit_get_supported_manifest_info_rsp_ret)))) && - ((zcbor_int32_decode(state, - (&(*result).suit_get_supported_manifest_info_rsp_role)))) && - ((zcbor_bstr_decode( - state, (&(*result).suit_get_supported_manifest_info_rsp_vendor_id)))) && - ((zcbor_bstr_decode(state, - (&(*result).suit_get_supported_manifest_info_rsp_class_id)))) && - ((zcbor_int32_decode( - state, - (&(*result) - .suit_get_supported_manifest_info_rsp_downgrade_prevention_policy)))) && - ((zcbor_int32_decode( - state, - (&(*result) - .suit_get_supported_manifest_info_rsp_independent_updateability_policy)))) && - ((zcbor_int32_decode( - state, - (&(*result) - .suit_get_supported_manifest_info_rsp_signature_verification_policy))))))); - - 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, (1)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_trigger_update_rsp_ret))))))); -static bool -decode_suit_authorize_process_dependency_rsp(zcbor_state_t *state, - struct suit_authorize_process_dependency_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (21)))) && - ((zcbor_int32_decode( - state, (&(*result).suit_authorize_process_dependency_rsp_ret))))))); - - 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_suit_evt_sub_rsp(zcbor_state_t *state, struct suit_evt_sub_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((((zcbor_uint32_expect(state, (40)))) && - ((zcbor_int32_decode(state, (&(*result).suit_evt_sub_rsp_ret))))))); - - 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_suit_chunk_enqueue_rsp(zcbor_state_t *state, - struct suit_chunk_enqueue_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_expect(state, (43)))) && - ((zcbor_int32_decode(state, (&(*result).suit_chunk_enqueue_rsp_ret))))))); - - 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_suit_check_installed_component_digest_rsp( + zcbor_state_t *state, + struct suit_check_installed_component_digest_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (2)))) && + ((zcbor_int32_decode( + state, + (&(*result).suit_check_installed_component_digest_rsp_ret))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_get_installed_manifest_info_rsp( + zcbor_state_t *state, struct suit_get_installed_manifest_info_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (3)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_installed_manifest_info_rsp_ret)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_get_installed_manifest_info_rsp_seq_num)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 5, + &(*result).suit_get_installed_manifest_info_rsp_semver_int_count, + (zcbor_decoder_t *)zcbor_int32_decode, state, + (*&(*result).suit_get_installed_manifest_info_rsp_semver_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state))) && + ((zcbor_int32_decode( + state, + (&(*result).suit_get_installed_manifest_info_rsp_digest_status)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_installed_manifest_info_rsp_alg_id)))) && + ((zcbor_bstr_decode( + state, (&(*result).suit_get_installed_manifest_info_rsp_digest))))))); + + if (false) { + /* For testing that the types of the arguments are correct. + * A compiler error here means a bug in zcbor. + */ + zcbor_int32_decode( + state, (*&(*result).suit_get_installed_manifest_info_rsp_semver_int)); + } + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_get_install_candidate_info_rsp( + zcbor_state_t *state, struct suit_get_install_candidate_info_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (4)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_install_candidate_info_rsp_ret)))) && + ((zcbor_bstr_decode( + state, + (&(*result) + .suit_get_install_candidate_info_rsp_manifest_class_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_get_install_candidate_info_rsp_seq_num)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 5, + &(*result).suit_get_install_candidate_info_rsp_semver_int_count, + (zcbor_decoder_t *)zcbor_int32_decode, state, + (*&(*result).suit_get_install_candidate_info_rsp_semver_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_install_candidate_info_rsp_alg_id)))) && + ((zcbor_bstr_decode( + state, (&(*result).suit_get_install_candidate_info_rsp_digest))))))); + + if (false) { + /* For testing that the types of the arguments are correct. + * A compiler error here means a bug in zcbor. + */ + zcbor_int32_decode( + state, (*&(*result).suit_get_install_candidate_info_rsp_semver_int)); + } + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_authenticate_manifest_rsp( + zcbor_state_t *state, struct suit_authenticate_manifest_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (10)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_authenticate_manifest_rsp_ret))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_authorize_unsigned_manifest_rsp( + zcbor_state_t *state, struct suit_authorize_unsigned_manifest_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (11)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_authorize_unsigned_manifest_rsp_ret))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_suit_chunk_info_entry(zcbor_state_t *state, struct suit_chunk_info_entry *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_decode(state, (&(*result).suit_chunk_info_entry_chunk_id)))) && - ((zcbor_uint32_decode(state, (&(*result).suit_chunk_info_entry_status))))))); +static bool +decode_suit_authorize_seq_num_rsp(zcbor_state_t *state, + struct suit_authorize_seq_num_rsp *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, (12)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_authorize_seq_num_rsp_ret))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } -static bool decode_suit_chunk_status_rsp(zcbor_state_t *state, struct suit_chunk_status_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_expect(state, (44)))) && - ((zcbor_int32_decode(state, (&(*result).suit_chunk_status_rsp_ret)))) && - ((zcbor_list_start_decode(state) && - ((zcbor_multi_decode( - 0, 3, - &(*result).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count, - (zcbor_decoder_t *)decode_suit_chunk_info_entry, state, - (&(*result).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m), - sizeof(struct suit_chunk_info_entry))) || - (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_suit_check_component_compatibility_rsp( + zcbor_state_t *state, + struct suit_check_component_compatibility_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (13)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_check_component_compatibility_rsp_ret))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_get_supported_manifest_roles_rsp( + zcbor_state_t *state, + struct suit_get_supported_manifest_roles_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (18)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_supported_manifest_roles_rsp_ret)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 20, + &(*result).suit_get_supported_manifest_roles_rsp_roles_int_count, + (zcbor_decoder_t *)zcbor_int32_decode, state, + (*&(*result).suit_get_supported_manifest_roles_rsp_roles_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))))); + + if (false) { + /* For testing that the types of the arguments are correct. + * A compiler error here means a bug in zcbor. + */ + zcbor_int32_decode( + state, (*&(*result).suit_get_supported_manifest_roles_rsp_roles_int)); + } + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_get_supported_manifest_info_rsp( + zcbor_state_t *state, struct suit_get_supported_manifest_info_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (19)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_supported_manifest_info_rsp_ret)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_supported_manifest_info_rsp_role)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_get_supported_manifest_info_rsp_vendor_id)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_get_supported_manifest_info_rsp_class_id)))) && + ((zcbor_int32_decode( + state, + (&(*result) + .suit_get_supported_manifest_info_rsp_downgrade_prevention_policy)))) && + ((zcbor_int32_decode( + state, + (&(*result) + .suit_get_supported_manifest_info_rsp_independent_updateability_policy)))) && + ((zcbor_int32_decode( + state, + (&(*result) + .suit_get_supported_manifest_info_rsp_signature_verification_policy))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_authorize_process_dependency_rsp( + zcbor_state_t *state, + struct suit_authorize_process_dependency_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_expect(state, (21)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_authorize_process_dependency_rsp_ret))))))); + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_evt_sub_rsp(zcbor_state_t *state, + struct suit_evt_sub_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_expect(state, (40)))) && + ((zcbor_int32_decode(state, (&(*result).suit_evt_sub_rsp_ret))))))); + + log_result(state, res, __func__); + return res; } -static bool decode_suit_nfy(zcbor_state_t *state, struct suit_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_suit_missing_image_evt_nfy( - state, - (&(*result).suit_nfy_msg_suit_missing_image_evt_nfy_m)))) && - (((*result).suit_nfy_msg_choice = - suit_nfy_msg_suit_missing_image_evt_nfy_m_c), - true)) || - (zcbor_union_elem_code(state) && - (((decode_suit_chunk_status_evt_nfy( - state, - (&(*result).suit_nfy_msg_suit_chunk_status_evt_nfy_m)))) && - (((*result).suit_nfy_msg_choice = - suit_nfy_msg_suit_chunk_status_evt_nfy_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_suit_chunk_enqueue_rsp(zcbor_state_t *state, + struct suit_chunk_enqueue_rsp *result) { + zcbor_log("%s\r\n", __func__); -static bool decode_suit_rsp(zcbor_state_t *state, struct suit_rsp *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_suit_trigger_update_rsp( - state, - (&(*result).suit_rsp_msg_suit_trigger_update_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_trigger_update_rsp_m_c), - true)) || - (zcbor_union_elem_code(state) && - (((decode_suit_check_installed_component_digest_rsp( - state, - (&(*result) - .suit_rsp_msg_suit_check_installed_component_digest_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_get_installed_manifest_info_rsp( - state, - (&(*result) - .suit_rsp_msg_suit_get_installed_manifest_info_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_get_install_candidate_info_rsp( - state, - (&(*result) - .suit_rsp_msg_suit_get_install_candidate_info_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_authenticate_manifest_rsp( - state, - (&(*result).suit_rsp_msg_suit_authenticate_manifest_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_authenticate_manifest_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_authorize_unsigned_manifest_rsp( - state, - (&(*result) - .suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_authorize_seq_num_rsp( - state, - (&(*result).suit_rsp_msg_suit_authorize_seq_num_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_authorize_seq_num_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_check_component_compatibility_rsp( - state, - (&(*result) - .suit_rsp_msg_suit_check_component_compatibility_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_check_component_compatibility_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_get_supported_manifest_roles_rsp( - state, - (&(*result) - .suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_get_supported_manifest_info_rsp( - state, - (&(*result) - .suit_rsp_msg_suit_get_supported_manifest_info_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_authorize_process_dependency_rsp( - state, - (&(*result) - .suit_rsp_msg_suit_authorize_process_dependency_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_evt_sub_rsp( - state, (&(*result).suit_rsp_msg_suit_evt_sub_rsp_m)))) && - (((*result).suit_rsp_msg_choice = suit_rsp_msg_suit_evt_sub_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_chunk_enqueue_rsp( - state, (&(*result).suit_rsp_msg_suit_chunk_enqueue_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_chunk_enqueue_rsp_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_chunk_status_rsp( - state, (&(*result).suit_rsp_msg_suit_chunk_status_rsp_m)))) && - (((*result).suit_rsp_msg_choice = - suit_rsp_msg_suit_chunk_status_rsp_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; -} + bool res = ((( + ((zcbor_uint32_expect(state, (43)))) && + ((zcbor_int32_decode(state, (&(*result).suit_chunk_enqueue_rsp_ret))))))); -static bool decode_suit_req(zcbor_state_t *state, struct suit_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_suit_trigger_update_req( - state, - (&(*result).suit_req_msg_suit_trigger_update_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_trigger_update_req_m_c), - true)) || - (zcbor_union_elem_code(state) && - (((decode_suit_check_installed_component_digest_req( - state, - (&(*result) - .suit_req_msg_suit_check_installed_component_digest_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_check_installed_component_digest_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_get_installed_manifest_info_req( - state, - (&(*result) - .suit_req_msg_suit_get_installed_manifest_info_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_get_installed_manifest_info_req_m_c), - true))) || - (((zcbor_uint32_expect_union(state, (4)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_get_install_candidate_info_req_m_c), - true)) || - (zcbor_union_elem_code(state) && - (((decode_suit_authenticate_manifest_req( - state, - (&(*result).suit_req_msg_suit_authenticate_manifest_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_authenticate_manifest_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_authorize_unsigned_manifest_req( - state, - (&(*result) - .suit_req_msg_suit_authorize_unsigned_manifest_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_authorize_unsigned_manifest_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_authorize_seq_num_req( - state, - (&(*result).suit_req_msg_suit_authorize_seq_num_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_authorize_seq_num_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_check_component_compatibility_req( - state, - (&(*result) - .suit_req_msg_suit_check_component_compatibility_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_check_component_compatibility_req_m_c), - true))) || - (((zcbor_uint32_expect_union(state, (18)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_get_supported_manifest_roles_req_m_c), - true)) || - (zcbor_union_elem_code(state) && - (((decode_suit_get_supported_manifest_info_req( - state, - (&(*result) - .suit_req_msg_suit_get_supported_manifest_info_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_get_supported_manifest_info_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_authorize_process_dependency_req( - state, - (&(*result) - .suit_req_msg_suit_authorize_process_dependency_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_authorize_process_dependency_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_evt_sub_req( - state, (&(*result).suit_req_msg_suit_evt_sub_req_m)))) && - (((*result).suit_req_msg_choice = suit_req_msg_suit_evt_sub_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_chunk_enqueue_req( - state, (&(*result).suit_req_msg_suit_chunk_enqueue_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_chunk_enqueue_req_m_c), - true))) || - (zcbor_union_elem_code(state) && - (((decode_suit_chunk_status_req( - state, (&(*result).suit_req_msg_suit_chunk_status_req_m)))) && - (((*result).suit_req_msg_choice = - suit_req_msg_suit_chunk_status_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; + log_result(state, res, __func__); + return res; } -int cbor_decode_suit_req(const uint8_t *payload, size_t payload_len, struct suit_req *result, - size_t *payload_len_out) -{ - zcbor_state_t states[5]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_suit_req, - sizeof(states) / sizeof(zcbor_state_t), 1); -} +static bool decode_suit_chunk_info_entry(zcbor_state_t *state, + struct suit_chunk_info_entry *result) { + zcbor_log("%s\r\n", __func__); -int cbor_decode_suit_rsp(const uint8_t *payload, size_t payload_len, struct suit_rsp *result, - size_t *payload_len_out) -{ - zcbor_state_t states[5]; + bool res = (((((zcbor_uint32_decode( + state, (&(*result).suit_chunk_info_entry_chunk_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_chunk_info_entry_status))))))); - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_suit_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); + log_result(state, res, __func__); + return res; } -int cbor_decode_suit_nfy(const uint8_t *payload, size_t payload_len, struct suit_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_suit_nfy, - sizeof(states) / sizeof(zcbor_state_t), 1); +static bool decode_suit_chunk_status_rsp(zcbor_state_t *state, + struct suit_chunk_status_rsp *result) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_expect(state, (44)))) && + ((zcbor_int32_decode(state, (&(*result).suit_chunk_status_rsp_ret)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 3, + &(*result) + .suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count, + (zcbor_decoder_t *)decode_suit_chunk_info_entry, state, + (*&(*result) + .suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m), + sizeof(struct suit_chunk_info_entry))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))))); + + if (false) { + /* For testing that the types of the arguments are correct. + * A compiler error here means a bug in zcbor. + */ + decode_suit_chunk_info_entry( + state, + (*&(*result).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m)); + } + + log_result(state, res, __func__); + return res; +} + +static bool decode_suit_nfy(zcbor_state_t *state, struct suit_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_suit_missing_image_evt_nfy( + state, + (&(*result) + .suit_nfy_msg_suit_missing_image_evt_nfy_m)))) && + (((*result).suit_nfy_msg_choice = + suit_nfy_msg_suit_missing_image_evt_nfy_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_status_evt_nfy( + state, + (&(*result) + .suit_nfy_msg_suit_chunk_status_evt_nfy_m)))) && + (((*result).suit_nfy_msg_choice = + suit_nfy_msg_suit_chunk_status_evt_nfy_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_suit_rsp(zcbor_state_t *state, struct suit_rsp *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_suit_trigger_update_rsp( + state, + (&(*result).suit_rsp_msg_suit_trigger_update_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_trigger_update_rsp_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_check_installed_component_digest_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_check_installed_component_digest_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_installed_manifest_info_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_get_installed_manifest_info_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_install_candidate_info_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_get_install_candidate_info_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authenticate_manifest_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_authenticate_manifest_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_authenticate_manifest_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_unsigned_manifest_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_seq_num_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_authorize_seq_num_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_authorize_seq_num_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_check_component_compatibility_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_check_component_compatibility_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_check_component_compatibility_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_supported_manifest_roles_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_supported_manifest_info_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_get_supported_manifest_info_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_process_dependency_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_authorize_process_dependency_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_evt_sub_rsp( + state, (&(*result).suit_rsp_msg_suit_evt_sub_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_evt_sub_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_enqueue_rsp( + state, + (&(*result).suit_rsp_msg_suit_chunk_enqueue_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_chunk_enqueue_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_status_rsp( + state, + (&(*result).suit_rsp_msg_suit_chunk_status_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_chunk_status_rsp_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_suit_req(zcbor_state_t *state, struct suit_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_suit_trigger_update_req( + state, + (&(*result).suit_req_msg_suit_trigger_update_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_trigger_update_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_check_installed_component_digest_req( + state, + (&(*result) + .suit_req_msg_suit_check_installed_component_digest_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_check_installed_component_digest_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_installed_manifest_info_req( + state, + (&(*result) + .suit_req_msg_suit_get_installed_manifest_info_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_get_installed_manifest_info_req_m_c), + true))) || + (((zcbor_uint32_expect_union(state, (4)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_get_install_candidate_info_req_m_c), + true)) || + (((decode_suit_authenticate_manifest_req( + state, + (&(*result) + .suit_req_msg_suit_authenticate_manifest_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_authenticate_manifest_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_unsigned_manifest_req( + state, + (&(*result) + .suit_req_msg_suit_authorize_unsigned_manifest_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_authorize_unsigned_manifest_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_seq_num_req( + state, + (&(*result) + .suit_req_msg_suit_authorize_seq_num_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_authorize_seq_num_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_check_component_compatibility_req( + state, + (&(*result) + .suit_req_msg_suit_check_component_compatibility_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_check_component_compatibility_req_m_c), + true))) || + (((zcbor_uint32_expect_union(state, (18)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_get_supported_manifest_roles_req_m_c), + true)) || + (((decode_suit_get_supported_manifest_info_req( + state, + (&(*result) + .suit_req_msg_suit_get_supported_manifest_info_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_get_supported_manifest_info_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_process_dependency_req( + state, + (&(*result) + .suit_req_msg_suit_authorize_process_dependency_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_authorize_process_dependency_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_evt_sub_req( + state, (&(*result).suit_req_msg_suit_evt_sub_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_evt_sub_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_enqueue_req( + state, + (&(*result).suit_req_msg_suit_chunk_enqueue_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_chunk_enqueue_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_status_req( + state, + (&(*result).suit_req_msg_suit_chunk_status_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_chunk_status_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_suit_req(const uint8_t *payload, size_t payload_len, + struct suit_req *result, size_t *payload_len_out) { + zcbor_state_t states[5]; + + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_suit_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_suit_rsp(const uint8_t *payload, size_t payload_len, + struct suit_rsp *result, size_t *payload_len_out) { + zcbor_state_t states[5]; + + return zcbor_entry_function(payload, payload_len, (void *)result, + payload_len_out, states, + (zcbor_decoder_t *)decode_suit_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_suit_nfy(const uint8_t *payload, size_t payload_len, + struct suit_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_suit_nfy, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.h b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.h index b997a4b31857..027e454b4e24 100644 --- a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.h +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_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 SUIT_SERVICE_DECODE_H__ #define SUIT_SERVICE_DECODE_H__ -#include +#include "suit_service_types.h" #include #include +#include #include -#include "suit_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_suit_req(const uint8_t *payload, size_t payload_len, struct suit_req *result, - size_t *payload_len_out); +int cbor_decode_suit_req(const uint8_t *payload, size_t payload_len, + struct suit_req *result, size_t *payload_len_out); -int cbor_decode_suit_rsp(const uint8_t *payload, size_t payload_len, struct suit_rsp *result, - size_t *payload_len_out); +int cbor_decode_suit_rsp(const uint8_t *payload, size_t payload_len, + struct suit_rsp *result, size_t *payload_len_out); -int cbor_decode_suit_nfy(const uint8_t *payload, size_t payload_len, struct suit_nfy *result, - size_t *payload_len_out); +int cbor_decode_suit_nfy(const uint8_t *payload, size_t payload_len, + struct suit_nfy *result, size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.c b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.c index 9aba74cb7adc..d1e8a2ce6dd3 100644 --- a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.c +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.c @@ -5,1011 +5,942 @@ */ /* - * 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 "suit_service_encode.h" +#include "zcbor_encode.h" +#include "zcbor_print.h" #include #include +#include #include -#include "zcbor_encode.h" -#include "suit_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_suit_missing_image_evt_nfy(zcbor_state_t *state, - const struct suit_missing_image_evt_nfy *input); -static bool encode_suit_chunk_status_evt_nfy(zcbor_state_t *state, - const struct suit_chunk_status_evt_nfy *input); -static bool encode_suit_cache_info_entry(zcbor_state_t *state, - const struct suit_cache_info_entry *input); -static bool encode_suit_trigger_update_req(zcbor_state_t *state, - const struct suit_trigger_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_suit_missing_image_evt_nfy( + zcbor_state_t *state, const struct suit_missing_image_evt_nfy *input); +static bool +encode_suit_chunk_status_evt_nfy(zcbor_state_t *state, + const struct suit_chunk_status_evt_nfy *input); +static bool +encode_suit_cache_info_entry(zcbor_state_t *state, + const struct suit_cache_info_entry *input); +static bool +encode_suit_trigger_update_req(zcbor_state_t *state, + const struct suit_trigger_update_req *input); static bool encode_suit_check_installed_component_digest_req( - zcbor_state_t *state, const struct suit_check_installed_component_digest_req *input); + zcbor_state_t *state, + const struct suit_check_installed_component_digest_req *input); static bool encode_suit_get_installed_manifest_info_req( - zcbor_state_t *state, const struct suit_get_installed_manifest_info_req *input); -static bool -encode_suit_authenticate_manifest_req(zcbor_state_t *state, - const struct suit_authenticate_manifest_req *input); + zcbor_state_t *state, + const struct suit_get_installed_manifest_info_req *input); +static bool encode_suit_authenticate_manifest_req( + zcbor_state_t *state, const struct suit_authenticate_manifest_req *input); static bool encode_suit_authorize_unsigned_manifest_req( - zcbor_state_t *state, const struct suit_authorize_unsigned_manifest_req *input); -static bool encode_suit_authorize_seq_num_req(zcbor_state_t *state, - const struct suit_authorize_seq_num_req *input); + zcbor_state_t *state, + const struct suit_authorize_unsigned_manifest_req *input); +static bool encode_suit_authorize_seq_num_req( + zcbor_state_t *state, const struct suit_authorize_seq_num_req *input); static bool encode_suit_check_component_compatibility_req( - zcbor_state_t *state, const struct suit_check_component_compatibility_req *input); + zcbor_state_t *state, + const struct suit_check_component_compatibility_req *input); static bool encode_suit_get_supported_manifest_info_req( - zcbor_state_t *state, const struct suit_get_supported_manifest_info_req *input); + zcbor_state_t *state, + const struct suit_get_supported_manifest_info_req *input); static bool encode_suit_authorize_process_dependency_req( - zcbor_state_t *state, const struct suit_authorize_process_dependency_req *input); -static bool encode_suit_evt_sub_req(zcbor_state_t *state, const struct suit_evt_sub_req *input); -static bool encode_suit_chunk_enqueue_req(zcbor_state_t *state, - const struct suit_chunk_enqueue_req *input); -static bool encode_suit_chunk_status_req(zcbor_state_t *state, - const struct suit_chunk_status_req *input); -static bool encode_suit_trigger_update_rsp(zcbor_state_t *state, - const struct suit_trigger_update_rsp *input); -static bool encode_suit_check_installed_component_digest_rsp( - zcbor_state_t *state, const struct suit_check_installed_component_digest_rsp *input); -static bool encode_suit_get_installed_manifest_info_rsp( - zcbor_state_t *state, const struct suit_get_installed_manifest_info_rsp *input); + zcbor_state_t *state, + const struct suit_authorize_process_dependency_req *input); +static bool encode_suit_evt_sub_req(zcbor_state_t *state, + const struct suit_evt_sub_req *input); +static bool +encode_suit_chunk_enqueue_req(zcbor_state_t *state, + const struct suit_chunk_enqueue_req *input); static bool -encode_suit_get_install_candidate_info_rsp(zcbor_state_t *state, - const struct suit_get_install_candidate_info_rsp *input); +encode_suit_chunk_status_req(zcbor_state_t *state, + const struct suit_chunk_status_req *input); static bool -encode_suit_authenticate_manifest_rsp(zcbor_state_t *state, - const struct suit_authenticate_manifest_rsp *input); +encode_suit_trigger_update_rsp(zcbor_state_t *state, + const struct suit_trigger_update_rsp *input); +static bool encode_suit_check_installed_component_digest_rsp( + zcbor_state_t *state, + const struct suit_check_installed_component_digest_rsp *input); +static bool encode_suit_get_installed_manifest_info_rsp( + zcbor_state_t *state, + const struct suit_get_installed_manifest_info_rsp *input); +static bool encode_suit_get_install_candidate_info_rsp( + zcbor_state_t *state, + const struct suit_get_install_candidate_info_rsp *input); +static bool encode_suit_authenticate_manifest_rsp( + zcbor_state_t *state, const struct suit_authenticate_manifest_rsp *input); static bool encode_suit_authorize_unsigned_manifest_rsp( - zcbor_state_t *state, const struct suit_authorize_unsigned_manifest_rsp *input); -static bool encode_suit_authorize_seq_num_rsp(zcbor_state_t *state, - const struct suit_authorize_seq_num_rsp *input); + zcbor_state_t *state, + const struct suit_authorize_unsigned_manifest_rsp *input); +static bool encode_suit_authorize_seq_num_rsp( + zcbor_state_t *state, const struct suit_authorize_seq_num_rsp *input); static bool encode_suit_check_component_compatibility_rsp( - zcbor_state_t *state, const struct suit_check_component_compatibility_rsp *input); + zcbor_state_t *state, + const struct suit_check_component_compatibility_rsp *input); static bool encode_suit_get_supported_manifest_roles_rsp( - zcbor_state_t *state, const struct suit_get_supported_manifest_roles_rsp *input); + zcbor_state_t *state, + const struct suit_get_supported_manifest_roles_rsp *input); static bool encode_suit_get_supported_manifest_info_rsp( - zcbor_state_t *state, const struct suit_get_supported_manifest_info_rsp *input); + zcbor_state_t *state, + const struct suit_get_supported_manifest_info_rsp *input); static bool encode_suit_authorize_process_dependency_rsp( - zcbor_state_t *state, const struct suit_authorize_process_dependency_rsp *input); -static bool encode_suit_evt_sub_rsp(zcbor_state_t *state, const struct suit_evt_sub_rsp *input); -static bool encode_suit_chunk_enqueue_rsp(zcbor_state_t *state, - const struct suit_chunk_enqueue_rsp *input); -static bool encode_suit_chunk_info_entry(zcbor_state_t *state, - const struct suit_chunk_info_entry *input); -static bool encode_suit_chunk_status_rsp(zcbor_state_t *state, - const struct suit_chunk_status_rsp *input); + zcbor_state_t *state, + const struct suit_authorize_process_dependency_rsp *input); +static bool encode_suit_evt_sub_rsp(zcbor_state_t *state, + const struct suit_evt_sub_rsp *input); +static bool +encode_suit_chunk_enqueue_rsp(zcbor_state_t *state, + const struct suit_chunk_enqueue_rsp *input); +static bool +encode_suit_chunk_info_entry(zcbor_state_t *state, + const struct suit_chunk_info_entry *input); +static bool +encode_suit_chunk_status_rsp(zcbor_state_t *state, + const struct suit_chunk_status_rsp *input); static bool encode_suit_nfy(zcbor_state_t *state, const struct suit_nfy *input); static bool encode_suit_rsp(zcbor_state_t *state, const struct suit_rsp *input); static bool encode_suit_req(zcbor_state_t *state, const struct suit_req *input); -static bool encode_suit_missing_image_evt_nfy(zcbor_state_t *state, - const struct suit_missing_image_evt_nfy *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (41)))) && - ((zcbor_bstr_encode(state, (&(*input).suit_missing_image_evt_nfy_resource_id)))) && - ((zcbor_uint32_encode( - state, (&(*input).suit_missing_image_evt_nfy_stream_session_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 encode_suit_chunk_status_evt_nfy(zcbor_state_t *state, - const struct suit_chunk_status_evt_nfy *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (42)))) && - ((zcbor_uint32_encode( - state, (&(*input).suit_chunk_status_evt_nfy_stream_session_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 encode_suit_cache_info_entry(zcbor_state_t *state, - const struct suit_cache_info_entry *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_encode(state, (&(*input).suit_cache_info_entry_addr)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_cache_info_entry_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_suit_trigger_update_req(zcbor_state_t *state, - const struct suit_trigger_update_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (1)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_trigger_update_req_addr)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_trigger_update_req_size)))) && - ((zcbor_list_start_encode(state, 12) && - ((zcbor_multi_encode_minmax( - 0, 6, - &(*input).suit_trigger_update_req_caches_suit_cache_info_entry_m_count, - (zcbor_encoder_t *)encode_suit_cache_info_entry, state, - (&(*input).suit_trigger_update_req_caches_suit_cache_info_entry_m), - sizeof(struct suit_cache_info_entry))) || - (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; -} +static bool encode_suit_missing_image_evt_nfy( + zcbor_state_t *state, const struct suit_missing_image_evt_nfy *input) { + zcbor_log("%s\r\n", __func__); -static bool encode_suit_check_installed_component_digest_req( - zcbor_state_t *state, const struct suit_check_installed_component_digest_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (2)))) && - ((zcbor_bstr_encode( - state, - (&(*input).suit_check_installed_component_digest_req_component_id)))) && - ((zcbor_int32_encode( - state, (&(*input).suit_check_installed_component_digest_req_alg_id)))) && - ((zcbor_bstr_encode( - state, (&(*input).suit_check_installed_component_digest_req_digest))))))); - - 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, (41)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_missing_image_evt_nfy_resource_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_missing_image_evt_nfy_stream_session_id))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_suit_get_installed_manifest_info_req( - zcbor_state_t *state, const struct suit_get_installed_manifest_info_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_suit_chunk_status_evt_nfy( + zcbor_state_t *state, const struct suit_chunk_status_evt_nfy *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (3)))) && - ((zcbor_bstr_encode( - state, - (&(*input).suit_get_installed_manifest_info_req_manifest_class_id))))))); + bool res = (( + (((zcbor_uint32_put(state, (42)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_chunk_status_evt_nfy_stream_session_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__); - } + log_result(state, res, __func__); + return res; +} + +static bool +encode_suit_cache_info_entry(zcbor_state_t *state, + const struct suit_cache_info_entry *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = ((( + ((zcbor_uint32_encode(state, (&(*input).suit_cache_info_entry_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_cache_info_entry_size))))))); + + log_result(state, res, __func__); + return res; } static bool -encode_suit_authenticate_manifest_req(zcbor_state_t *state, - const struct suit_authenticate_manifest_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (10)))) && - ((zcbor_bstr_encode( - state, (&(*input).suit_authenticate_manifest_req_manifest_component_id)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_authenticate_manifest_req_alg_id)))) && - ((zcbor_bstr_encode(state, (&(*input).suit_authenticate_manifest_req_key_id)))) && - ((zcbor_bstr_encode(state, (&(*input).suit_authenticate_manifest_req_signature)))) && - ((zcbor_uint32_encode(state, - (&(*input).suit_authenticate_manifest_req_data_addr)))) && - ((zcbor_uint32_encode(state, - (&(*input).suit_authenticate_manifest_req_data_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; +encode_suit_trigger_update_req(zcbor_state_t *state, + const struct suit_trigger_update_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (1)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_trigger_update_req_addr)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_trigger_update_req_size)))) && + ((zcbor_list_start_encode(state, 12) && + ((zcbor_multi_encode_minmax( + 0, 6, + &(*input) + .suit_trigger_update_req_caches_suit_cache_info_entry_m_count, + (zcbor_encoder_t *)encode_suit_cache_info_entry, state, + (*&(*input) + .suit_trigger_update_req_caches_suit_cache_info_entry_m), + sizeof(struct suit_cache_info_entry))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 12)))))); + + log_result(state, res, __func__); + return res; } -static bool encode_suit_authorize_unsigned_manifest_req( - zcbor_state_t *state, const struct suit_authorize_unsigned_manifest_req *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_suit_check_installed_component_digest_req( + zcbor_state_t *state, + const struct suit_check_installed_component_digest_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (2)))) && + ((zcbor_bstr_encode( + state, + (&(*input) + .suit_check_installed_component_digest_req_component_id)))) && + ((zcbor_int32_encode( + state, + (&(*input).suit_check_installed_component_digest_req_alg_id)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_check_installed_component_digest_req_digest))))))); + + log_result(state, res, __func__); + return res; +} - bool tmp_result = ((( - ((zcbor_uint32_put(state, (11)))) && - ((zcbor_bstr_encode( - state, - (&(*input).suit_authorize_unsigned_manifest_req_manifest_component_id))))))); +static bool encode_suit_get_installed_manifest_info_req( + zcbor_state_t *state, + const struct suit_get_installed_manifest_info_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (3)))) && + ((zcbor_bstr_encode( + state, + (&(*input) + .suit_get_installed_manifest_info_req_manifest_class_id))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_suit_authenticate_manifest_req( + zcbor_state_t *state, const struct suit_authenticate_manifest_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (10)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_authenticate_manifest_req_manifest_component_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_authenticate_manifest_req_alg_id)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_authenticate_manifest_req_key_id)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_authenticate_manifest_req_signature)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_authenticate_manifest_req_data_addr)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_authenticate_manifest_req_data_size))))))); + + 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_suit_authorize_unsigned_manifest_req( + zcbor_state_t *state, + const struct suit_authorize_unsigned_manifest_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; -} + bool res = ((( + ((zcbor_uint32_put(state, (11)))) && + ((zcbor_bstr_encode( + state, + (&(*input) + .suit_authorize_unsigned_manifest_req_manifest_component_id))))))); -static bool encode_suit_authorize_seq_num_req(zcbor_state_t *state, - const struct suit_authorize_seq_num_req *input) -{ - zcbor_log("%s\r\n", __func__); + log_result(state, res, __func__); + return res; +} - bool tmp_result = ((( - ((zcbor_uint32_put(state, (12)))) && - ((zcbor_bstr_encode( - state, (&(*input).suit_authorize_seq_num_req_manifest_component_id)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_authorize_seq_num_req_command_seq)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_authorize_seq_num_req_seq_num))))))); +static bool encode_suit_authorize_seq_num_req( + zcbor_state_t *state, const struct suit_authorize_seq_num_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)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_authorize_seq_num_req_manifest_component_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_authorize_seq_num_req_command_seq)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_authorize_seq_num_req_seq_num))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } static bool encode_suit_check_component_compatibility_req( - zcbor_state_t *state, const struct suit_check_component_compatibility_req *input) -{ - zcbor_log("%s\r\n", __func__); + zcbor_state_t *state, + const struct suit_check_component_compatibility_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = ((( - ((zcbor_uint32_put(state, (13)))) && - ((zcbor_bstr_encode( - state, - (&(*input).suit_check_component_compatibility_req_manifest_class_id)))) && - ((zcbor_bstr_encode( - state, (&(*input).suit_check_component_compatibility_req_component_id))))))); + bool res = ((( + ((zcbor_uint32_put(state, (13)))) && + ((zcbor_bstr_encode( + state, + (&(*input) + .suit_check_component_compatibility_req_manifest_class_id)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_check_component_compatibility_req_component_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; + log_result(state, res, __func__); + return res; } static bool encode_suit_get_supported_manifest_info_req( - zcbor_state_t *state, const struct suit_get_supported_manifest_info_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (19)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_get_supported_manifest_info_req_role))))))); + zcbor_state_t *state, + const struct suit_get_supported_manifest_info_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_int32_encode( + state, (&(*input).suit_get_supported_manifest_info_req_role))))))); - return tmp_result; + log_result(state, res, __func__); + return res; } static bool encode_suit_authorize_process_dependency_req( - zcbor_state_t *state, const struct suit_authorize_process_dependency_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (21)))) && - ((zcbor_bstr_encode( - state, - (&(*input).suit_authorize_process_dependency_req_dependee_class_id)))) && - ((zcbor_bstr_encode( - state, - (&(*input).suit_authorize_process_dependency_req_dependent_class_id)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_authorize_process_dependency_req_seq_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 encode_suit_evt_sub_req(zcbor_state_t *state, const struct suit_evt_sub_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (40)))) && - ((zcbor_bool_encode(state, (&(*input).suit_evt_sub_req_subscribe))))))); - - 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_suit_chunk_enqueue_req(zcbor_state_t *state, - const struct suit_chunk_enqueue_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (43)))) && - ((zcbor_uint32_encode(state, - (&(*input).suit_chunk_enqueue_req_stream_session_id)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_chunk_id)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_offset)))) && - ((zcbor_bool_encode(state, (&(*input).suit_chunk_enqueue_req_last_chunk)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_addr)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_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_suit_chunk_status_req(zcbor_state_t *state, - const struct suit_chunk_status_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (44)))) && - ((zcbor_uint32_encode(state, - (&(*input).suit_chunk_status_req_stream_session_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 encode_suit_trigger_update_rsp(zcbor_state_t *state, - const struct suit_trigger_update_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (1)))) && - ((zcbor_int32_encode(state, (&(*input).suit_trigger_update_rsp_ret))))))); - - 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 suit_authorize_process_dependency_req *input) { + zcbor_log("%s\r\n", __func__); -static bool encode_suit_check_installed_component_digest_rsp( - zcbor_state_t *state, const struct suit_check_installed_component_digest_rsp *input) -{ - zcbor_log("%s\r\n", __func__); + bool res = ((( + ((zcbor_uint32_put(state, (21)))) && + ((zcbor_bstr_encode( + state, + (&(*input) + .suit_authorize_process_dependency_req_dependee_class_id)))) && + ((zcbor_bstr_encode( + state, + (&(*input) + .suit_authorize_process_dependency_req_dependent_class_id)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_authorize_process_dependency_req_seq_id))))))); - bool tmp_result = - (((((zcbor_uint32_put(state, (2)))) && - ((zcbor_int32_encode( - state, (&(*input).suit_check_installed_component_digest_rsp_ret))))))); + 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_suit_evt_sub_req(zcbor_state_t *state, + const struct suit_evt_sub_req *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; -} + bool res = (( + (((zcbor_uint32_put(state, (40)))) && + ((zcbor_bool_encode(state, (&(*input).suit_evt_sub_req_subscribe))))))); -static bool encode_suit_get_installed_manifest_info_rsp( - zcbor_state_t *state, const struct suit_get_installed_manifest_info_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (3)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_get_installed_manifest_info_rsp_ret)))) && - ((zcbor_uint32_encode(state, - (&(*input).suit_get_installed_manifest_info_rsp_seq_num)))) && - ((zcbor_list_start_encode(state, 5) && - ((zcbor_multi_encode_minmax( - 0, 5, &(*input).suit_get_installed_manifest_info_rsp_semver_int_count, - (zcbor_encoder_t *)zcbor_int32_encode, state, - (&(*input).suit_get_installed_manifest_info_rsp_semver_int), - sizeof(int32_t))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 5))) && - ((zcbor_int32_encode( - state, (&(*input).suit_get_installed_manifest_info_rsp_digest_status)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_get_installed_manifest_info_rsp_alg_id)))) && - ((zcbor_bstr_encode(state, - (&(*input).suit_get_installed_manifest_info_rsp_digest))))))); - - 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_suit_get_install_candidate_info_rsp(zcbor_state_t *state, - const struct suit_get_install_candidate_info_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (4)))) && - ((zcbor_int32_encode(state, (&(*input).suit_get_install_candidate_info_rsp_ret)))) && - ((zcbor_bstr_encode( - state, - (&(*input).suit_get_install_candidate_info_rsp_manifest_class_id)))) && - ((zcbor_uint32_encode(state, - (&(*input).suit_get_install_candidate_info_rsp_seq_num)))) && - ((zcbor_list_start_encode(state, 5) && - ((zcbor_multi_encode_minmax( - 0, 5, &(*input).suit_get_install_candidate_info_rsp_semver_int_count, - (zcbor_encoder_t *)zcbor_int32_encode, state, - (&(*input).suit_get_install_candidate_info_rsp_semver_int), - sizeof(int32_t))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 5))) && - ((zcbor_int32_encode(state, - (&(*input).suit_get_install_candidate_info_rsp_alg_id)))) && - ((zcbor_bstr_encode(state, - (&(*input).suit_get_install_candidate_info_rsp_digest))))))); - - 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_suit_chunk_enqueue_req(zcbor_state_t *state, + const struct suit_chunk_enqueue_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (43)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_chunk_enqueue_req_stream_session_id)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_chunk_enqueue_req_chunk_id)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_chunk_enqueue_req_offset)))) && + ((zcbor_bool_encode(state, + (&(*input).suit_chunk_enqueue_req_last_chunk)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_addr)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_chunk_enqueue_req_size))))))); + + log_result(state, res, __func__); + return res; } static bool -encode_suit_authenticate_manifest_rsp(zcbor_state_t *state, - const struct suit_authenticate_manifest_rsp *input) -{ - zcbor_log("%s\r\n", __func__); +encode_suit_chunk_status_req(zcbor_state_t *state, + const struct suit_chunk_status_req *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (10)))) && - ((zcbor_int32_encode(state, (&(*input).suit_authenticate_manifest_rsp_ret))))))); + bool res = + (((((zcbor_uint32_put(state, (44)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_chunk_status_req_stream_session_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__); - } + log_result(state, res, __func__); + return res; +} + +static bool +encode_suit_trigger_update_rsp(zcbor_state_t *state, + const struct suit_trigger_update_rsp *input) { + zcbor_log("%s\r\n", __func__); - return tmp_result; + bool res = ((( + ((zcbor_uint32_put(state, (1)))) && + ((zcbor_int32_encode(state, (&(*input).suit_trigger_update_rsp_ret))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_suit_authorize_unsigned_manifest_rsp( - zcbor_state_t *state, const struct suit_authorize_unsigned_manifest_rsp *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_suit_check_installed_component_digest_rsp( + zcbor_state_t *state, + const struct suit_check_installed_component_digest_rsp *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (11)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_authorize_unsigned_manifest_rsp_ret))))))); + bool res = + (((((zcbor_uint32_put(state, (2)))) && + ((zcbor_int32_encode( + state, + (&(*input).suit_check_installed_component_digest_rsp_ret))))))); - 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_suit_get_installed_manifest_info_rsp( + zcbor_state_t *state, + const struct suit_get_installed_manifest_info_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (3)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_get_installed_manifest_info_rsp_ret)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_get_installed_manifest_info_rsp_seq_num)))) && + ((zcbor_list_start_encode(state, 5) && + ((zcbor_multi_encode_minmax( + 0, 5, + &(*input).suit_get_installed_manifest_info_rsp_semver_int_count, + (zcbor_encoder_t *)zcbor_int32_encode, state, + (*&(*input).suit_get_installed_manifest_info_rsp_semver_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 5))) && + ((zcbor_int32_encode( + state, + (&(*input).suit_get_installed_manifest_info_rsp_digest_status)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_get_installed_manifest_info_rsp_alg_id)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_get_installed_manifest_info_rsp_digest))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_suit_get_install_candidate_info_rsp( + zcbor_state_t *state, + const struct suit_get_install_candidate_info_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (4)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_get_install_candidate_info_rsp_ret)))) && + ((zcbor_bstr_encode( + state, + (&(*input) + .suit_get_install_candidate_info_rsp_manifest_class_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_get_install_candidate_info_rsp_seq_num)))) && + ((zcbor_list_start_encode(state, 5) && + ((zcbor_multi_encode_minmax( + 0, 5, + &(*input).suit_get_install_candidate_info_rsp_semver_int_count, + (zcbor_encoder_t *)zcbor_int32_encode, state, + (*&(*input).suit_get_install_candidate_info_rsp_semver_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 5))) && + ((zcbor_int32_encode( + state, (&(*input).suit_get_install_candidate_info_rsp_alg_id)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_get_install_candidate_info_rsp_digest))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_suit_authenticate_manifest_rsp( + zcbor_state_t *state, const struct suit_authenticate_manifest_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_put(state, (10)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_authenticate_manifest_rsp_ret))))))); + + log_result(state, res, __func__); + return res; } -static bool encode_suit_authorize_seq_num_rsp(zcbor_state_t *state, - const struct suit_authorize_seq_num_rsp *input) -{ - zcbor_log("%s\r\n", __func__); +static bool encode_suit_authorize_unsigned_manifest_rsp( + zcbor_state_t *state, + const struct suit_authorize_unsigned_manifest_rsp *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (12)))) && - ((zcbor_int32_encode(state, (&(*input).suit_authorize_seq_num_rsp_ret))))))); + bool res = + (((((zcbor_uint32_put(state, (11)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_authorize_unsigned_manifest_rsp_ret))))))); - 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_suit_authorize_seq_num_rsp( + zcbor_state_t *state, const struct suit_authorize_seq_num_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_put(state, (12)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_authorize_seq_num_rsp_ret))))))); + + log_result(state, res, __func__); + return res; } static bool encode_suit_check_component_compatibility_rsp( - zcbor_state_t *state, const struct suit_check_component_compatibility_rsp *input) -{ - zcbor_log("%s\r\n", __func__); + zcbor_state_t *state, + const struct suit_check_component_compatibility_rsp *input) { + zcbor_log("%s\r\n", __func__); - bool tmp_result = - (((((zcbor_uint32_put(state, (13)))) && - ((zcbor_int32_encode( - state, (&(*input).suit_check_component_compatibility_rsp_ret))))))); + bool res = (( + (((zcbor_uint32_put(state, (13)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_check_component_compatibility_rsp_ret))))))); - 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_suit_get_supported_manifest_roles_rsp( - zcbor_state_t *state, const struct suit_get_supported_manifest_roles_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (((zcbor_uint32_put(state, (18)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_get_supported_manifest_roles_rsp_ret)))) && - ((zcbor_list_start_encode(state, 20) && - ((zcbor_multi_encode_minmax( - 0, 20, &(*input).suit_get_supported_manifest_roles_rsp_roles_int_count, - (zcbor_encoder_t *)zcbor_int32_encode, state, - (&(*input).suit_get_supported_manifest_roles_rsp_roles_int), - sizeof(int32_t))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 20)))))); - - 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 suit_get_supported_manifest_roles_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (18)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_get_supported_manifest_roles_rsp_ret)))) && + ((zcbor_list_start_encode(state, 20) && + ((zcbor_multi_encode_minmax( + 0, 20, + &(*input).suit_get_supported_manifest_roles_rsp_roles_int_count, + (zcbor_encoder_t *)zcbor_int32_encode, state, + (*&(*input).suit_get_supported_manifest_roles_rsp_roles_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 20)))))); + + log_result(state, res, __func__); + return res; } static bool encode_suit_get_supported_manifest_info_rsp( - zcbor_state_t *state, const struct suit_get_supported_manifest_info_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (19)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_get_supported_manifest_info_rsp_ret)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_get_supported_manifest_info_rsp_role)))) && - ((zcbor_bstr_encode(state, - (&(*input).suit_get_supported_manifest_info_rsp_vendor_id)))) && - ((zcbor_bstr_encode(state, - (&(*input).suit_get_supported_manifest_info_rsp_class_id)))) && - ((zcbor_int32_encode( - state, - (&(*input).suit_get_supported_manifest_info_rsp_downgrade_prevention_policy)))) && - ((zcbor_int32_encode( - state, - (&(*input).suit_get_supported_manifest_info_rsp_independent_updateability_policy)))) && - ((zcbor_int32_encode( - state, - (&(*input).suit_get_supported_manifest_info_rsp_signature_verification_policy))))))); - - 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 suit_get_supported_manifest_info_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (19)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_get_supported_manifest_info_rsp_ret)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_get_supported_manifest_info_rsp_role)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_get_supported_manifest_info_rsp_vendor_id)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_get_supported_manifest_info_rsp_class_id)))) && + ((zcbor_int32_encode( + state, + (&(*input) + .suit_get_supported_manifest_info_rsp_downgrade_prevention_policy)))) && + ((zcbor_int32_encode( + state, + (&(*input) + .suit_get_supported_manifest_info_rsp_independent_updateability_policy)))) && + ((zcbor_int32_encode( + state, + (&(*input) + .suit_get_supported_manifest_info_rsp_signature_verification_policy))))))); + + log_result(state, res, __func__); + return res; } static bool encode_suit_authorize_process_dependency_rsp( - zcbor_state_t *state, const struct suit_authorize_process_dependency_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (21)))) && - ((zcbor_int32_encode(state, - (&(*input).suit_authorize_process_dependency_rsp_ret))))))); - - 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_suit_evt_sub_rsp(zcbor_state_t *state, const struct suit_evt_sub_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((((zcbor_uint32_put(state, (40)))) && - ((zcbor_int32_encode(state, (&(*input).suit_evt_sub_rsp_ret))))))); - - 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_suit_chunk_enqueue_rsp(zcbor_state_t *state, - const struct suit_chunk_enqueue_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_put(state, (43)))) && - ((zcbor_int32_encode(state, (&(*input).suit_chunk_enqueue_rsp_ret))))))); - - 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_suit_chunk_info_entry(zcbor_state_t *state, - const struct suit_chunk_info_entry *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((((zcbor_uint32_encode(state, (&(*input).suit_chunk_info_entry_chunk_id)))) && - ((zcbor_uint32_encode(state, (&(*input).suit_chunk_info_entry_status))))))); - - 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_suit_chunk_status_rsp(zcbor_state_t *state, - const struct suit_chunk_status_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - ((zcbor_uint32_put(state, (44)))) && - ((zcbor_int32_encode(state, (&(*input).suit_chunk_status_rsp_ret)))) && - ((zcbor_list_start_encode(state, 6) && - ((zcbor_multi_encode_minmax( - 0, 3, - &(*input).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count, - (zcbor_encoder_t *)encode_suit_chunk_info_entry, state, - (&(*input).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m), - sizeof(struct suit_chunk_info_entry))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 6)))))); - - 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_suit_nfy(zcbor_state_t *state, const struct suit_nfy *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_encode(state, 3) && - ((((((*input).suit_nfy_msg_choice == suit_nfy_msg_suit_missing_image_evt_nfy_m_c) ? - ((encode_suit_missing_image_evt_nfy( - state, (&(*input).suit_nfy_msg_suit_missing_image_evt_nfy_m)))) : - (((*input).suit_nfy_msg_choice == - suit_nfy_msg_suit_chunk_status_evt_nfy_m_c) ? - ((encode_suit_chunk_status_evt_nfy( - state, - (&(*input).suit_nfy_msg_suit_chunk_status_evt_nfy_m)))) : - false)))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 3)))); - - 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_suit_rsp(zcbor_state_t *state, const struct suit_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_encode(state, 8) && - ((((((*input).suit_rsp_msg_choice == suit_rsp_msg_suit_trigger_update_rsp_m_c) ? - ((encode_suit_trigger_update_rsp( - state, (&(*input).suit_rsp_msg_suit_trigger_update_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c) ? - ((encode_suit_check_installed_component_digest_rsp( - state, - (&(*input).suit_rsp_msg_suit_check_installed_component_digest_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c) ? - ((encode_suit_get_installed_manifest_info_rsp( - state, - (&(*input).suit_rsp_msg_suit_get_installed_manifest_info_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c) ? - ((encode_suit_get_install_candidate_info_rsp( - state, - (&(*input).suit_rsp_msg_suit_get_install_candidate_info_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_authenticate_manifest_rsp_m_c) ? - ((encode_suit_authenticate_manifest_rsp( - state, - (&(*input).suit_rsp_msg_suit_authenticate_manifest_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c) ? - ((encode_suit_authorize_unsigned_manifest_rsp( - state, - (&(*input).suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_authorize_seq_num_rsp_m_c) ? - ((encode_suit_authorize_seq_num_rsp( - state, - (&(*input).suit_rsp_msg_suit_authorize_seq_num_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_check_component_compatibility_rsp_m_c) ? - ((encode_suit_check_component_compatibility_rsp( - state, - (&(*input).suit_rsp_msg_suit_check_component_compatibility_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c) ? - ((encode_suit_get_supported_manifest_roles_rsp( - state, - (&(*input).suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c) ? - ((encode_suit_get_supported_manifest_info_rsp( - state, - (&(*input).suit_rsp_msg_suit_get_supported_manifest_info_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c) ? - ((encode_suit_authorize_process_dependency_rsp( - state, - (&(*input).suit_rsp_msg_suit_authorize_process_dependency_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_evt_sub_rsp_m_c) ? - ((encode_suit_evt_sub_rsp( - state, - (&(*input).suit_rsp_msg_suit_evt_sub_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_chunk_enqueue_rsp_m_c) ? - ((encode_suit_chunk_enqueue_rsp( - state, - (&(*input).suit_rsp_msg_suit_chunk_enqueue_rsp_m)))) : - (((*input).suit_rsp_msg_choice == - suit_rsp_msg_suit_chunk_status_rsp_m_c) ? - ((encode_suit_chunk_status_rsp( - state, - (&(*input).suit_rsp_msg_suit_chunk_status_rsp_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_suit_req(zcbor_state_t *state, const struct suit_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_encode(state, 7) && - ((((((*input).suit_req_msg_choice == suit_req_msg_suit_trigger_update_req_m_c) ? - ((encode_suit_trigger_update_req( - state, (&(*input).suit_req_msg_suit_trigger_update_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_check_installed_component_digest_req_m_c) ? - ((encode_suit_check_installed_component_digest_req( - state, - (&(*input).suit_req_msg_suit_check_installed_component_digest_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_get_installed_manifest_info_req_m_c) ? - ((encode_suit_get_installed_manifest_info_req( - state, - (&(*input).suit_req_msg_suit_get_installed_manifest_info_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_get_install_candidate_info_req_m_c) ? - ((zcbor_uint32_put(state, (4)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_authenticate_manifest_req_m_c) ? - ((encode_suit_authenticate_manifest_req( - state, - (&(*input).suit_req_msg_suit_authenticate_manifest_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_authorize_unsigned_manifest_req_m_c) ? - ((encode_suit_authorize_unsigned_manifest_req( - state, - (&(*input).suit_req_msg_suit_authorize_unsigned_manifest_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_authorize_seq_num_req_m_c) ? - ((encode_suit_authorize_seq_num_req( - state, - (&(*input).suit_req_msg_suit_authorize_seq_num_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_check_component_compatibility_req_m_c) ? - ((encode_suit_check_component_compatibility_req( - state, - (&(*input).suit_req_msg_suit_check_component_compatibility_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_get_supported_manifest_roles_req_m_c) ? - ((zcbor_uint32_put( - state, - (18)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_get_supported_manifest_info_req_m_c) ? - ((encode_suit_get_supported_manifest_info_req( - state, - (&(*input).suit_req_msg_suit_get_supported_manifest_info_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_authorize_process_dependency_req_m_c) ? - ((encode_suit_authorize_process_dependency_req( - state, - (&(*input).suit_req_msg_suit_authorize_process_dependency_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_evt_sub_req_m_c) ? - ((encode_suit_evt_sub_req( - state, - (&(*input).suit_req_msg_suit_evt_sub_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_chunk_enqueue_req_m_c) ? - ((encode_suit_chunk_enqueue_req( - state, - (&(*input).suit_req_msg_suit_chunk_enqueue_req_m)))) : - (((*input).suit_req_msg_choice == - suit_req_msg_suit_chunk_status_req_m_c) ? - ((encode_suit_chunk_status_req( - state, - (&(*input).suit_req_msg_suit_chunk_status_req_m)))) : - false)))))))))))))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 7)))); - - 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; -} - -int cbor_encode_suit_req(uint8_t *payload, size_t payload_len, const struct suit_req *input, - size_t *payload_len_out) -{ - zcbor_state_t states[5]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_suit_req, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_encode_suit_rsp(uint8_t *payload, size_t payload_len, const struct suit_rsp *input, - size_t *payload_len_out) -{ - zcbor_state_t states[5]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_suit_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_encode_suit_nfy(uint8_t *payload, size_t payload_len, const struct suit_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_suit_nfy, - sizeof(states) / sizeof(zcbor_state_t), 1); + zcbor_state_t *state, + const struct suit_authorize_process_dependency_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (21)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_authorize_process_dependency_rsp_ret))))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_suit_evt_sub_rsp(zcbor_state_t *state, + const struct suit_evt_sub_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = + (((((zcbor_uint32_put(state, (40)))) && + ((zcbor_int32_encode(state, (&(*input).suit_evt_sub_rsp_ret))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +encode_suit_chunk_enqueue_rsp(zcbor_state_t *state, + const struct suit_chunk_enqueue_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (((zcbor_uint32_put(state, (43)))) && + ((zcbor_int32_encode(state, (&(*input).suit_chunk_enqueue_rsp_ret))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +encode_suit_chunk_info_entry(zcbor_state_t *state, + const struct suit_chunk_info_entry *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (((((zcbor_uint32_encode( + state, (&(*input).suit_chunk_info_entry_chunk_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_chunk_info_entry_status))))))); + + log_result(state, res, __func__); + return res; +} + +static bool +encode_suit_chunk_status_rsp(zcbor_state_t *state, + const struct suit_chunk_status_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = ((( + ((zcbor_uint32_put(state, (44)))) && + ((zcbor_int32_encode(state, (&(*input).suit_chunk_status_rsp_ret)))) && + ((zcbor_list_start_encode(state, 6) && + ((zcbor_multi_encode_minmax( + 0, 3, + &(*input) + .suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count, + (zcbor_encoder_t *)encode_suit_chunk_info_entry, state, + (*&(*input) + .suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m), + sizeof(struct suit_chunk_info_entry))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 6)))))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_suit_nfy(zcbor_state_t *state, + const struct suit_nfy *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (zcbor_list_start_encode(state, 3) && + ((((((*input).suit_nfy_msg_choice == + suit_nfy_msg_suit_missing_image_evt_nfy_m_c) + ? ((encode_suit_missing_image_evt_nfy( + state, + (&(*input).suit_nfy_msg_suit_missing_image_evt_nfy_m)))) + : (((*input).suit_nfy_msg_choice == + suit_nfy_msg_suit_chunk_status_evt_nfy_m_c) + ? ((encode_suit_chunk_status_evt_nfy( + state, + (&(*input) + .suit_nfy_msg_suit_chunk_status_evt_nfy_m)))) + : false)))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 3)))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_suit_rsp(zcbor_state_t *state, + const struct suit_rsp *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (((zcbor_list_start_encode(state, 8) && + (((( + ((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_trigger_update_rsp_m_c) + ? ((encode_suit_trigger_update_rsp( + state, + (&(*input) + .suit_rsp_msg_suit_trigger_update_rsp_m)))) + : ( + ((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c) + ? ( + ( + encode_suit_check_installed_component_digest_rsp( + state, (&(*input).suit_rsp_msg_suit_check_installed_component_digest_rsp_m)))) + : ( + ((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c) + ? ( + ( + encode_suit_get_installed_manifest_info_rsp( + state, (&(*input).suit_rsp_msg_suit_get_installed_manifest_info_rsp_m)))) + : ( + ((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c) + ? ( + ( + encode_suit_get_install_candidate_info_rsp( + state, (&(*input) + .suit_rsp_msg_suit_get_install_candidate_info_rsp_m)))) + : ( + ((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_authenticate_manifest_rsp_m_c) + ? ( + (encode_suit_authenticate_manifest_rsp(state, ( + &(*input) + .suit_rsp_msg_suit_authenticate_manifest_rsp_m)))) + : (((*input).suit_rsp_msg_choice == suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c) ? ( + ( + encode_suit_authorize_unsigned_manifest_rsp(state, ( + &(*input) + .suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m)))) + : ( + ((*input) + .suit_rsp_msg_choice == + suit_rsp_msg_suit_authorize_seq_num_rsp_m_c) + ? (( + encode_suit_authorize_seq_num_rsp(state, ( + &(*input) + .suit_rsp_msg_suit_authorize_seq_num_rsp_m)))) + : ( + ( + (*input) + .suit_rsp_msg_choice == suit_rsp_msg_suit_check_component_compatibility_rsp_m_c) + ? ( + ( + encode_suit_check_component_compatibility_rsp(state, ( + &(*input) + .suit_rsp_msg_suit_check_component_compatibility_rsp_m)))) + : ( + ( + (*input) + .suit_rsp_msg_choice == suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c) + ? (( + encode_suit_get_supported_manifest_roles_rsp(state, ( + &(*input) + .suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m)))) + : ( + ( + (*input) + .suit_rsp_msg_choice == + suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c) + ? ( + ( + encode_suit_get_supported_manifest_info_rsp(state, (&(*input) + .suit_rsp_msg_suit_get_supported_manifest_info_rsp_m)))) + : ( + ( + (*input) + .suit_rsp_msg_choice == + suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c) + ? (( + encode_suit_authorize_process_dependency_rsp( + state, + (&(*input) + .suit_rsp_msg_suit_authorize_process_dependency_rsp_m)))) + : ( + ( + (*input) + .suit_rsp_msg_choice == + suit_rsp_msg_suit_evt_sub_rsp_m_c) + ? ((encode_suit_evt_sub_rsp( + state, + (&(*input) + .suit_rsp_msg_suit_evt_sub_rsp_m)))) + : ( + ( + (*input) + .suit_rsp_msg_choice == suit_rsp_msg_suit_chunk_enqueue_rsp_m_c) + ? ((encode_suit_chunk_enqueue_rsp( + state, + (&(*input) + .suit_rsp_msg_suit_chunk_enqueue_rsp_m)))) + : (( + (*input) + .suit_rsp_msg_choice == + suit_rsp_msg_suit_chunk_status_rsp_m_c) + ? ((encode_suit_chunk_status_rsp( + state, (&(*input) + .suit_rsp_msg_suit_chunk_status_rsp_m)))) + : false)))))))))))))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 8)))); + + log_result(state, res, __func__); + return res; +} + +static bool encode_suit_req(zcbor_state_t *state, + const struct suit_req *input) { + zcbor_log("%s\r\n", __func__); + + bool res = (( + (zcbor_list_start_encode(state, 7) && + ((((((*input).suit_req_msg_choice == + suit_req_msg_suit_trigger_update_req_m_c) + ? ((encode_suit_trigger_update_req( + state, + (&(*input).suit_req_msg_suit_trigger_update_req_m)))) + : (((*input).suit_req_msg_choice == + suit_req_msg_suit_check_installed_component_digest_req_m_c) + ? ((encode_suit_check_installed_component_digest_req( + state, + (&(*input) + .suit_req_msg_suit_check_installed_component_digest_req_m)))) + : (((*input).suit_req_msg_choice == + suit_req_msg_suit_get_installed_manifest_info_req_m_c) + ? ((encode_suit_get_installed_manifest_info_req( + state, + (&(*input) + .suit_req_msg_suit_get_installed_manifest_info_req_m)))) + : (((*input).suit_req_msg_choice == + suit_req_msg_suit_get_install_candidate_info_req_m_c) + ? ((zcbor_uint32_put(state, (4)))) + : (((*input).suit_req_msg_choice == + suit_req_msg_suit_authenticate_manifest_req_m_c) + ? ((encode_suit_authenticate_manifest_req( + state, + (&(*input) + .suit_req_msg_suit_authenticate_manifest_req_m)))) + : (((*input).suit_req_msg_choice == + suit_req_msg_suit_authorize_unsigned_manifest_req_m_c) + ? ((encode_suit_authorize_unsigned_manifest_req( + state, + (&(*input) + .suit_req_msg_suit_authorize_unsigned_manifest_req_m)))) + : (((*input) + .suit_req_msg_choice == + suit_req_msg_suit_authorize_seq_num_req_m_c) + ? ((encode_suit_authorize_seq_num_req( + state, + (&(*input) + .suit_req_msg_suit_authorize_seq_num_req_m)))) + : (((*input) + .suit_req_msg_choice == + suit_req_msg_suit_check_component_compatibility_req_m_c) + ? ((encode_suit_check_component_compatibility_req( + state, + (&(*input) + .suit_req_msg_suit_check_component_compatibility_req_m)))) + : (((*input).suit_req_msg_choice == suit_req_msg_suit_get_supported_manifest_roles_req_m_c) ? ((zcbor_uint32_put( + state, + (18)))) + : (((*input) + .suit_req_msg_choice == + suit_req_msg_suit_get_supported_manifest_info_req_m_c) + ? ( + (encode_suit_get_supported_manifest_info_req(state, + (&(*input) + .suit_req_msg_suit_get_supported_manifest_info_req_m)))) + : (((*input) + .suit_req_msg_choice == + suit_req_msg_suit_authorize_process_dependency_req_m_c) + ? ((encode_suit_authorize_process_dependency_req(state, (&(*input) + .suit_req_msg_suit_authorize_process_dependency_req_m)))) + : (((*input) + .suit_req_msg_choice == + suit_req_msg_suit_evt_sub_req_m_c) + ? ((encode_suit_evt_sub_req(state, ( + &(*input) + .suit_req_msg_suit_evt_sub_req_m)))) + : (((*input) + .suit_req_msg_choice == + suit_req_msg_suit_chunk_enqueue_req_m_c) + ? ( + (encode_suit_chunk_enqueue_req(state, ( + &(*input) + .suit_req_msg_suit_chunk_enqueue_req_m)))) + : ( + ( + (*input) + .suit_req_msg_choice == + suit_req_msg_suit_chunk_status_req_m_c) + ? (( + encode_suit_chunk_status_req( + state, ( + &(*input) + .suit_req_msg_suit_chunk_status_req_m)))) + : false)))))))))))))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 7)))); + + log_result(state, res, __func__); + return res; +} + +int cbor_encode_suit_req(uint8_t *payload, size_t payload_len, + const struct suit_req *input, + size_t *payload_len_out) { + zcbor_state_t states[5]; + + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_suit_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_suit_rsp(uint8_t *payload, size_t payload_len, + const struct suit_rsp *input, + size_t *payload_len_out) { + zcbor_state_t states[5]; + + return zcbor_entry_function(payload, payload_len, (void *)input, + payload_len_out, states, + (zcbor_decoder_t *)encode_suit_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_suit_nfy(uint8_t *payload, size_t payload_len, + const struct suit_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_suit_nfy, + sizeof(states) / sizeof(zcbor_state_t), 1); } diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.h b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.h index 2a7fbee1c648..ad73bcba515b 100644 --- a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.h +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_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,29 @@ #ifndef SUIT_SERVICE_ENCODE_H__ #define SUIT_SERVICE_ENCODE_H__ -#include +#include "suit_service_types.h" #include #include +#include #include -#include "suit_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_suit_req(uint8_t *payload, size_t payload_len, const struct suit_req *input, - size_t *payload_len_out); +int cbor_encode_suit_req(uint8_t *payload, size_t payload_len, + const struct suit_req *input, size_t *payload_len_out); -int cbor_encode_suit_rsp(uint8_t *payload, size_t payload_len, const struct suit_rsp *input, - size_t *payload_len_out); +int cbor_encode_suit_rsp(uint8_t *payload, size_t payload_len, + const struct suit_rsp *input, size_t *payload_len_out); -int cbor_encode_suit_nfy(uint8_t *payload, size_t payload_len, const struct suit_nfy *input, - size_t *payload_len_out); +int cbor_encode_suit_nfy(uint8_t *payload, size_t payload_len, + const struct suit_nfy *input, size_t *payload_len_out); #ifdef __cplusplus } diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_types.h b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_types.h index acd90121b9c0..89715728ccf1 100644 --- a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_types.h +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_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 SUIT_SERVICE_TYPES_H__ #define SUIT_SERVICE_TYPES_H__ -#include #include #include +#include #include #ifdef __cplusplus @@ -32,261 +32,266 @@ extern "C" { #define DEFAULT_MAX_QTY 3 struct suit_missing_image_evt_nfy { - struct zcbor_string suit_missing_image_evt_nfy_resource_id; - uint32_t suit_missing_image_evt_nfy_stream_session_id; + struct zcbor_string suit_missing_image_evt_nfy_resource_id; + uint32_t suit_missing_image_evt_nfy_stream_session_id; }; struct suit_chunk_status_evt_nfy { - uint32_t suit_chunk_status_evt_nfy_stream_session_id; + uint32_t suit_chunk_status_evt_nfy_stream_session_id; }; struct suit_nfy { - union { - struct suit_missing_image_evt_nfy suit_nfy_msg_suit_missing_image_evt_nfy_m; - struct suit_chunk_status_evt_nfy suit_nfy_msg_suit_chunk_status_evt_nfy_m; - }; - enum { - suit_nfy_msg_suit_missing_image_evt_nfy_m_c, - suit_nfy_msg_suit_chunk_status_evt_nfy_m_c, - } suit_nfy_msg_choice; + union { + struct suit_missing_image_evt_nfy suit_nfy_msg_suit_missing_image_evt_nfy_m; + struct suit_chunk_status_evt_nfy suit_nfy_msg_suit_chunk_status_evt_nfy_m; + }; + enum { + suit_nfy_msg_suit_missing_image_evt_nfy_m_c, + suit_nfy_msg_suit_chunk_status_evt_nfy_m_c, + } suit_nfy_msg_choice; }; struct suit_cache_info_entry { - uint32_t suit_cache_info_entry_addr; - uint32_t suit_cache_info_entry_size; + uint32_t suit_cache_info_entry_addr; + uint32_t suit_cache_info_entry_size; }; struct suit_trigger_update_req { - uint32_t suit_trigger_update_req_addr; - uint32_t suit_trigger_update_req_size; - struct suit_cache_info_entry suit_trigger_update_req_caches_suit_cache_info_entry_m[6]; - size_t suit_trigger_update_req_caches_suit_cache_info_entry_m_count; + uint32_t suit_trigger_update_req_addr; + uint32_t suit_trigger_update_req_size; + struct suit_cache_info_entry + suit_trigger_update_req_caches_suit_cache_info_entry_m[6]; + size_t suit_trigger_update_req_caches_suit_cache_info_entry_m_count; }; struct suit_check_installed_component_digest_req { - struct zcbor_string suit_check_installed_component_digest_req_component_id; - int32_t suit_check_installed_component_digest_req_alg_id; - struct zcbor_string suit_check_installed_component_digest_req_digest; + struct zcbor_string suit_check_installed_component_digest_req_component_id; + int32_t suit_check_installed_component_digest_req_alg_id; + struct zcbor_string suit_check_installed_component_digest_req_digest; }; struct suit_get_installed_manifest_info_req { - struct zcbor_string suit_get_installed_manifest_info_req_manifest_class_id; + struct zcbor_string suit_get_installed_manifest_info_req_manifest_class_id; }; struct suit_authenticate_manifest_req { - struct zcbor_string suit_authenticate_manifest_req_manifest_component_id; - uint32_t suit_authenticate_manifest_req_alg_id; - struct zcbor_string suit_authenticate_manifest_req_key_id; - struct zcbor_string suit_authenticate_manifest_req_signature; - uint32_t suit_authenticate_manifest_req_data_addr; - uint32_t suit_authenticate_manifest_req_data_size; + struct zcbor_string suit_authenticate_manifest_req_manifest_component_id; + uint32_t suit_authenticate_manifest_req_alg_id; + struct zcbor_string suit_authenticate_manifest_req_key_id; + struct zcbor_string suit_authenticate_manifest_req_signature; + uint32_t suit_authenticate_manifest_req_data_addr; + uint32_t suit_authenticate_manifest_req_data_size; }; struct suit_authorize_unsigned_manifest_req { - struct zcbor_string suit_authorize_unsigned_manifest_req_manifest_component_id; + struct zcbor_string + suit_authorize_unsigned_manifest_req_manifest_component_id; }; struct suit_authorize_seq_num_req { - struct zcbor_string suit_authorize_seq_num_req_manifest_component_id; - uint32_t suit_authorize_seq_num_req_command_seq; - uint32_t suit_authorize_seq_num_req_seq_num; + struct zcbor_string suit_authorize_seq_num_req_manifest_component_id; + uint32_t suit_authorize_seq_num_req_command_seq; + uint32_t suit_authorize_seq_num_req_seq_num; }; struct suit_check_component_compatibility_req { - struct zcbor_string suit_check_component_compatibility_req_manifest_class_id; - struct zcbor_string suit_check_component_compatibility_req_component_id; + struct zcbor_string suit_check_component_compatibility_req_manifest_class_id; + struct zcbor_string suit_check_component_compatibility_req_component_id; }; struct suit_get_supported_manifest_info_req { - int32_t suit_get_supported_manifest_info_req_role; + int32_t suit_get_supported_manifest_info_req_role; }; struct suit_authorize_process_dependency_req { - struct zcbor_string suit_authorize_process_dependency_req_dependee_class_id; - struct zcbor_string suit_authorize_process_dependency_req_dependent_class_id; - int32_t suit_authorize_process_dependency_req_seq_id; + struct zcbor_string suit_authorize_process_dependency_req_dependee_class_id; + struct zcbor_string suit_authorize_process_dependency_req_dependent_class_id; + int32_t suit_authorize_process_dependency_req_seq_id; }; struct suit_evt_sub_req { - bool suit_evt_sub_req_subscribe; + bool suit_evt_sub_req_subscribe; }; struct suit_chunk_enqueue_req { - uint32_t suit_chunk_enqueue_req_stream_session_id; - uint32_t suit_chunk_enqueue_req_chunk_id; - uint32_t suit_chunk_enqueue_req_offset; - bool suit_chunk_enqueue_req_last_chunk; - uint32_t suit_chunk_enqueue_req_addr; - uint32_t suit_chunk_enqueue_req_size; + uint32_t suit_chunk_enqueue_req_stream_session_id; + uint32_t suit_chunk_enqueue_req_chunk_id; + uint32_t suit_chunk_enqueue_req_offset; + bool suit_chunk_enqueue_req_last_chunk; + uint32_t suit_chunk_enqueue_req_addr; + uint32_t suit_chunk_enqueue_req_size; }; struct suit_chunk_status_req { - uint32_t suit_chunk_status_req_stream_session_id; + uint32_t suit_chunk_status_req_stream_session_id; }; struct suit_req { - union { - struct suit_trigger_update_req suit_req_msg_suit_trigger_update_req_m; - struct suit_check_installed_component_digest_req - suit_req_msg_suit_check_installed_component_digest_req_m; - struct suit_get_installed_manifest_info_req - suit_req_msg_suit_get_installed_manifest_info_req_m; - struct suit_authenticate_manifest_req suit_req_msg_suit_authenticate_manifest_req_m; - struct suit_authorize_unsigned_manifest_req - suit_req_msg_suit_authorize_unsigned_manifest_req_m; - struct suit_authorize_seq_num_req suit_req_msg_suit_authorize_seq_num_req_m; - struct suit_check_component_compatibility_req - suit_req_msg_suit_check_component_compatibility_req_m; - struct suit_get_supported_manifest_info_req - suit_req_msg_suit_get_supported_manifest_info_req_m; - struct suit_authorize_process_dependency_req - suit_req_msg_suit_authorize_process_dependency_req_m; - struct suit_evt_sub_req suit_req_msg_suit_evt_sub_req_m; - struct suit_chunk_enqueue_req suit_req_msg_suit_chunk_enqueue_req_m; - struct suit_chunk_status_req suit_req_msg_suit_chunk_status_req_m; - }; - enum { - suit_req_msg_suit_trigger_update_req_m_c, - suit_req_msg_suit_check_installed_component_digest_req_m_c, - suit_req_msg_suit_get_installed_manifest_info_req_m_c, - suit_req_msg_suit_get_install_candidate_info_req_m_c, - suit_req_msg_suit_authenticate_manifest_req_m_c, - suit_req_msg_suit_authorize_unsigned_manifest_req_m_c, - suit_req_msg_suit_authorize_seq_num_req_m_c, - suit_req_msg_suit_check_component_compatibility_req_m_c, - suit_req_msg_suit_get_supported_manifest_roles_req_m_c, - suit_req_msg_suit_get_supported_manifest_info_req_m_c, - suit_req_msg_suit_authorize_process_dependency_req_m_c, - suit_req_msg_suit_evt_sub_req_m_c, - suit_req_msg_suit_chunk_enqueue_req_m_c, - suit_req_msg_suit_chunk_status_req_m_c, - } suit_req_msg_choice; + union { + struct suit_trigger_update_req suit_req_msg_suit_trigger_update_req_m; + struct suit_check_installed_component_digest_req + suit_req_msg_suit_check_installed_component_digest_req_m; + struct suit_get_installed_manifest_info_req + suit_req_msg_suit_get_installed_manifest_info_req_m; + struct suit_authenticate_manifest_req + suit_req_msg_suit_authenticate_manifest_req_m; + struct suit_authorize_unsigned_manifest_req + suit_req_msg_suit_authorize_unsigned_manifest_req_m; + struct suit_authorize_seq_num_req suit_req_msg_suit_authorize_seq_num_req_m; + struct suit_check_component_compatibility_req + suit_req_msg_suit_check_component_compatibility_req_m; + struct suit_get_supported_manifest_info_req + suit_req_msg_suit_get_supported_manifest_info_req_m; + struct suit_authorize_process_dependency_req + suit_req_msg_suit_authorize_process_dependency_req_m; + struct suit_evt_sub_req suit_req_msg_suit_evt_sub_req_m; + struct suit_chunk_enqueue_req suit_req_msg_suit_chunk_enqueue_req_m; + struct suit_chunk_status_req suit_req_msg_suit_chunk_status_req_m; + }; + enum { + suit_req_msg_suit_trigger_update_req_m_c, + suit_req_msg_suit_check_installed_component_digest_req_m_c, + suit_req_msg_suit_get_installed_manifest_info_req_m_c, + suit_req_msg_suit_get_install_candidate_info_req_m_c, + suit_req_msg_suit_authenticate_manifest_req_m_c, + suit_req_msg_suit_authorize_unsigned_manifest_req_m_c, + suit_req_msg_suit_authorize_seq_num_req_m_c, + suit_req_msg_suit_check_component_compatibility_req_m_c, + suit_req_msg_suit_get_supported_manifest_roles_req_m_c, + suit_req_msg_suit_get_supported_manifest_info_req_m_c, + suit_req_msg_suit_authorize_process_dependency_req_m_c, + suit_req_msg_suit_evt_sub_req_m_c, + suit_req_msg_suit_chunk_enqueue_req_m_c, + suit_req_msg_suit_chunk_status_req_m_c, + } suit_req_msg_choice; }; struct suit_trigger_update_rsp { - int32_t suit_trigger_update_rsp_ret; + int32_t suit_trigger_update_rsp_ret; }; struct suit_check_installed_component_digest_rsp { - int32_t suit_check_installed_component_digest_rsp_ret; + int32_t suit_check_installed_component_digest_rsp_ret; }; struct suit_get_installed_manifest_info_rsp { - int32_t suit_get_installed_manifest_info_rsp_ret; - uint32_t suit_get_installed_manifest_info_rsp_seq_num; - int32_t suit_get_installed_manifest_info_rsp_semver_int[5]; - size_t suit_get_installed_manifest_info_rsp_semver_int_count; - int32_t suit_get_installed_manifest_info_rsp_digest_status; - int32_t suit_get_installed_manifest_info_rsp_alg_id; - struct zcbor_string suit_get_installed_manifest_info_rsp_digest; + int32_t suit_get_installed_manifest_info_rsp_ret; + uint32_t suit_get_installed_manifest_info_rsp_seq_num; + int32_t suit_get_installed_manifest_info_rsp_semver_int[5]; + size_t suit_get_installed_manifest_info_rsp_semver_int_count; + int32_t suit_get_installed_manifest_info_rsp_digest_status; + int32_t suit_get_installed_manifest_info_rsp_alg_id; + struct zcbor_string suit_get_installed_manifest_info_rsp_digest; }; struct suit_get_install_candidate_info_rsp { - int32_t suit_get_install_candidate_info_rsp_ret; - struct zcbor_string suit_get_install_candidate_info_rsp_manifest_class_id; - uint32_t suit_get_install_candidate_info_rsp_seq_num; - int32_t suit_get_install_candidate_info_rsp_semver_int[5]; - size_t suit_get_install_candidate_info_rsp_semver_int_count; - int32_t suit_get_install_candidate_info_rsp_alg_id; - struct zcbor_string suit_get_install_candidate_info_rsp_digest; + int32_t suit_get_install_candidate_info_rsp_ret; + struct zcbor_string suit_get_install_candidate_info_rsp_manifest_class_id; + uint32_t suit_get_install_candidate_info_rsp_seq_num; + int32_t suit_get_install_candidate_info_rsp_semver_int[5]; + size_t suit_get_install_candidate_info_rsp_semver_int_count; + int32_t suit_get_install_candidate_info_rsp_alg_id; + struct zcbor_string suit_get_install_candidate_info_rsp_digest; }; struct suit_authenticate_manifest_rsp { - int32_t suit_authenticate_manifest_rsp_ret; + int32_t suit_authenticate_manifest_rsp_ret; }; struct suit_authorize_unsigned_manifest_rsp { - int32_t suit_authorize_unsigned_manifest_rsp_ret; + int32_t suit_authorize_unsigned_manifest_rsp_ret; }; struct suit_authorize_seq_num_rsp { - int32_t suit_authorize_seq_num_rsp_ret; + int32_t suit_authorize_seq_num_rsp_ret; }; struct suit_check_component_compatibility_rsp { - int32_t suit_check_component_compatibility_rsp_ret; + int32_t suit_check_component_compatibility_rsp_ret; }; struct suit_get_supported_manifest_roles_rsp { - int32_t suit_get_supported_manifest_roles_rsp_ret; - int32_t suit_get_supported_manifest_roles_rsp_roles_int[20]; - size_t suit_get_supported_manifest_roles_rsp_roles_int_count; + int32_t suit_get_supported_manifest_roles_rsp_ret; + int32_t suit_get_supported_manifest_roles_rsp_roles_int[20]; + size_t suit_get_supported_manifest_roles_rsp_roles_int_count; }; struct suit_get_supported_manifest_info_rsp { - int32_t suit_get_supported_manifest_info_rsp_ret; - int32_t suit_get_supported_manifest_info_rsp_role; - struct zcbor_string suit_get_supported_manifest_info_rsp_vendor_id; - struct zcbor_string suit_get_supported_manifest_info_rsp_class_id; - int32_t suit_get_supported_manifest_info_rsp_downgrade_prevention_policy; - int32_t suit_get_supported_manifest_info_rsp_independent_updateability_policy; - int32_t suit_get_supported_manifest_info_rsp_signature_verification_policy; + int32_t suit_get_supported_manifest_info_rsp_ret; + int32_t suit_get_supported_manifest_info_rsp_role; + struct zcbor_string suit_get_supported_manifest_info_rsp_vendor_id; + struct zcbor_string suit_get_supported_manifest_info_rsp_class_id; + int32_t suit_get_supported_manifest_info_rsp_downgrade_prevention_policy; + int32_t suit_get_supported_manifest_info_rsp_independent_updateability_policy; + int32_t suit_get_supported_manifest_info_rsp_signature_verification_policy; }; struct suit_authorize_process_dependency_rsp { - int32_t suit_authorize_process_dependency_rsp_ret; + int32_t suit_authorize_process_dependency_rsp_ret; }; struct suit_evt_sub_rsp { - int32_t suit_evt_sub_rsp_ret; + int32_t suit_evt_sub_rsp_ret; }; struct suit_chunk_enqueue_rsp { - int32_t suit_chunk_enqueue_rsp_ret; + int32_t suit_chunk_enqueue_rsp_ret; }; struct suit_chunk_info_entry { - uint32_t suit_chunk_info_entry_chunk_id; - uint32_t suit_chunk_info_entry_status; + uint32_t suit_chunk_info_entry_chunk_id; + uint32_t suit_chunk_info_entry_status; }; struct suit_chunk_status_rsp { - int32_t suit_chunk_status_rsp_ret; - struct suit_chunk_info_entry suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m[3]; - size_t suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count; + int32_t suit_chunk_status_rsp_ret; + struct suit_chunk_info_entry + suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m[3]; + size_t suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count; }; struct suit_rsp { - union { - struct suit_trigger_update_rsp suit_rsp_msg_suit_trigger_update_rsp_m; - struct suit_check_installed_component_digest_rsp - suit_rsp_msg_suit_check_installed_component_digest_rsp_m; - struct suit_get_installed_manifest_info_rsp - suit_rsp_msg_suit_get_installed_manifest_info_rsp_m; - struct suit_get_install_candidate_info_rsp - suit_rsp_msg_suit_get_install_candidate_info_rsp_m; - struct suit_authenticate_manifest_rsp suit_rsp_msg_suit_authenticate_manifest_rsp_m; - struct suit_authorize_unsigned_manifest_rsp - suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m; - struct suit_authorize_seq_num_rsp suit_rsp_msg_suit_authorize_seq_num_rsp_m; - struct suit_check_component_compatibility_rsp - suit_rsp_msg_suit_check_component_compatibility_rsp_m; - struct suit_get_supported_manifest_roles_rsp - suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m; - struct suit_get_supported_manifest_info_rsp - suit_rsp_msg_suit_get_supported_manifest_info_rsp_m; - struct suit_authorize_process_dependency_rsp - suit_rsp_msg_suit_authorize_process_dependency_rsp_m; - struct suit_evt_sub_rsp suit_rsp_msg_suit_evt_sub_rsp_m; - struct suit_chunk_enqueue_rsp suit_rsp_msg_suit_chunk_enqueue_rsp_m; - struct suit_chunk_status_rsp suit_rsp_msg_suit_chunk_status_rsp_m; - }; - enum { - suit_rsp_msg_suit_trigger_update_rsp_m_c, - suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c, - suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c, - suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c, - suit_rsp_msg_suit_authenticate_manifest_rsp_m_c, - suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c, - suit_rsp_msg_suit_authorize_seq_num_rsp_m_c, - suit_rsp_msg_suit_check_component_compatibility_rsp_m_c, - suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c, - suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c, - suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c, - suit_rsp_msg_suit_evt_sub_rsp_m_c, - suit_rsp_msg_suit_chunk_enqueue_rsp_m_c, - suit_rsp_msg_suit_chunk_status_rsp_m_c, - } suit_rsp_msg_choice; + union { + struct suit_trigger_update_rsp suit_rsp_msg_suit_trigger_update_rsp_m; + struct suit_check_installed_component_digest_rsp + suit_rsp_msg_suit_check_installed_component_digest_rsp_m; + struct suit_get_installed_manifest_info_rsp + suit_rsp_msg_suit_get_installed_manifest_info_rsp_m; + struct suit_get_install_candidate_info_rsp + suit_rsp_msg_suit_get_install_candidate_info_rsp_m; + struct suit_authenticate_manifest_rsp + suit_rsp_msg_suit_authenticate_manifest_rsp_m; + struct suit_authorize_unsigned_manifest_rsp + suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m; + struct suit_authorize_seq_num_rsp suit_rsp_msg_suit_authorize_seq_num_rsp_m; + struct suit_check_component_compatibility_rsp + suit_rsp_msg_suit_check_component_compatibility_rsp_m; + struct suit_get_supported_manifest_roles_rsp + suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m; + struct suit_get_supported_manifest_info_rsp + suit_rsp_msg_suit_get_supported_manifest_info_rsp_m; + struct suit_authorize_process_dependency_rsp + suit_rsp_msg_suit_authorize_process_dependency_rsp_m; + struct suit_evt_sub_rsp suit_rsp_msg_suit_evt_sub_rsp_m; + struct suit_chunk_enqueue_rsp suit_rsp_msg_suit_chunk_enqueue_rsp_m; + struct suit_chunk_status_rsp suit_rsp_msg_suit_chunk_status_rsp_m; + }; + enum { + suit_rsp_msg_suit_trigger_update_rsp_m_c, + suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c, + suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c, + suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c, + suit_rsp_msg_suit_authenticate_manifest_rsp_m_c, + suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c, + suit_rsp_msg_suit_authorize_seq_num_rsp_m_c, + suit_rsp_msg_suit_check_component_compatibility_rsp_m_c, + suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c, + suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c, + suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c, + suit_rsp_msg_suit_evt_sub_rsp_m_c, + suit_rsp_msg_suit_chunk_enqueue_rsp_m_c, + suit_rsp_msg_suit_chunk_status_rsp_m_c, + } suit_rsp_msg_choice; }; #ifdef __cplusplus