@@ -11461,9 +11461,9 @@ int wc_AesXtsEncryptConsecutiveSectors(XtsAes* aes, byte* out, const byte* in,
1146111461 word32 sz , word64 sector , word32 sectorSz )
1146211462{
1146311463 int ret = 0 ;
11464- int iter = 0 ;
11465- int sectorCount = sz / sectorSz ;
11466- int remainder = sz % sectorSz ;
11464+ word32 iter = 0 ;
11465+ word32 sectorCount ;
11466+ word32 remainder ;
1146711467
1146811468 if (aes == NULL || out == NULL || in == NULL || sectorSz == 0 ) {
1146911469 return BAD_FUNC_ARG ;
@@ -11474,6 +11474,9 @@ int wc_AesXtsEncryptConsecutiveSectors(XtsAes* aes, byte* out, const byte* in,
1147411474 return BAD_FUNC_ARG ;
1147511475 }
1147611476
11477+ sectorCount = sz / sectorSz ;
11478+ remainder = sz % sectorSz ;
11479+
1147711480 while (sectorCount ) {
1147811481 ret = wc_AesXtsEncryptSector (aes , out + (iter * sectorSz ),
1147911482 in + (iter * sectorSz ), sectorSz , sector );
@@ -11507,9 +11510,9 @@ int wc_AesXtsDecryptConsecutiveSectors(XtsAes* aes, byte* out, const byte* in,
1150711510 word32 sz , word64 sector , word32 sectorSz )
1150811511{
1150911512 int ret = 0 ;
11510- int iter = 0 ;
11511- int sectorCount = sz / sectorSz ;
11512- int remainder = sz % sectorSz ;
11513+ word32 iter = 0 ;
11514+ word32 sectorCount ;
11515+ word32 remainder ;
1151311516
1151411517 if (aes == NULL || out == NULL || in == NULL || sectorSz == 0 ) {
1151511518 return BAD_FUNC_ARG ;
@@ -11520,6 +11523,9 @@ int wc_AesXtsDecryptConsecutiveSectors(XtsAes* aes, byte* out, const byte* in,
1152011523 return BAD_FUNC_ARG ;
1152111524 }
1152211525
11526+ sectorCount = sz / sectorSz ;
11527+ remainder = sz % sectorSz ;
11528+
1152311529 while (sectorCount ) {
1152411530 ret = wc_AesXtsDecryptSector (aes , out + (iter * sectorSz ),
1152511531 in + (iter * sectorSz ), sectorSz , sector );
0 commit comments