/mcuboot-latest/boot/zcbor/include/ |
D | zcbor_decode.h | 71 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 …]
|
D | zcbor_encode.h | 67 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 …]
|
D | zcbor_common.h | 195 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 …]
|
D | zcbor_print.h | 28 #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/ |
D | zcbor_decode.c | 40 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 …]
|
D | zcbor_encode.c | 48 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 …]
|
D | zcbor_common.c | 25 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/ |
D | loader.c | 114 #define BOOT_COPY_REGION(state, fap_pri, fap_sec, pri_off, sec_off, sz, sector_off) \ argument 115 boot_copy_region(state, fap_pri, fap_sec, pri_off, sec_off, sz, sector_off) 117 #define BOOT_COPY_REGION(state, fap_pri, fap_sec, pri_off, sec_off, sz, sector_off) \ argument 118 boot_copy_region(state, fap_pri, fap_sec, pri_off, sec_off, sz) 127 boot_read_image_headers(struct boot_loader_state *state, bool require_all, in boot_read_image_headers() argument 135 BOOT_CURR_IMG(state), i, boot_img_hdr(state, i)); in boot_read_image_headers() 138 rc = boot_read_image_header(state, i, boot_img_hdr(state, i), bs); in boot_read_image_headers() 167 boot_add_shared_data(struct boot_loader_state *state, in boot_add_shared_data() argument 174 rc = boot_save_boot_status(BOOT_CURR_IMG(state), in boot_add_shared_data() 175 boot_img_hdr(state, active_slot), in boot_add_shared_data() [all …]
|
D | ram_load.c | 61 boot_verify_ram_load_address(struct boot_loader_state *state) in boot_verify_ram_load_address() argument 69 (void)state; in boot_verify_ram_load_address() 74 rc = boot_get_image_exec_ram_info(BOOT_CURR_IMG(state), &exec_ram_start, in boot_verify_ram_load_address() 84 img_dst = state->slot_usage[BOOT_CURR_IMG(state)].img_dst; in boot_verify_ram_load_address() 85 img_sz = state->slot_usage[BOOT_CURR_IMG(state)].img_sz; in boot_verify_ram_load_address() 117 boot_decrypt_and_copy_image_to_sram(struct boot_loader_state *state, in boot_decrypt_and_copy_image_to_sram() argument 142 area_id = flash_area_id_from_multi_image_slot(BOOT_CURR_IMG(state), slot); in boot_decrypt_and_copy_image_to_sram() 156 rc = boot_enc_load(state, slot, hdr, fap_src, &bs); in boot_decrypt_and_copy_image_to_sram() 162 if (rc == 0 && boot_enc_set_key(BOOT_CURR_ENC(state), slot, &bs)) { in boot_decrypt_and_copy_image_to_sram() 183 boot_enc_decrypt(BOOT_CURR_ENC(state), slot, in boot_decrypt_and_copy_image_to_sram() [all …]
|
D | swap_offset.c | 52 #define BOOT_COPY_REGION(state, fap_pri, fap_sec, pri_off, sec_off, sz, sector_off) \ argument 53 boot_copy_region(state, fap_pri, fap_sec, pri_off, sec_off, sz, sector_off) 55 #define BOOT_COPY_REGION(state, fap_pri, fap_sec, pri_off, sec_off, sz, sector_off) \ argument 56 boot_copy_region(state, fap_pri, fap_sec, pri_off, sec_off, sz) 59 uint32_t find_last_idx(struct boot_loader_state *state, uint32_t swap_size) in find_last_idx() argument 65 sector_sz = boot_img_sector_size(state, BOOT_PRIMARY_SLOT, 0); in find_last_idx() 80 int boot_read_image_header(struct boot_loader_state *state, int slot, argument 93 (void)state; 97 area_id = flash_area_id_from_multi_image_slot(BOOT_CURR_IMG(state), slot); 100 boot_swap_type_multi(BOOT_CURR_IMG(state)) != BOOT_SWAP_TYPE_REVERT) { [all …]
|
D | swap_priv.h | 30 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 …]
|
D | swap_move.c | 51 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 …]
|
D | swap_scratch.c | 58 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 …]
|
D | bootutil_priv.h | 96 uint8_t state; /* Which part of the swapping process are we at */ member 307 struct boot_swap_state *state); 309 struct boot_swap_state *state); 311 int boot_write_status(const struct boot_loader_state *state, struct boot_status *bs); 322 int boot_slots_compatible(struct boot_loader_state *state); 324 int boot_read_image_header(struct boot_loader_state *state, int slot, 327 int boot_copy_region(struct boot_loader_state *state, 332 int boot_copy_region(struct boot_loader_state *state, 398 #define BOOT_CURR_IMG(state) ((state)->curr_img_idx) argument 400 #define BOOT_CURR_IMG(state) 0 argument [all …]
|
D | swap_misc.c | 35 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 …]
|
D | image_validate.c | 68 bootutil_img_hash(struct boot_loader_state *state, in bootutil_img_hash() argument 97 (void)state; in bootutil_img_hash() 112 if (state == NULL) { in bootutil_img_hash() 116 enc_state = BOOT_CURR_ENC(state); in bootutil_img_hash() 117 image_index = BOOT_CURR_IMG(state); in bootutil_img_hash() 132 sector_off = boot_get_state_secondary_offset(state, fap) + start_offset; in bootutil_img_hash() 134 sector_off = boot_get_state_secondary_offset(state, fap); in bootutil_img_hash() 353 bootutil_get_img_security_cnt(struct boot_loader_state *state, int slot, in bootutil_get_img_security_cnt() argument 362 if ((state == NULL) || in bootutil_get_img_security_cnt() 363 (boot_img_hdr(state, slot) == NULL) || in bootutil_get_img_security_cnt() [all …]
|
/mcuboot-latest/ext/tinycrypt/lib/source/ |
D | aes_decrypt.c | 131 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 …]
|
D | aes_encrypt.c | 160 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/ |
D | hooks_sample.c | 65 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()
|
D | single_loader.c | 74 static struct boot_swap_state state; in boot_image_validate_once() local 78 memset(&state, 0, sizeof(struct boot_swap_state)); in boot_image_validate_once() 79 rc = boot_read_swap_state(fa_p, &state); in boot_image_validate_once() 82 if (state.magic != BOOT_MAGIC_GOOD in boot_image_validate_once() 83 || state.image_ok != BOOT_FLAG_SET) { in boot_image_validate_once() 89 if (state.magic != BOOT_MAGIC_GOOD) { in boot_image_validate_once() 123 static struct boot_loader_state state; in boot_go() local 124 state.imgs[0][0].hdr = _hdr; in boot_go() 126 rc = boot_load_image_to_sram(&state); in boot_go() 135 boot_remove_image_from_sram(&state); in boot_go() [all …]
|
D | flash_check.c | 19 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()
|
D | firmware_loader.c | 70 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/boot_serial/src/ |
D | boot_serial_encryption.c | 34 struct boot_loader_state *state = &boot_data; in boot_image_validate_encrypted() local 42 rc = boot_enc_load(state, 1, hdr, fa_p, bs, start_off); in boot_image_validate_encrypted() 44 rc = boot_enc_load(state, 1, hdr, fa_p, bs); in boot_image_validate_encrypted() 49 rc = boot_enc_set_key(BOOT_CURR_ENC(state), 1, bs); in boot_image_validate_encrypted() 56 FIH_CALL(bootutil_img_validate, fih_rc, state, in boot_image_validate_encrypted() 59 FIH_CALL(bootutil_img_validate, fih_rc, state, in boot_image_validate_encrypted() 128 decrypt_region_inplace(struct boot_loader_state *state, in decrypt_region_inplace() argument 140 int slot = flash_area_id_to_multi_image_slot(BOOT_CURR_IMG(state), in decrypt_region_inplace() 186 boot_enc_decrypt(BOOT_CURR_ENC(state), slot, in decrypt_region_inplace() 226 struct boot_loader_state *state = &boot_data; in decrypt_image_inplace() local [all …]
|
/mcuboot-latest/boot/mynewt/src/ |
D | single_loader.c | 66 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/ |
D | test_cmac_mode.c | 260 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 …]
|