1 /*
2 * Generated using zcbor version 0.3.99
3 * https://github.com/NordicSemiconductor/zcbor
4 * Generated with a --default-max-qty of 3
5 */
6
7 #include <stdint.h>
8 #include <stdbool.h>
9 #include <stddef.h>
10 #include <string.h>
11 #include "zcbor_decode.h"
12 #include "cbor/edhoc_decode_message_3.h"
13
14 #if DEFAULT_MAX_QTY != 3
15 #error "The type file was generated with a different default_max_qty than this file"
16 #endif
17
18
decode_m3_CIPHERTEXT_3(zcbor_state_t * state,struct zcbor_string * result)19 static bool decode_m3_CIPHERTEXT_3(
20 zcbor_state_t *state, struct zcbor_string *result)
21 {
22 zcbor_print("%s\r\n", __func__);
23
24 bool tmp_result = (((zcbor_bstr_decode(state, (&(*result))))));
25
26 if (!tmp_result)
27 zcbor_trace();
28
29 return tmp_result;
30 }
31
32
33
cbor_decode_m3_CIPHERTEXT_3(const uint8_t * payload,size_t payload_len,struct zcbor_string * result,size_t * payload_len_out)34 bool cbor_decode_m3_CIPHERTEXT_3(
35 const uint8_t *payload, size_t payload_len,
36 struct zcbor_string *result,
37 size_t *payload_len_out)
38 {
39 zcbor_state_t states[2];
40
41 zcbor_new_state(states, sizeof(states) / sizeof(zcbor_state_t), payload, payload_len, 1);
42
43 bool ret = decode_m3_CIPHERTEXT_3(states, result);
44
45 if (ret && (payload_len_out != NULL)) {
46 *payload_len_out = MIN(payload_len,
47 (size_t)states[0].payload - (size_t)payload);
48 }
49
50 return ret;
51 }
52