@@ -239,7 +239,7 @@ static int RAMFUNCTION nvm_select_fresh_sector(int part)
239239 sel = 0 ;
240240
241241 /* Select the sector with more flags set. Partition flag is at offset '4'.
242- * Sector flags begin from offset '5'.
242+ * Sector flags begin from offset '5'.
243243 */
244244 for (off = 4 ; off < WOLFBOOT_SECTOR_SIZE ; off ++ ) {
245245 volatile uint8_t byte_0 = get_base_offset (base , off );
@@ -1763,7 +1763,7 @@ int RAMFUNCTION ext_flash_decrypt_read(uintptr_t address, uint8_t *data, int len
17631763 int i ;
17641764 int flash_read_size ;
17651765 int read_remaining = len ;
1766- int unaligned_head_size , unaligned_tail_size ;
1766+ int unaligned_head_size , unaligned_trailer_size ;
17671767 uint8_t part ;
17681768 uintptr_t base_address ;
17691769
@@ -1815,8 +1815,8 @@ int RAMFUNCTION ext_flash_decrypt_read(uintptr_t address, uint8_t *data, int len
18151815 iv_counter ++ ;
18161816 }
18171817 /* Trim the read size to align with the Encryption Blocks. Read the
1818- * remaining unaligned tail bytes after, since the `data` buffer won't have
1819- * enough space to handle the extra bytes.
1818+ * remaining unaligned trailer bytes after, since the `data` buffer won't
1819+ * have enough space to handle the extra bytes.
18201820 */
18211821 flash_read_size = read_remaining & ~(ENCRYPT_BLOCK_SIZE - 1 );
18221822 if (ext_flash_read (address , data , flash_read_size ) != flash_read_size )
@@ -1833,17 +1833,17 @@ int RAMFUNCTION ext_flash_decrypt_read(uintptr_t address, uint8_t *data, int len
18331833 data += flash_read_size ;
18341834 read_remaining -= flash_read_size ;
18351835
1836- /* Read the unaligned tail bytes. */
1837- unaligned_tail_size = read_remaining ;
1838- if (unaligned_tail_size > 0 )
1836+ /* Read the unaligned trailer bytes. */
1837+ unaligned_trailer_size = read_remaining ;
1838+ if (unaligned_trailer_size > 0 )
18391839 {
18401840 uint8_t dec_block [ENCRYPT_BLOCK_SIZE ];
18411841 if (ext_flash_read (address , block , ENCRYPT_BLOCK_SIZE )
18421842 != ENCRYPT_BLOCK_SIZE )
18431843 return -1 ;
18441844 crypto_decrypt (dec_block , block , ENCRYPT_BLOCK_SIZE );
1845- XMEMCPY (data , dec_block , unaligned_tail_size );
1846- read_remaining -= unaligned_tail_size ;
1845+ XMEMCPY (data , dec_block , unaligned_trailer_size );
1846+ read_remaining -= unaligned_trailer_size ;
18471847 }
18481848 return (len - read_remaining );
18491849}
0 commit comments