/mcuboot-3.4.0/boot/zephyr/ |
D | arm_cleanup.c | 20 for (uint8_t i = 0; i < ARRAY_SIZE(NVIC->ICER); i++) { in cleanup_arm_nvic() local 21 NVIC->ICER[i] = 0xFFFFFFFF; in cleanup_arm_nvic() 24 for (uint8_t i = 0; i < ARRAY_SIZE(NVIC->ICPR); i++) { in cleanup_arm_nvic() local 25 NVIC->ICPR[i] = 0xFFFFFFFF; in cleanup_arm_nvic() 32 int i; in z_arm_clear_arm_mpu_config() local 37 for (i = 0; i < num_regions; i++) { in z_arm_clear_arm_mpu_config() 38 ARM_MPU_ClrRegion(i); in z_arm_clear_arm_mpu_config() 44 int i; in z_arm_clear_arm_mpu_config() local 51 for (i = 1; i < num_regions; i++) { in z_arm_clear_arm_mpu_config() 52 SYSMPU_RegionEnable(SYSMPU, i, false); in z_arm_clear_arm_mpu_config()
|
/mcuboot-3.4.0/boot/zcbor/include/ |
D | zcbor_debug.h | 40 for (uint32_t i = 0; i <= size / 16; i++) { in zcbor_print_compare_strings() local 41 printk("line %d (char %d)\r\n", i, i*16); in zcbor_print_compare_strings() 42 zcbor_print_compare_lines(&str1[i*16], &str2[i*16], in zcbor_print_compare_strings() 43 MIN(16, (size - i*16))); in zcbor_print_compare_strings() 52 for (uint32_t i = 0; i <= size / 16; i++) { in zcbor_print_compare_strings_diff() local 53 if (memcmp(&str1[i*16], &str2[i*16], MIN(16, (size - i*16)) != 0)) { in zcbor_print_compare_strings_diff() 54 printk("line %d (char %d)\r\n", i, i*16); in zcbor_print_compare_strings_diff() 55 zcbor_print_compare_lines(&str1[i*16], &str2[i*16], in zcbor_print_compare_strings_diff() 56 MIN(16, (size - i*16))); in zcbor_print_compare_strings_diff()
|
/mcuboot-3.4.0/ext/tinycrypt/lib/source/ |
D | ccm_mode.c | 68 unsigned int i; in ccm_cbc_mac() local 73 dlen += 2; i = 2; in ccm_cbc_mac() 75 i = 0; in ccm_cbc_mac() 78 while (i < dlen) { in ccm_cbc_mac() 79 T[i++ % (Nb * Nk)] ^= *data++; in ccm_cbc_mac() 80 if (((i % (Nb * Nk)) == 0) || dlen == i) { in ccm_cbc_mac() 100 unsigned int i; in ccm_ctr_mode() local 118 for (i = 0; i < inlen; ++i) { in ccm_ctr_mode() 119 if ((i % (TC_AES_BLOCK_SIZE)) == 0) { in ccm_ctr_mode() 128 *out++ = buffer[i % (TC_AES_BLOCK_SIZE)] ^ *in++; in ccm_ctr_mode() [all …]
|
D | aes_encrypt.c | 76 unsigned int i; in tc_aes128_set_encrypt_key() local 85 for (i = 0; i < Nk; ++i) { in tc_aes128_set_encrypt_key() 86 s->words[i] = (k[Nb*i]<<24) | (k[Nb*i+1]<<16) | in tc_aes128_set_encrypt_key() 87 (k[Nb*i+2]<<8) | (k[Nb*i+3]); in tc_aes128_set_encrypt_key() 90 for (; i < (Nb * (Nr + 1)); ++i) { in tc_aes128_set_encrypt_key() 91 t = s->words[i-1]; in tc_aes128_set_encrypt_key() 92 if ((i % Nk) == 0) { in tc_aes128_set_encrypt_key() 93 t = subword(rotword(t)) ^ rconst[i/Nk]; in tc_aes128_set_encrypt_key() 95 s->words[i] = s->words[i-Nk] ^ t; in tc_aes128_set_encrypt_key() 115 unsigned int i; in sub_bytes() local [all …]
|
D | ctr_prng.c | 55 unsigned int i; in arrInc() local 57 for (i = len; i > 0U; i--) { in arrInc() 58 if (++arr[i-1] != 0U) { in arrInc() 103 unsigned int i; in tc_ctr_prng_update() local 104 for (i = 0U; i < sizeof temp; i++) { in tc_ctr_prng_update() 105 temp[i] ^= providedData[i]; in tc_ctr_prng_update() 124 unsigned int i; in tc_ctr_prng_init() local 143 for (i = 0U; i < sizeof seed_material; i++) { in tc_ctr_prng_init() 144 seed_material[i] ^= personalization_buf[i]; in tc_ctr_prng_init() 170 unsigned int i; in tc_ctr_prng_reseed() local [all …]
|
D | cmac_mode.c | 159 unsigned int i; in tc_cmac_update() local 197 for (i = 0; i < TC_AES_BLOCK_SIZE; ++i) { in tc_cmac_update() 198 s->iv[i] ^= s->leftover[i]; in tc_cmac_update() 205 for (i = 0; i < TC_AES_BLOCK_SIZE; ++i) { in tc_cmac_update() 206 s->iv[i] ^= data[i]; in tc_cmac_update() 225 unsigned int i; in tc_cmac_final() local 244 for (i = 0; i < TC_AES_BLOCK_SIZE; ++i) { in tc_cmac_final() 245 s->iv[i] ^= s->leftover[i] ^ k[i]; in tc_cmac_final()
|
D | hmac.c | 41 unsigned int i; in rekey() local 43 for (i = 0; i < key_size; ++i) { in rekey() 44 key[i] = inner_pad ^ new_key[i]; in rekey() 45 key[i + TC_SHA256_BLOCK_SIZE] = outer_pad ^ new_key[i]; in rekey() 47 for (; i < TC_SHA256_BLOCK_SIZE; ++i) { in rekey() 48 key[i] = inner_pad; key[i + TC_SHA256_BLOCK_SIZE] = outer_pad; in rekey()
|
D | ecc.c | 89 wordcount_t i; in uECC_vli_clear() local 90 for (i = 0; i < num_words; ++i) { in uECC_vli_clear() 91 vli[i] = 0; in uECC_vli_clear() 98 wordcount_t i; in uECC_vli_isZero() local 99 for (i = 0; i < num_words; ++i) { in uECC_vli_isZero() 100 bits |= vli[i]; in uECC_vli_isZero() 116 wordcount_t i; in vli_numDigits() local 119 for (i = max_words - 1; i >= 0 && vli[i] == 0; --i) { in vli_numDigits() 122 return (i + 1); in vli_numDigits() 129 uECC_word_t i; in uECC_vli_numBits() local [all …]
|
D | utils.c | 70 for (unsigned int i = 0; i < size; i++) { in _compare() local 71 result |= tempa[i] ^ tempb[i]; in _compare()
|
/mcuboot-3.4.0/ext/tinycrypt/tests/ |
D | test_ctr_prng.c | 61 int len, i; in hexStringToBytes() local 65 for(i=0, p = (uint8_t *) inhex; i<len; i++) { in hexStringToBytes() 66 retval[i] = (nibbleFromChar(*p) << 4) | nibbleFromChar(*(p+1)); in hexStringToBytes() 272 unsigned int i; in executePRNG_TestVector() local 295 for (i = 0U; i < expectedlen; i++) { in executePRNG_TestVector() 296 if (output[i] != expected[i]) { in executePRNG_TestVector() 321 unsigned int i; in test_reseed() local 359 for (i = 0U; i < sizeof entropy; i++) { in test_reseed() 360 entropy[i] = i; in test_reseed() 371 for (i = 0U; i < sizeof expectedV; i++) { in test_reseed() [all …]
|
D | test_ecc_utils.c | 109 for (size_t i = 0; i < hexlen / 2; i++) in hex2bin() local 111 dec = hex2int(hex[2 * i]); in hex2bin() 116 buf[i] = dec << 4; in hex2bin() 118 dec = hex2int(hex[ 2 * i + 1]); in hex2bin() 123 buf[i] += dec; in hex2bin() 159 for(unsigned i = 0; i < size; ++i) in vli_print_bytes() local 161 printf("%02X ", (unsigned)vli[i]); in vli_print_bytes() 168 unsigned int i; in print_ecc_scalar() local 174 for(i = 0; i < num_word32 - 1; ++i) { in print_ecc_scalar() 175 printf("0x%08lX, ", (unsigned long)p_vli[i]); in print_ecc_scalar() [all …]
|
D | test_hmac_prng.c | 56 unsigned int i; in show() local 58 for (i = 0; i < (unsigned int) len; ++i) { in show() 59 printf ("%02x", s[i]); in show() 81 unsigned int i; in main() local 88 for (i = 0; i < (unsigned int) sizeof(seed); ++i) { in main() 89 seed[i] = i; in main()
|
D | test_ecc_dsa.c | 97 for (int i = 0; i < tests; i++) { in sign_vectors() local 100 keygen_vectors(d_vec+i, qx_vec+i, qy_vec+i, 1, false); in sign_vectors() 101 string2scalar(private, NUM_ECC_WORDS, d_vec[i]); in sign_vectors() 106 string2scalar(k, NUM_ECC_WORDS, k_vec[i]); in sign_vectors() 107 string2scalar(exp_r, NUM_ECC_WORDS, r_vec[i]); in sign_vectors() 108 string2scalar(exp_s, NUM_ECC_WORDS, s_vec[i]); in sign_vectors() 110 msglen = hex2bin(msg, BUF_SIZE, msg_vec[i], strlen(msg_vec[i])); in sign_vectors() 143 result = check_ecc_result(i, "sig.r", exp_r, sig, NUM_ECC_WORDS, verbose); in sign_vectors() 147 result = check_ecc_result(i, "sig.s", exp_s, sig + NUM_ECC_WORDS, NUM_ECC_WORDS, verbose); in sign_vectors() 363 for (int i = 0; i < tests; i++) { in vrfy_vectors() local [all …]
|
D | test_ecc_dh.c | 85 for (int i = 0; i < tests; i++) { in ecdh_vectors() local 87 string2scalar(pub + NUM_ECC_WORDS, NUM_ECC_WORDS, qx_vec[i]); in ecdh_vectors() 88 string2scalar(pub, NUM_ECC_WORDS, qy_vec[i]); in ecdh_vectors() 89 string2scalar(exp_z, NUM_ECC_WORDS, z_vec[i]); in ecdh_vectors() 90 string2scalar(prv, NUM_ECC_WORDS, d_vec[i]); in ecdh_vectors() 109 result = check_ecc_result(i, "Z", exp_z, z, NUM_ECC_WORDS, verbose); in ecdh_vectors() 319 for (int i = 0; i < tests; i++) { in pkv_vectors() local 321 if (2 != sscanf(res_vec[i], "%c (%d ", &tmp, &exp_rc)) { in pkv_vectors() 327 if (strlen(qx_vec[i]) > 2 * NUM_ECC_BYTES || in pkv_vectors() 328 strlen(qy_vec[i]) > 2 * NUM_ECC_BYTES) { in pkv_vectors() [all …]
|
D | test_aes.c | 1080 unsigned int i; in test_3() local 1086 for (i = 0; i < 128; ++i) { in test_3() 1087 result = var_text_test(i, kat_tbl[i].in, kat_tbl[i].out, &s); in test_3() 2022 unsigned int i; in test_4() local 2026 for (i = 0; i < NUM_OF_FIXED_KEYS; ++i) { in test_4() 2027 result = var_key_test(i, kat_tbl[i].in, kat_tbl[i].out); in test_4()
|
/mcuboot-3.4.0/boot/espressif/hal/src/ |
D | secure_boot.c | 89 for (unsigned i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) { in s_calculate_image_public_key_digests() local 90 const ets_secure_boot_sig_block_t *block = &signatures->block[i]; in s_calculate_image_public_key_digests() 92 ret = validate_signature_block(block, i, image_digest); in s_calculate_image_public_key_digests() 113 ESP_LOGE(TAG, "Secure boot key (%d) verification failed.", i); in s_calculate_image_public_key_digests() 116 ESP_LOGD(TAG, "Signature block (%d) is verified", i); in s_calculate_image_public_key_digests() 118 memcpy((void *)public_key_digests->key_digests[i], key_digest, ESP_SECURE_BOOT_DIGEST_LEN); in s_calculate_image_public_key_digests() 163 for (unsigned i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) { in check_and_generate_secure_boot_keys() local 164 bool tmp_has_key = esp_efuse_find_purpose(secure_boot_key_purpose[i], &blocks[i]); in check_and_generate_secure_boot_keys() 166 tmp_has_key &= !esp_efuse_key_block_unused(blocks[i]); in check_and_generate_secure_boot_keys() 199 for (unsigned i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) { in check_and_generate_secure_boot_keys() local [all …]
|
D | flash_encrypt.c | 110 for (unsigned i = 0; i < BLOCKS_NEEDED; i++) { in check_and_generate_encryption_keys() local 111 bool tmp_has_key = esp_efuse_find_purpose(purposes[i], &blocks[i]); in check_and_generate_encryption_keys() 113 tmp_has_key &= !esp_efuse_key_block_unused(blocks[i]); in check_and_generate_encryption_keys() 115 if (i == 1 && tmp_has_key != has_key) { in check_and_generate_encryption_keys() 126 for (unsigned i = 0; i < BLOCKS_NEEDED; ++i) { in check_and_generate_encryption_keys() local 127 bootloader_fill_random(keys[i], key_size); in check_and_generate_encryption_keys() 141 for (unsigned i = 0; i < BLOCKS_NEEDED; i++) { in check_and_generate_encryption_keys() local 142 if (!esp_efuse_get_key_dis_write(blocks[i]) in check_and_generate_encryption_keys() 143 || !esp_efuse_get_key_dis_read(blocks[i]) in check_and_generate_encryption_keys() 144 …|| !esp_efuse_get_keypurpose_dis_write(blocks[i])) { // For ESP32: no keypurpose, it returns alway… in check_and_generate_encryption_keys() [all …]
|
/mcuboot-3.4.0/sim/mcuboot-sys/csupport/ |
D | run.c | 119 size_t i; in fake_rng() local 122 for (i = 0; i < len; i++) { in fake_rng() 123 output[i] = (char)i; in fake_rng() 311 uint32_t i; in flash_area_open() local 315 for (i = 0; i < flash_areas->num_slots; i++) { in flash_area_open() 316 if (flash_areas->slots[i].id == id) in flash_area_open() 319 if (i == flash_areas->num_slots) { in flash_area_open() 325 *area = &flash_areas->slots[i].whole; in flash_area_open() 372 uint32_t i; in flash_area_to_sectors() local 377 for (i = 0; i < flash_areas->num_slots; i++) { in flash_area_to_sectors() [all …]
|
/mcuboot-3.4.0/boot/zcbor/src/ |
D | zcbor_common.c | 39 uint_fast32_t i = (state->constant_state->current_backup) - 1; in zcbor_new_backup() local 41 memcpy(&state->constant_state->backup_list[i], state, in zcbor_new_backup() 66 uint_fast32_t i = state->constant_state->current_backup - 1; in zcbor_process_backup() local 69 if (state->constant_state->backup_list[i].payload_moved) { in zcbor_process_backup() 74 memcpy(state, &state->constant_state->backup_list[i], in zcbor_process_backup() 98 for (int i = 0; i < state->constant_state->current_backup; i++) { in update_backups() local 99 state->constant_state->backup_list[i].payload_end = new_payload_end; in update_backups() 100 state->constant_state->backup_list[i].payload_moved = true; in update_backups() 178 for (uint_fast32_t i = 0; i < num_fragments; i++) { in zcbor_validate_string_fragments() local 179 if (fragments[i].offset != total_len) { in zcbor_validate_string_fragments() [all …]
|
/mcuboot-3.4.0/testplan/mynewt/apps/slinky/src/ |
D | random_data.c | 21347 int i; in read_random_data() local 21349 for (value = 0, i = 0; i < random_bin_len; i++) { in read_random_data() 21350 value += random_bin[i]; in read_random_data()
|
/mcuboot-3.4.0/boot/bootutil/include/bootutil/crypto/ |
D | aes_kw.h | 100 int8_t i, j, k; in bootutil_aes_kw_unwrap() local 113 for (i = 2; i > 0; i--) { in bootutil_aes_kw_unwrap() 116 B[8 + k] = key[((i-1) * 8) + k]; in bootutil_aes_kw_unwrap() 118 B[7] ^= 2 * j + i; in bootutil_aes_kw_unwrap() 124 key[((i-1) * 8) + k] = B[8 + k]; in bootutil_aes_kw_unwrap() 129 for (i = 0, k = 0; i < 8; i++) { in bootutil_aes_kw_unwrap() 130 k |= A[i] ^ 0xa6; in bootutil_aes_kw_unwrap()
|
/mcuboot-3.4.0/boot/bootutil/src/ |
D | bootutil_misc.c | 74 size_t i; in boot_fih_memequal() local 79 for (i = 0; i < n; i++) { in boot_fih_memequal() 80 if (s1_p[i] != s2_p[i]) { in boot_fih_memequal() 84 if (i == n) { in boot_fih_memequal() 219 unsigned int i; in boot_find_status() local 229 for (i = 0; i < sizeof(areas) / sizeof(areas[0]); i++) { in boot_find_status() 232 if (flash_area_open(areas[i], fap)) { in boot_find_status() 271 int i; in boot_read_enc_key() local 279 for (i = 0; i < BOOT_ENC_TLV_ALIGN_SIZE; i++) { in boot_read_enc_key() 280 if (bs->enctlv[slot][i] != 0xff) { in boot_read_enc_key() [all …]
|
/mcuboot-3.4.0/ext/fiat/src/ |
D | curve25519.c | 246 int i; in fe_loose_invert() local 250 for (i = 1; i < 2; ++i) { in fe_loose_invert() 258 for (i = 1; i < 5; ++i) { in fe_loose_invert() 263 for (i = 1; i < 10; ++i) { in fe_loose_invert() 268 for (i = 1; i < 20; ++i) { in fe_loose_invert() 273 for (i = 1; i < 10; ++i) { in fe_loose_invert() 278 for (i = 1; i < 50; ++i) { in fe_loose_invert() 283 for (i = 1; i < 100; ++i) { in fe_loose_invert() 288 for (i = 1; i < 50; ++i) { in fe_loose_invert() 293 for (i = 1; i < 5; ++i) { in fe_loose_invert() [all …]
|
/mcuboot-3.4.0/boot/cypress/libs/watchdog/ |
D | watchdog.c | 85 for (uint32_t i = 0; i <= _cy_wdg_MAX_IGNORE_BITS; i++) in _cy_wdg_timeout_to_ignore_bits() local 87 if (*timeout_ms >= _cy_wdg_ignore_data[i].round_threshold_ms) in _cy_wdg_timeout_to_ignore_bits() 89 if (*timeout_ms < _cy_wdg_ignore_data[i].min_period_ms) in _cy_wdg_timeout_to_ignore_bits() 90 *timeout_ms = _cy_wdg_ignore_data[i].min_period_ms; in _cy_wdg_timeout_to_ignore_bits() 91 return i; in _cy_wdg_timeout_to_ignore_bits()
|
/mcuboot-3.4.0/boot/cypress/cy_flash_pal/ |
D | cy_flash_map.c | 202 uint32_t i = 0; in flash_area_open() local 204 while(NULL != boot_area_descs[i]) in flash_area_open() 206 if(id == boot_area_descs[i]->fa_id) in flash_area_open() 208 *fa = boot_area_descs[i]; in flash_area_open() 212 i++; in flash_area_open() 291 for (uint32_t i = 0; i < row_number; i++) in flash_area_write() local 475 for (uint8_t i = 0; i < len; i++) { in flash_area_read_is_empty() local 476 if (mem_dest[i] != flash_area_erased_val(fa)) { in flash_area_read_is_empty() 487 uint32_t i = 0; in flash_area_get_sectors() local 490 while(NULL != boot_area_descs[i]) in flash_area_get_sectors() [all …]
|