1 /*
2  * Generated using zcbor version 0.8.0
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_encode.h"
12 #include "cbor/edhoc_encode_message_3.h"
13 #include "zcbor_print.h"
14 
15 #if DEFAULT_MAX_QTY != 3
16 #error "The type file was generated with a different default_max_qty than this file"
17 #endif
18 
19 static bool encode_m3_CIPHERTEXT_3(zcbor_state_t *state, const struct zcbor_string *input);
20 
21 
encode_m3_CIPHERTEXT_3(zcbor_state_t * state,const struct zcbor_string * input)22 static bool encode_m3_CIPHERTEXT_3(
23 		zcbor_state_t *state, const struct zcbor_string *input)
24 {
25 	zcbor_log("%s\r\n", __func__);
26 
27 	bool tmp_result = (((zcbor_bstr_encode(state, (&(*input))))));
28 
29 	if (!tmp_result) {
30 		zcbor_trace_file(state);
31 		zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state)));
32 	} else {
33 		zcbor_log("%s success\r\n", __func__);
34 	}
35 
36 	return tmp_result;
37 }
38 
39 
40 
cbor_encode_m3_CIPHERTEXT_3(uint8_t * payload,size_t payload_len,const struct zcbor_string * input,size_t * payload_len_out)41 int cbor_encode_m3_CIPHERTEXT_3(
42 		uint8_t *payload, size_t payload_len,
43 		const struct zcbor_string *input,
44 		size_t *payload_len_out)
45 {
46 	zcbor_state_t states[2];
47 
48 	return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states,
49 		(zcbor_decoder_t *)encode_m3_CIPHERTEXT_3, sizeof(states) / sizeof(zcbor_state_t), 1);
50 }
51