/mcuboot-latest/ext/mbedtls-asn1/src/ |
D | asn1parse.c | 47 size_t *len ) in mbedtls_asn1_get_len() argument 53 *len = *(*p)++; in mbedtls_asn1_get_len() 62 *len = (*p)[1]; in mbedtls_asn1_get_len() 70 *len = ( (size_t)(*p)[1] << 8 ) | (*p)[2]; in mbedtls_asn1_get_len() 78 *len = ( (size_t)(*p)[1] << 16 ) | in mbedtls_asn1_get_len() 87 *len = ( (size_t)(*p)[1] << 24 ) | ( (size_t)(*p)[2] << 16 ) | in mbedtls_asn1_get_len() 97 if( *len > (size_t) ( end - *p ) ) in mbedtls_asn1_get_len() 105 size_t *len, int tag ) in mbedtls_asn1_get_tag() argument 115 return( mbedtls_asn1_get_len( p, end, len ) ); in mbedtls_asn1_get_tag() 123 size_t len; in mbedtls_asn1_get_bool() local [all …]
|
D | platform_util.c | 67 void mbedtls_platform_zeroize( void *buf, size_t len ) in mbedtls_platform_zeroize() argument 69 MBEDTLS_INTERNAL_VALIDATE( len == 0 || buf != NULL ); in mbedtls_platform_zeroize() 71 if( len > 0 ) in mbedtls_platform_zeroize() 72 memset_func( buf, 0, len ); in mbedtls_platform_zeroize()
|
/mcuboot-latest/ext/tinycrypt/lib/source/ |
D | ctr_prng.c | 53 static void arrInc(uint8_t arr[], unsigned int len) in arrInc() argument 57 for (i = len; i > 0U; i--) { in arrInc() 79 unsigned int len = 0U; in tc_ctr_prng_update() local 82 while (len < sizeof temp) { in tc_ctr_prng_update() 83 unsigned int blocklen = sizeof(temp) - len; in tc_ctr_prng_update() 96 memcpy(&(temp[len]), output_block, blocklen); in tc_ctr_prng_update() 98 len += blocklen; in tc_ctr_prng_update() 131 unsigned int len = pLen; in tc_ctr_prng_init() local 132 if (len > sizeof personalization_buf) { in tc_ctr_prng_init() 133 len = sizeof personalization_buf; in tc_ctr_prng_init() [all …]
|
/mcuboot-latest/boot/boot_serial/test/src/testcases/ |
D | boot_serial_upload_bigger_image.c | 30 int len; in TEST_CASE() local 91 len = sizeof payload_next; in TEST_CASE() 92 buf[payload_off + len - 2] = ZCBOR_VALUE_IS_1_BYTE; in TEST_CASE() 93 buf[payload_off + len - 1] = off; in TEST_CASE() 96 len = sizeof payload_first; in TEST_CASE() 99 hdr->nh_len = htons(len); in TEST_CASE() 101 len = sizeof(*hdr) + len; in TEST_CASE() 103 tx_msg(buf, len); in TEST_CASE()
|
D | boot_serial_img_msg.c | 27 int len; in TEST_CASE() local 58 len = sizeof(*hdr) + sizeof payload; in TEST_CASE() 59 tx_msg(buf, len); in TEST_CASE()
|
/mcuboot-latest/boot/cypress/MCUBootApp/ |
D | keys.c | 124 .len = &rsa_pub_key_len, 129 .len = &ecdsa_pub_key_len, 134 .len = 0x00, 145 .len = &pub_key_len, 168 .len = &enc_priv_key_len,
|
/mcuboot-latest/boot/bootutil/src/ |
D | image_ed25519.c | 35 size_t len; in bootutil_import_key() local 39 if (mbedtls_asn1_get_tag(cp, end, &len, in bootutil_import_key() 43 end = *cp + len; in bootutil_import_key() 49 if (alg.ASN1_CONTEXT_MEMBER(len) != sizeof(ed25519_pubkey_oid) - 1 || in bootutil_import_key() 54 if (mbedtls_asn1_get_bitstring_null(cp, end, &len)) { in bootutil_import_key() 57 if (*cp + len != end) { in bootutil_import_key() 61 if (len != NUM_ED25519_BYTES) { in bootutil_import_key() 83 end = pubkey + *bootutil_keys[key_id].len; in bootutil_verify_sig()
|
D | encrypted.c | 76 rc = bootutil_aes_kw_set_unwrap_key(&aes_kw, bootutil_enc_key->key, *bootutil_enc_key->len); in key_unwrap() 106 size_t len; in parse_ec256_enckey() local 111 if ((rc = mbedtls_asn1_get_tag(p, end, &len, in parse_ec256_enckey() 116 if (*p + len != end) { in parse_ec256_enckey() 129 if (alg.ASN1_CONTEXT_MEMBER(len) != sizeof(ec_pubkey_oid) - 1 || in parse_ec256_enckey() 133 if (param.ASN1_CONTEXT_MEMBER(len) != sizeof(ec_secp256r1_oid) - 1 || in parse_ec256_enckey() 138 if ((rc = mbedtls_asn1_get_tag(p, end, &len, MBEDTLS_ASN1_OCTET_STRING)) != 0) { in parse_ec256_enckey() 144 if ((rc = mbedtls_asn1_get_tag(p, end, &len, in parse_ec256_enckey() 156 if ((rc = mbedtls_asn1_get_tag(p, end, &len, MBEDTLS_ASN1_OCTET_STRING)) != 0) { in parse_ec256_enckey() 160 if (len != NUM_ECC_BYTES) { in parse_ec256_enckey() [all …]
|
D | image_validate.c | 244 bootutil_sha_update(&sha_ctx, key->key, *key->len); in bootutil_find_key() 312 uint16_t len; in bootutil_get_img_security_cnt() local 336 rc = bootutil_tlv_iter_next(&it, &off, &len, NULL); in bootutil_get_img_security_cnt() 342 if (len != sizeof(*img_security_cnt)) { in bootutil_get_img_security_cnt() 347 rc = LOAD_IMAGE_DATA(hdr, fap, off, img_security_cnt, len); in bootutil_get_img_security_cnt() 391 uint16_t len; in bootutil_img_validate() local 444 rc = bootutil_tlv_iter_next(&it, &off, &len, &type); in bootutil_img_validate() 474 if (len != sizeof(hash)) { in bootutil_img_validate() 495 if (len > KEY_BUF_SIZE) { in bootutil_img_validate() 500 rc = LOAD_IMAGE_DATA(hdr, fap, off, buf, len); in bootutil_img_validate() [all …]
|
/mcuboot-latest/boot/mbed/src/ |
D | flash_map_backend.cpp | 133 int flash_area_read(const struct flash_area* fap, uint32_t off, void* dst, uint32_t len) { in flash_area_read() argument 150 uint32_t remainder = len % read_size; in flash_area_read() 151 len -= remainder; in flash_area_read() 152 if (len != 0) { in flash_area_read() 154 if (!bd->is_valid_read(off, len)) { in flash_area_read() 156 (unsigned int) off, (unsigned int) len); in flash_area_read() 160 int ret = bd->read(dst, off, len); in flash_area_read() 163 (unsigned int) off, (unsigned int) len); in flash_area_read() 171 if (!bd->is_valid_read(off + len, read_size)) { in flash_area_read() 173 (unsigned int) (off + len), (unsigned int) read_size); in flash_area_read() [all …]
|
/mcuboot-latest/boot/zephyr/ |
D | keys.c | 56 .len = &rsa_pub_key_len, 59 .len = &ecdsa_pub_key_len, 62 .len = &ed25519_pub_key_len, 73 .len = &pub_key_len, 84 .len = &enc_priv_key_len,
|
D | serial_adapter.c | 53 int len; member 93 int len; in console_read() local 95 len = boot_uart_fifo_getline(&line); in console_read() 102 if (len > str_size - 1) { in console_read() 103 len = str_size - 1; in console_read() 106 memcpy(str, line, len); in console_read() 107 str[len] = '\0'; in console_read() 109 return len + 1; in console_read() 167 cmd->len = cur; in boot_uart_fifo_callback() 202 return cmd->len; in boot_uart_fifo_getline()
|
/mcuboot-latest/sim/mcuboot-sys/src/ |
D | area.rs | 38 pub fn add_image(&mut self, base: usize, len: usize, id: FlashId, dev_id: u8) { in add_image() 41 let orig_len = len; in add_image() 43 let mut len = len; in add_image() localVariable 45 while nid > self.areas.len() { in add_image() 50 if nid != self.areas.len() { in add_image() 57 if len == 0 { in add_image() 76 len -= sector.size; in add_image() 79 if len != 0 { in add_image() 97 pub fn add_simple_image(&mut self, base: usize, len: usize, id: FlashId, dev_id: u8) { in add_simple_image() 103 size: len as u32, in add_simple_image() [all …]
|
/mcuboot-latest/sim/mcuboot-sys/csupport/ |
D | keys.c | 164 .len = &root_pub_der_len, 276 .len = &enc_key_len, 297 .len = &enc_key_len, 314 .len = &enc_key_len, 328 .len = &enc_key_len,
|
D | run.c | 62 size_t len; in parse_pubkey() local 64 if ((rc = mbedtls_asn1_get_tag(p, end, &len, in parse_pubkey() 69 if (*p + len != end) { in parse_pubkey() 73 if ((rc = mbedtls_asn1_get_tag(p, end, &len, in parse_pubkey() 78 *p += len; in parse_pubkey() 80 if ((rc = mbedtls_asn1_get_tag(p, end, &len, MBEDTLS_ASN1_BIT_STRING)) != 0) { in parse_pubkey() 90 if ((rc = mbedtls_asn1_get_tag(p, end, &len, in parse_pubkey() 103 ctx->MBEDTLS_CONTEXT_MEMBER(len) = mbedtls_mpi_size(&ctx->MBEDTLS_CONTEXT_MEMBER(N)); in parse_pubkey() 117 fake_rng(void *p_rng, unsigned char *output, size_t len) in fake_rng() argument 122 for (i = 0; i < len; i++) { in fake_rng() [all …]
|
/mcuboot-latest/boot/espressif/ |
D | keys.c | 35 .len = &rsa_pub_key_len, 38 .len = &ecdsa_pub_key_len, 41 .len = &ed25519_pub_key_len, 52 .len = &pub_key_len,
|
/mcuboot-latest/boot/bootutil/include/bootutil/crypto/ |
D | ecdsa.h | 90 size_t len; in bootutil_import_key() local 94 if (mbedtls_asn1_get_tag(cp, end, &len, in bootutil_import_key() 98 end = *cp + len; in bootutil_import_key() 105 if (alg.ASN1_CONTEXT_MEMBER(len) != sizeof(ec_pubkey_oid) - 1 || in bootutil_import_key() 110 if (param.ASN1_CONTEXT_MEMBER(len) != sizeof(ec_secp256r1_oid) - 1 || in bootutil_import_key() 115 if (mbedtls_asn1_get_bitstring_null(cp, end, &len)) { in bootutil_import_key() 118 if (*cp + len != end) { in bootutil_import_key() 122 if (len != 2 * NUM_ECC_BYTES + 1) { in bootutil_import_key() 138 size_t len; in bootutil_read_bigint() local 140 if (mbedtls_asn1_get_tag(cp, end, &len, MBEDTLS_ASN1_INTEGER)) { in bootutil_read_bigint() [all …]
|
/mcuboot-latest/ext/mbedtls-asn1/include/mbedtls/ |
D | asn1.h | 127 ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf)->len ) || \ 128 memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 ) 149 size_t MBEDTLS_PRIVATE(len); /**< ASN1 length, in octets. */ 159 size_t MBEDTLS_PRIVATE(len); /**< ASN1 length, in octets. */ 207 size_t *len ); 232 size_t *len, int tag ); 335 size_t *len ); 502 unsigned char* start, size_t len ), 579 const char *oid, size_t len );
|
/mcuboot-latest/sim/simflash/src/ |
D | lib.rs | 55 fn erase(&mut self, offset: usize, len: usize) -> Result<()>; in erase() 59 fn add_bad_region(&mut self, offset: usize, len: usize, rate: f32) -> Result<()>; in add_bad_region() 152 fn erase(&mut self, offset: usize, len: usize) -> Result<()> { in erase() 154 let (end, elen) = self.get_sector(offset + len - 1).ok_or_else(|| ebounds("end"))?; in erase() 163 for x in &mut self.data[offset .. offset + len] { in erase() 167 for x in &mut self.write_safe[offset .. offset + len] { in erase() 183 for &(off, len, rate) in &self.bad_region { in write() 184 if offset >= off && (offset + payload.len()) <= (off + len) { in write() 189 format!("Ignoring write to {:#x}-{:#x}", off, off + len))); in write() 194 if offset + payload.len() > self.data.len() { in write() [all …]
|
/mcuboot-latest/boot/mbed/ |
D | app_enc_keys.c | 46 .len = &rsa_pub_key_len, 49 .len = &ecdsa_pub_key_len, 52 .len = &ed25519_pub_key_len, 65 .len = &enc_priv_key_len,
|
/mcuboot-latest/boot/boot_serial/src/ |
D | boot_serial.c | 183 int len, zcbor_state_t *cs); 244 int len; in bs_list_img_ver() local 246 len = snprintf(dst, maxlen, "%hu.%hu.%hu", (uint16_t)ver->iv_major, in bs_list_img_ver() 249 if (ver->iv_build_num != 0 && len > 0 && len < maxlen) { in bs_list_img_ver() 250 snprintf(&dst[len], (maxlen - len), ".%u", ver->iv_build_num); in bs_list_img_ver() 259 bs_list(char *buf, int len) in bs_list() argument 432 bs_set(char *buf, int len) in bs_set() argument 454 zcbor_new_state(zsd, sizeof(zsd) / sizeof(zcbor_state_t), (uint8_t *)buf, len, 1, NULL, 0); in bs_set() 472 if ((img_hash.len != sizeof(hash) && img_hash.len != 0) || in bs_set() 473 (img_hash.len == 0 && BOOT_IMAGE_NUMBER > 1)) { in bs_set() [all …]
|
/mcuboot-latest/boot/cypress/cy_flash_pal/ |
D | cy_flash_map.c | 226 uint32_t len) in flash_area_read() argument 233 assert(off + len < fa->fa_off); in flash_area_read() 240 memcpy((void *)dst, (const void*)addr, (size_t)len); in flash_area_read() 245 rc = psoc6_smif_read(fa, addr, dst, len); in flash_area_read() 264 const void *src, uint32_t len) in flash_area_write() argument 272 assert(off + len < fa->fa_off); in flash_area_write() 276 write_end_addr = fa->fa_off + off + len; in flash_area_write() 283 assert(!(len % CY_FLASH_SIZEOF_ROW)); in flash_area_write() 302 rc = psoc6_smif_write(fa, write_start_addr, src, len); in flash_area_write() 315 int flash_area_erase(const struct flash_area *fa, uint32_t off, uint32_t len) in flash_area_erase() argument [all …]
|
D | cy_smif_psoc6.c | 77 size_t len) in psoc6_smif_read() argument 88 st = Cy_SMIF_MemRead(qspi_get_device(), cfg, address, data, len, qspi_get_context()); in psoc6_smif_read() 98 size_t len) in psoc6_smif_write() argument 109 st = Cy_SMIF_MemWrite(qspi_get_device(), cfg, address, data, len, qspi_get_context()); in psoc6_smif_write()
|
/mcuboot-latest/boot/boot_serial/test/src/ |
D | boot_test.c | 44 test_uart_write(const char *str, int len) in TEST_CASE_DECL() 53 tx_msg(void *src, int len) in tx_msg() argument 55 boot_serial_input(src, len); in tx_msg()
|
/mcuboot-latest/boot/espressif/port/ |
D | esp_mcuboot.c | 191 uint32_t len) in flash_area_read() argument 197 const uint32_t end_offset = off + len; in flash_area_read() 203 bool success = aligned_flash_read(fa->fa_off + off, dst, len); in flash_area_read() 273 uint32_t len) in flash_area_write() argument 279 const uint32_t end_offset = off + len; in flash_area_write() 286 BOOT_LOG_DBG("%s: Addr: 0x%08x Length: %d", __func__, (int)start_addr, (int)len); in flash_area_write() 288 bool success = aligned_flash_write(start_addr, src, len); in flash_area_write() 297 int flash_area_erase(const struct flash_area *fa, uint32_t off, uint32_t len) in flash_area_erase() argument 303 if ((len % FLASH_SECTOR_SIZE) != 0 || (off % FLASH_SECTOR_SIZE) != 0) { in flash_area_erase() 305 __func__, (int)off, (int)len); in flash_area_erase() [all …]
|