update
This commit is contained in:
@@ -129,16 +129,9 @@ static void scaleEntropy(void) {
|
||||
// This should be called for each bit generated.
|
||||
bool inmHealthCheckAddBit(bool bit, bool even) {
|
||||
inmTotalBits++;
|
||||
if((inmTotalBits & 0xfffff) == 0) {
|
||||
if(inmDebug) {
|
||||
printf("Generated %lu bits. Estimated entropy per bit: %f, estimated K: %f\n",
|
||||
inmTotalBits, inmHealthCheckEstimateEntropyPerBit(), inmHealthCheckEstimateK());
|
||||
}
|
||||
/*
|
||||
if(inmTotalBits > 3000000) {
|
||||
exit(0);
|
||||
}
|
||||
*/
|
||||
if(inmDebug && (inmTotalBits & 0xfffff) == 0) {
|
||||
printf("Generated %lu bits. Estimated entropy per bit: %f, estimated K: %f\n",
|
||||
inmTotalBits, inmHealthCheckEstimateEntropyPerBit(), inmHealthCheckEstimateK());
|
||||
}
|
||||
inmPrevBits = (inmPrevBits << 1) & ((1 << inmN)-1);
|
||||
if(inmPrevBit) {
|
||||
|
||||
@@ -62,7 +62,6 @@ void inmWriteEntropyStart(uint32_t bufLen, bool debug) {
|
||||
|
||||
// Block until either the entropy pool has room, or 1 second has passed.
|
||||
void inmWaitForPoolToHaveRoom(void) {
|
||||
printf("starting select\n");
|
||||
int ent_count;
|
||||
struct pollfd pfd = {
|
||||
fd: inmDevRandomFD,
|
||||
@@ -70,12 +69,10 @@ void inmWaitForPoolToHaveRoom(void) {
|
||||
};
|
||||
int64_t timeout_usec;
|
||||
if (ioctl(inmDevRandomFD, RNDGETENTCNT, &ent_count) == 0 && ent_count < inmFillWatermark) {
|
||||
printf("Not full\n");
|
||||
return;
|
||||
}
|
||||
timeout_usec = 1000; // One second
|
||||
poll(&pfd, 1, timeout_usec);
|
||||
printf("Finished select\n");
|
||||
}
|
||||
|
||||
// Add the bytes to the entropy pool. This can be unwhitenened, but the estimated bits of
|
||||
|
||||
Reference in New Issue
Block a user