From: miha-q <> Date: Thu, 15 Aug 2024 23:00:15 +0000 (-0400) Subject: Thu Aug 15 07:00:15 PM EDT 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=2311bcfa500dc09a112115ffaa4f8be9431649fe;p=QAnsel.git Thu Aug 15 07:00:15 PM EDT 2024 --- diff --git a/src/context.c b/src/context.c index 916f02b..b47c3b2 100644 --- a/src/context.c +++ b/src/context.c @@ -98,7 +98,7 @@ int qanselContextBegin(QAnselContext* ctx) fclose(ctx->random_file); if (ctx->verbose) printf("QAnsel: Hardware `Quantis` selected.\n"); ctx->hardware_rng = QANSEL_HARDWARE_QUANTIS; - ctx->pointer = QUANTIS_CHUNK_SIZE; + ctx->pointer = QANSEL_QUANTIS_CHUNK_SIZE; } } if (ctx->optimization_level & QANSEL_MODE_METAL) diff --git a/src/hardware.c b/src/hardware.c index 25921f9..6389566 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -128,12 +128,12 @@ float qansel_hardware_getseed() void qansel_quantis_chunk(unsigned char** chunk) { if ((*chunk) != NULL) free(*chunk); - *chunk = malloc(QUANTIS_CHUNK_SIZE); + *chunk = malloc(QANSEL_QUANTIS_CHUNK_SIZE); FILE* f = fopen("/dev/qrandom0", "r"); unsigned char c = fgetc(f); while (c == 0x00) c = fgetc(f); (*chunk)[0] = c; - for (int i = 0; i < QUANTIS_CHUNK_SIZE - 1; i++) + for (int i = 0; i < QANSEL_QUANTIS_CHUNK_SIZE - 1; i++) { (*chunk)[i + 1] = fgetc(f); } diff --git a/src/hardware.h b/src/hardware.h index 7e2ae2a..3ed9cfc 100644 --- a/src/hardware.h +++ b/src/hardware.h @@ -12,8 +12,7 @@ #else #error "Unknown platform" #endif - -#define QUANTIS_CHUNK_SIZE 4096 +#define QANSEL_QUANTIS_CHUNK_SIZE 4096 int qansel___get_core_count(); int qansel_get_core_count(); diff --git a/src/qansel.h b/src/qansel.h index 3059ddc..5c24586 100644 --- a/src/qansel.h +++ b/src/qansel.h @@ -16,7 +16,6 @@ #define QANSEL_HARDWARE_TRUERNG 2 #define QANSEL_HARDWARE_RDSEED 3 #define QANSEL_HARDWARE_QUANTIS 4 -#define QANSEL_QUANTIS_CHUNK_SIZE 4096 #define QANSEL_INSTRUCTION_X 0x10 #define QANSEL_INSTRUCTION_Y 0x11 #define QANSEL_INSTRUCTION_Z 0x12