Lines Matching refs:bytes_copied
133 uint32_t bytes_copied; in decrypt_region_inplace() local
146 bytes_copied = 0; in decrypt_region_inplace()
147 while (bytes_copied < sz) { in decrypt_region_inplace()
148 if (sz - bytes_copied > sizeof buf) { in decrypt_region_inplace()
151 chunk_sz = sz - bytes_copied; in decrypt_region_inplace()
154 rc = flash_area_read(fap, off + bytes_copied, buf, chunk_sz); in decrypt_region_inplace()
162 if (off + bytes_copied < hdr->ih_hdr_size) { in decrypt_region_inplace()
164 if (hdr->ih_hdr_size > (off + bytes_copied + chunk_sz)) { in decrypt_region_inplace()
169 blk_sz = off + bytes_copied + chunk_sz - hdr->ih_hdr_size; in decrypt_region_inplace()
175 blk_off = ((off + bytes_copied) - hdr->ih_hdr_size) & 0xf; in decrypt_region_inplace()
178 if (off + bytes_copied + chunk_sz > tlv_off) { in decrypt_region_inplace()
180 if (off + bytes_copied >= tlv_off) { in decrypt_region_inplace()
183 blk_sz = tlv_off - (off + bytes_copied); in decrypt_region_inplace()
187 (off + bytes_copied + idx) - hdr->ih_hdr_size, blk_sz, in decrypt_region_inplace()
190 rc = flash_area_erase(fap, off + bytes_copied, chunk_sz); in decrypt_region_inplace()
194 rc = flash_area_write(fap, off + bytes_copied, buf, chunk_sz); in decrypt_region_inplace()
199 bytes_copied += chunk_sz; in decrypt_region_inplace()