using tfng instead of urandom

This commit is contained in:
2022-08-22 15:27:29 +02:00
parent 4cf1efea7a
commit 09446b52ca
3 changed files with 37 additions and 54 deletions

View File

@ -18,7 +18,8 @@
#include <string.h>
#define CHUNK_SIZE 1024*1024*2 //amount of bytes that are overwritten at once --> 2MB
#define CHUNK_DIMENSION 100U //amount of chunks are read at once from random source
//#define CHUNK_SIZE 1024U*4U //amount of bytes that are overwritten at once
#define TFNG_DATA_SIZE 65536U //amount of bytes used by tfng
//#define DEMO_DRIVE_SIZE 1024*1024*256L // 256MB
//#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB
@ -39,7 +40,8 @@ public:
private:
fileDescriptor randomSrcFileDiscr;
fileDescriptor driveFileDiscr;
unsigned char caChunk[CHUNK_DIMENSION][CHUNK_SIZE];
unsigned char caTfngData[TFNG_DATA_SIZE];
unsigned char caReadBuffer[CHUNK_SIZE];
unsigned long ulDriveByteSize;
unsigned long ulDriveByteOverallCount = 0; //all bytes shredded in all iterations + checking -> used for progress calculation
double d32Percent = 0.0;