This commit is contained in:
Hendrik Schutter 2022-08-20 10:39:26 +02:00
parent e7a1cb1887
commit 45dac1a4a7
2 changed files with 1113 additions and 4 deletions

1108
reHDD_memset.log Normal file

File diff suppressed because it is too large Load Diff

View File

@ -76,18 +76,19 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
unsigned long ulDriveByteCounter = 0U; //used for one shred-iteration to keep track of the current drive position unsigned long ulDriveByteCounter = 0U; //used for one shred-iteration to keep track of the current drive position
uint32_t u32ChunkDimensionIndex = 0U; uint32_t u32ChunkDimensionIndex = 0U;
/*
if(uiShredIterationCounter == (SHRED_ITERATIONS-1)) if(uiShredIterationCounter == (SHRED_ITERATIONS-1))
{ {
//last shred iteration --> overwrite with zeros instead with random data //last shred iteration --> overwrite with zeros instead with random data
memset(caChunk, 0U, CHUNK_DIMENSION*CHUNK_SIZE); memset(caChunk, 0U, CHUNK_DIMENSION*CHUNK_SIZE);
} }
*/
while (ulDriveByteCounter < ulDriveByteSize) while (ulDriveByteCounter < ulDriveByteSize)
{ {
int iBytesToShred = 0; //Bytes that will be overwritten in this chunk-iteration int iBytesToShred = 0; //Bytes that will be overwritten in this chunk-iteration
/*
if((u32ChunkDimensionIndex == 0U) && (uiShredIterationCounter != (SHRED_ITERATIONS-1))) if((u32ChunkDimensionIndex == 0U))
{ {
//read new chunks from random source if needed and this is NOT the last shred iteration //read new chunks from random source if needed and this is NOT the last shred iteration
unsigned long ulBytesInChunkBuffer = 0U; unsigned long ulBytesInChunkBuffer = 0U;
@ -114,7 +115,7 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
#endif #endif
} }
*/
if((ulDriveByteSize-ulDriveByteCounter) < CHUNK_SIZE) if((ulDriveByteSize-ulDriveByteCounter) < CHUNK_SIZE)
{ {
iBytesToShred = (ulDriveByteSize-ulDriveByteCounter); iBytesToShred = (ulDriveByteSize-ulDriveByteCounter);