Home
last modified time | relevance | path

Searched refs:state (Results 1 – 25 of 43) sorted by relevance

12

/mcuboot-latest/boot/zcbor/include/
Dzcbor_decode.h71 bool zcbor_int32_decode(zcbor_state_t *state, int32_t *result); /* pint/nint */
72 bool zcbor_int64_decode(zcbor_state_t *state, int64_t *result); /* pint/nint */
73 bool zcbor_uint32_decode(zcbor_state_t *state, uint32_t *result); /* pint */
74 bool zcbor_uint64_decode(zcbor_state_t *state, uint64_t *result); /* pint */
75 bool zcbor_size_decode(zcbor_state_t *state, size_t *result); /* pint */
76 bool zcbor_int_decode(zcbor_state_t *state, void *result, size_t result_size); /* pint/nint */
77 bool zcbor_uint_decode(zcbor_state_t *state, void *result, size_t result_size); /* pint */
78 bool zcbor_bstr_decode(zcbor_state_t *state, struct zcbor_string *result); /* bstr */
79 bool zcbor_tstr_decode(zcbor_state_t *state, struct zcbor_string *result); /* tstr */
80 bool zcbor_tag_decode(zcbor_state_t *state, uint32_t *result); /* CBOR tag */
[all …]
Dzcbor_encode.h67 bool zcbor_int32_put(zcbor_state_t *state, int32_t input); /* pint/nint */
68 bool zcbor_int64_put(zcbor_state_t *state, int64_t input); /* pint/nint */
69 bool zcbor_uint32_put(zcbor_state_t *state, uint32_t input); /* pint */
70 bool zcbor_uint64_put(zcbor_state_t *state, uint64_t input); /* pint */
71 bool zcbor_size_put(zcbor_state_t *state, size_t input); /* pint */
72 bool zcbor_tag_put(zcbor_state_t *state, uint32_t tag); /* CBOR tag */
73 bool zcbor_simple_put(zcbor_state_t *state, uint8_t input); /* CBOR simple value */
74 bool zcbor_bool_put(zcbor_state_t *state, bool input); /* boolean CBOR simple value */
75 bool zcbor_nil_put(zcbor_state_t *state, const void *unused); /* 'nil' CBOR simple value */
76 bool zcbor_undefined_put(zcbor_state_t *state, const void *unused); /* 'undefined' CBOR simple valu…
[all …]
Dzcbor_common.h195 zcbor_trace_file(state); \
210 zcbor_error(state, err); \
223 ZCBOR_ERR_IF(state->payload >= state->payload_end, ZCBOR_ERR_NO_PAYLOAD)
228 if (!zcbor_check_error(state)) { \
282 bool zcbor_new_backup(zcbor_state_t *state, size_t new_elem_count);
288 bool zcbor_process_backup(zcbor_state_t *state, uint32_t flags, size_t max_elem_count);
295 bool zcbor_union_start_code(zcbor_state_t *state);
302 bool zcbor_union_elem_code(zcbor_state_t *state);
308 bool zcbor_union_end_code(zcbor_state_t *state);
328 void *result, size_t *payload_len_out, zcbor_state_t *state, zcbor_decoder_t func,
[all …]
Dzcbor_print.h28 #define zcbor_trace_raw(state) (zcbor_do_print("rem: %zu, cur: 0x%x, ec: 0x%zx, err: %d",\ argument
29 (size_t)state->payload_end - (size_t)state->payload, *state->payload, state->elem_count, \
30 state->constant_state ? state->constant_state->error : 0))
31 #define zcbor_trace(state, appendix) do { \ argument
32 zcbor_trace_raw(state); \
35 #define zcbor_trace_file(state) do { \ argument
36 zcbor_trace_raw(state); \
49 #define zcbor_trace(state, appendix)
50 #define zcbor_trace_file(state) ((void)state)
/mcuboot-latest/boot/zcbor/src/
Dzcbor_decode.c40 static bool initial_checks(zcbor_state_t *state) in initial_checks() argument
48 static bool type_check(zcbor_state_t *state, zcbor_major_type_t exp_major_type) in type_check() argument
50 if (!initial_checks(state)) { in type_check()
53 zcbor_major_type_t major_type = ZCBOR_MAJOR_TYPE(*state->payload); in type_check()
64 if (!initial_checks(state)) { \
71 if (!type_check(state, exp_major_type)) { \
76 static void err_restore(zcbor_state_t *state, int err) in err_restore() argument
78 state->payload = state->payload_bak; in err_restore()
79 state->elem_count++; in err_restore()
80 zcbor_error(state, err); in err_restore()
[all …]
Dzcbor_encode.c48 static bool encode_header_byte(zcbor_state_t *state, in encode_header_byte() argument
56 *(state->payload_mut++) = (uint8_t)((major_type << 5) | (additional & 0x1F)); in encode_header_byte()
63 static bool value_encode_len(zcbor_state_t *state, zcbor_major_type_t major_type, in value_encode_len() argument
68 if ((state->payload + 1 + result_len) > state->payload_end) { in value_encode_len()
72 if (!encode_header_byte(state, major_type, in value_encode_len()
76 state->payload_mut--; in value_encode_len()
77 zcbor_trace(state, "value_encode_len"); in value_encode_len()
78 state->payload_mut++; in value_encode_len()
81 memcpy(state->payload_mut, u8_result, result_len); in value_encode_len()
82 state->payload_mut += result_len; in value_encode_len()
[all …]
Dzcbor_common.c25 bool zcbor_new_backup(zcbor_state_t *state, size_t new_elem_count) in zcbor_new_backup() argument
29 if ((state->constant_state->current_backup) in zcbor_new_backup()
30 >= state->constant_state->num_backups) { in zcbor_new_backup()
34 state->payload_moved = false; in zcbor_new_backup()
36 (state->constant_state->current_backup)++; in zcbor_new_backup()
40 size_t i = (state->constant_state->current_backup) - 1; in zcbor_new_backup()
42 memcpy(&state->constant_state->backup_list[i], state, in zcbor_new_backup()
45 state->elem_count = new_elem_count; in zcbor_new_backup()
53 bool zcbor_process_backup(zcbor_state_t *state, uint32_t flags, in zcbor_process_backup() argument
57 zcbor_state_t local_copy = *state; in zcbor_process_backup()
[all …]
/mcuboot-latest/boot/bootutil/src/
Dloader.c116 boot_read_image_headers(struct boot_loader_state *state, bool require_all, in boot_read_image_headers() argument
124 BOOT_CURR_IMG(state), i, boot_img_hdr(state, i)); in boot_read_image_headers()
127 rc = boot_read_image_header(state, i, boot_img_hdr(state, i), bs); in boot_read_image_headers()
156 boot_add_shared_data(struct boot_loader_state *state, in boot_add_shared_data() argument
163 rc = boot_save_boot_status(BOOT_CURR_IMG(state), in boot_add_shared_data()
164 boot_img_hdr(state, active_slot), in boot_add_shared_data()
165 BOOT_IMG_AREA(state, active_slot)); in boot_add_shared_data()
173 rc = boot_save_shared_data(boot_img_hdr(state, active_slot), in boot_add_shared_data()
174 BOOT_IMG_AREA(state, active_slot), in boot_add_shared_data()
185 (void) (state); in boot_add_shared_data()
[all …]
Dswap_priv.h30 int swap_erase_trailer_sectors(const struct boot_loader_state *state,
37 int swap_status_init(const struct boot_loader_state *state,
50 int swap_status_source(struct boot_loader_state *state);
58 int swap_read_status(struct boot_loader_state *state, struct boot_status *bs);
66 struct boot_loader_state *state,
89 void swap_run(struct boot_loader_state *state,
94 #define BOOT_SCRATCH_AREA(state) ((state)->scratch.area) argument
96 static inline size_t boot_scratch_area_size(const struct boot_loader_state *state) in boot_scratch_area_size() argument
98 return flash_area_get_size(BOOT_SCRATCH_AREA(state)); in boot_scratch_area_size()
114 bool swap_write_block_size_check(struct boot_loader_state *state);
[all …]
Dswap_move.c51 find_last_idx(struct boot_loader_state *state, uint32_t swap_size) in find_last_idx() argument
57 sector_sz = boot_img_sector_size(state, BOOT_PRIMARY_SLOT, 0); in find_last_idx()
72 boot_read_image_header(struct boot_loader_state *state, int slot, in boot_read_image_header() argument
84 (void)state; in boot_read_image_header()
89 boot_find_status(BOOT_CURR_IMG(state), &fap); in boot_read_image_header()
96 last_idx = find_last_idx(state, swap_size); in boot_read_image_header()
97 sz = boot_img_sector_size(state, BOOT_PRIMARY_SLOT, 0); in boot_read_image_header()
111 } else if (slot == 1 && bs->state == 2) { in boot_read_image_header()
118 area_id = flash_area_id_from_multi_image_slot(BOOT_CURR_IMG(state), slot); in boot_read_image_header()
146 struct boot_loader_state *state, struct boot_status *bs) in swap_read_status_bytes() argument
[all …]
Dswap_scratch.c58 struct boot_loader_state *state, struct boot_status *bs) in swap_read_status_bytes() argument
70 max_entries = boot_status_entries(BOOT_CURR_IMG(state), fap); in swap_read_status_bytes()
79 rc = flash_area_read(fap, off + i * BOOT_WRITE_SZ(state), in swap_read_status_bytes()
118 bs->state = (found_idx % BOOT_STATUS_STATE_COUNT) + 1; in swap_read_status_bytes()
132 (bs->state - BOOT_STATUS_STATE_0) * elem_sz; in boot_status_internal_off()
142 boot_slots_compatible(struct boot_loader_state *state) in boot_slots_compatible() argument
154 num_sectors_primary = boot_img_num_sectors(state, BOOT_PRIMARY_SLOT); in boot_slots_compatible()
155 num_sectors_secondary = boot_img_num_sectors(state, BOOT_SECONDARY_SLOT); in boot_slots_compatible()
163 scratch_sz = boot_scratch_area_size(state); in boot_slots_compatible()
178 sz0 += boot_img_sector_size(state, BOOT_PRIMARY_SLOT, i); in boot_slots_compatible()
[all …]
Dbootutil_priv.h88 uint8_t state; /* Which part of the swapping process are we at */ member
280 struct boot_swap_state *state);
282 struct boot_swap_state *state);
284 int boot_write_status(const struct boot_loader_state *state, struct boot_status *bs);
295 int boot_slots_compatible(struct boot_loader_state *state);
297 int boot_read_image_header(struct boot_loader_state *state, int slot,
299 int boot_copy_region(struct boot_loader_state *state,
364 #define BOOT_CURR_IMG(state) ((state)->curr_img_idx) argument
366 #define BOOT_CURR_IMG(state) 0 argument
369 #define BOOT_CURR_ENC(state) ((state)->enc[BOOT_CURR_IMG(state)]) argument
[all …]
Dswap_misc.c35 swap_erase_trailer_sectors(const struct boot_loader_state *state, in swap_erase_trailer_sectors() argument
51 image_index = BOOT_CURR_IMG(state); in swap_erase_trailer_sectors()
66 sector = boot_img_num_sectors(state, slot) - 1; in swap_erase_trailer_sectors()
67 trailer_sz = boot_trailer_sz(BOOT_WRITE_SZ(state)); in swap_erase_trailer_sectors()
70 sz = boot_img_sector_size(state, slot, sector); in swap_erase_trailer_sectors()
71 off = boot_img_sector_off(state, slot, sector); in swap_erase_trailer_sectors()
83 swap_status_init(const struct boot_loader_state *state, in swap_status_init() argument
92 (void)state; in swap_status_init()
95 image_index = BOOT_CURR_IMG(state); in swap_status_init()
131 swap_read_status(struct boot_loader_state *state, struct boot_status *bs) in swap_read_status() argument
[all …]
Dbootutil_public.c221 struct boot_swap_state *state) in boot_read_swap_state() argument
234 state->magic = BOOT_MAGIC_UNSET; in boot_read_swap_state()
236 state->magic = boot_magic_decode(magic); in boot_read_swap_state()
246 state->swap_type = BOOT_GET_SWAP_TYPE(swap_info); in boot_read_swap_state()
247 state->image_num = BOOT_GET_IMAGE_NUM(swap_info); in boot_read_swap_state()
250 state->swap_type > BOOT_SWAP_TYPE_REVERT) { in boot_read_swap_state()
251 state->swap_type = BOOT_SWAP_TYPE_NONE; in boot_read_swap_state()
252 state->image_num = 0; in boot_read_swap_state()
255 rc = boot_read_copy_done(fap, &state->copy_done); in boot_read_swap_state()
260 return boot_read_image_ok(fap, &state->image_ok); in boot_read_swap_state()
[all …]
/mcuboot-latest/ext/tinycrypt/lib/source/
Daes_decrypt.c131 uint8_t state[Nk*Nb]; in tc_aes_decrypt() local
142 (void)_copy(state, sizeof(state), in, sizeof(state)); in tc_aes_decrypt()
144 add_round_key(state, s->words + Nb*Nr); in tc_aes_decrypt()
147 inv_shift_rows(state); in tc_aes_decrypt()
148 inv_sub_bytes(state); in tc_aes_decrypt()
149 add_round_key(state, s->words + Nb*i); in tc_aes_decrypt()
150 inv_mix_columns(state); in tc_aes_decrypt()
153 inv_shift_rows(state); in tc_aes_decrypt()
154 inv_sub_bytes(state); in tc_aes_decrypt()
155 add_round_key(state, s->words); in tc_aes_decrypt()
[all …]
Daes_encrypt.c160 uint8_t state[Nk*Nb]; in tc_aes_encrypt() local
171 (void)_copy(state, sizeof(state), in, sizeof(state)); in tc_aes_encrypt()
172 add_round_key(state, s->words); in tc_aes_encrypt()
175 sub_bytes(state); in tc_aes_encrypt()
176 shift_rows(state); in tc_aes_encrypt()
177 mix_columns(state); in tc_aes_encrypt()
178 add_round_key(state, s->words + Nb*(i+1)); in tc_aes_encrypt()
181 sub_bytes(state); in tc_aes_encrypt()
182 shift_rows(state); in tc_aes_encrypt()
183 add_round_key(state, s->words + Nb*(i+1)); in tc_aes_encrypt()
[all …]
/mcuboot-latest/boot/zephyr/
Dhooks_sample.c65 struct boot_swap_state *state) in boot_read_swap_state_primary_slot_hook() argument
68 state->magic = BOOT_MAGIC_UNSET; in boot_read_swap_state_primary_slot_hook()
69 state->swap_type = BOOT_SWAP_TYPE_NONE; in boot_read_swap_state_primary_slot_hook()
70 state->image_num = image_index ; // ? in boot_read_swap_state_primary_slot_hook()
71 state->copy_done = BOOT_FLAG_UNSET; in boot_read_swap_state_primary_slot_hook()
72 state->image_ok = BOOT_FLAG_UNSET; in boot_read_swap_state_primary_slot_hook()
Dflash_check.c19 bool swap_write_block_size_check(struct boot_loader_state *state) in swap_write_block_size_check() argument
30 state->imgs[0][BOOT_PRIMARY_SLOT].area->fa_dev); in swap_write_block_size_check()
40 state->imgs[0][BOOT_SECONDARY_SLOT].area->fa_dev); in swap_write_block_size_check()
Dsingle_loader.c66 static struct boot_swap_state state; in boot_image_validate_once() local
70 memset(&state, 0, sizeof(struct boot_swap_state)); in boot_image_validate_once()
71 rc = boot_read_swap_state(fa_p, &state); in boot_image_validate_once()
74 if (state.magic != BOOT_MAGIC_GOOD in boot_image_validate_once()
75 || state.image_ok != BOOT_FLAG_SET) { in boot_image_validate_once()
81 if (state.magic != BOOT_MAGIC_GOOD) { in boot_image_validate_once()
Dfirmware_loader.c70 static struct boot_swap_state state; in boot_image_validate_once() local
74 memset(&state, 0, sizeof(struct boot_swap_state)); in boot_image_validate_once()
75 rc = boot_read_swap_state(fa_p, &state); in boot_image_validate_once()
78 if (state.magic != BOOT_MAGIC_GOOD in boot_image_validate_once()
79 || state.image_ok != BOOT_FLAG_SET) { in boot_image_validate_once()
85 if (state.magic != BOOT_MAGIC_GOOD) { in boot_image_validate_once()
/mcuboot-latest/boot/mynewt/src/
Dsingle_loader.c66 static struct boot_swap_state state; in boot_image_validate_once() local
70 memset(&state, 0, sizeof(struct boot_swap_state)); in boot_image_validate_once()
71 rc = boot_read_swap_state(fa_p, &state); in boot_image_validate_once()
74 if (state.magic != BOOT_MAGIC_GOOD in boot_image_validate_once()
75 || state.image_ok != BOOT_FLAG_SET) { in boot_image_validate_once()
81 if (state.magic != BOOT_MAGIC_GOOD) { in boot_image_validate_once()
/mcuboot-latest/ext/tinycrypt/tests/
Dtest_cmac_mode.c260 struct tc_cmac_struct state; in main() local
271 (void) tc_cmac_setup(&state, key, &sched); in main()
272 result = verify_gf_2_128_double(K1, K2, state); in main()
278 (void) tc_cmac_setup(&state, key, &sched); in main()
279 result = verify_cmac_null_msg(&state); in main()
285 (void) tc_cmac_setup(&state, key, &sched); in main()
286 result = verify_cmac_1_block_msg(&state); in main()
292 (void) tc_cmac_setup(&state, key, &sched); in main()
293 result = verify_cmac_320_bit_msg(&state); in main()
299 (void) tc_cmac_setup(&state, key, &sched); in main()
[all …]
/mcuboot-latest/boot/boot_serial/src/
Dboot_serial_encryption.c30 struct boot_loader_state *state = &boot_data; in boot_image_validate_encrypted() local
37 image_index = BOOT_CURR_IMG(state); in boot_image_validate_encrypted()
39 rc = boot_enc_load(BOOT_CURR_ENC(state), 1, hdr, fa_p, bs); in boot_image_validate_encrypted()
43 rc = boot_enc_set_key(BOOT_CURR_ENC(state), 1, bs); in boot_image_validate_encrypted()
48 FIH_CALL(bootutil_img_validate, fih_rc, BOOT_CURR_ENC(state), image_index, in boot_image_validate_encrypted()
116 decrypt_region_inplace(struct boot_loader_state *state, in decrypt_region_inplace() argument
128 int slot = flash_area_id_to_multi_image_slot(BOOT_CURR_IMG(state), in decrypt_region_inplace()
174 boot_enc_decrypt(BOOT_CURR_ENC(state), slot, in decrypt_region_inplace()
214 struct boot_loader_state *state = &boot_data; in decrypt_image_inplace() local
241 rc = boot_enc_load(BOOT_CURR_ENC(state), 0, hdr, fa_p, bs); in decrypt_image_inplace()
[all …]
/mcuboot-latest/boot/bootutil/include/bootutil/
Dbootutil.h90 void boot_state_clear(struct boot_loader_state *state);
91 fih_ret context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp);
Dboot_public_hooks.h50 struct boot_swap_state *state);

12