Linux/MacOSX : fix encryption/decryption issues with hard drives that have a sector size bigger than 512. Now, we use the sector size as the minimum unit for data fragment encryption/decryption.

This commit is contained in:
Mounir IDRASSI 2014-10-24 08:43:05 +02:00
parent 067394d110
commit ea03100d9e

View File

@ -108,7 +108,7 @@ namespace VeraCrypt
workItem->Encryption.StartUnitNo = fragmentStartUnitNo; workItem->Encryption.StartUnitNo = fragmentStartUnitNo;
workItem->Encryption.SectorSize = sectorSize; workItem->Encryption.SectorSize = sectorSize;
fragmentData += unitsPerFragment * ENCRYPTION_DATA_UNIT_SIZE; fragmentData += unitsPerFragment * sectorSize;
fragmentStartUnitNo += unitsPerFragment; fragmentStartUnitNo += unitsPerFragment;
if (remainder > 0 && --remainder == 0) if (remainder > 0 && --remainder == 0)