@@ -1765,7 +1765,7 @@ int RAMFUNCTION ext_flash_decrypt_read(uintptr_t address, uint8_t *data, int len
17651765 int i ;
17661766 int flash_read_size ;
17671767 int read_remaining = len ;
1768- int unaligned_head_size , unaligned_tail_size ;
1768+ int unaligned_head_size , unaligned_trailer_size ;
17691769 uint8_t part ;
17701770 uintptr_t base_address ;
17711771
@@ -1817,8 +1817,8 @@ int RAMFUNCTION ext_flash_decrypt_read(uintptr_t address, uint8_t *data, int len
18171817 iv_counter ++ ;
18181818 }
18191819 /* Trim the read size to align with the Encryption Blocks. Read the
1820- * remaining unaligned tail bytes after, since the `data` buffer won't have
1821- * enough space to handle the extra bytes.
1820+ * remaining unaligned trailer bytes after, since the `data` buffer won't
1821+ * have enough space to handle the extra bytes.
18221822 */
18231823 flash_read_size = read_remaining & ~(ENCRYPT_BLOCK_SIZE - 1 );
18241824 if (ext_flash_read (address , data , flash_read_size ) != flash_read_size )
@@ -1835,17 +1835,17 @@ int RAMFUNCTION ext_flash_decrypt_read(uintptr_t address, uint8_t *data, int len
18351835 data += flash_read_size ;
18361836 read_remaining -= flash_read_size ;
18371837
1838- /* Read the unaligned tail bytes. */
1839- unaligned_tail_size = read_remaining ;
1840- if (unaligned_tail_size > 0 )
1838+ /* Read the unaligned trailer bytes. */
1839+ unaligned_trailer_size = read_remaining ;
1840+ if (unaligned_trailer_size > 0 )
18411841 {
18421842 uint8_t dec_block [ENCRYPT_BLOCK_SIZE ];
18431843 if (ext_flash_read (address , block , ENCRYPT_BLOCK_SIZE )
18441844 != ENCRYPT_BLOCK_SIZE )
18451845 return -1 ;
18461846 crypto_decrypt (dec_block , block , ENCRYPT_BLOCK_SIZE );
1847- XMEMCPY (data , dec_block , unaligned_tail_size );
1848- read_remaining -= unaligned_tail_size ;
1847+ XMEMCPY (data , dec_block , unaligned_trailer_size );
1848+ read_remaining -= unaligned_trailer_size ;
18491849 }
18501850 return (len - read_remaining );
18511851}
0 commit comments