]> foleosoft.com Git - QAnsel.git/commitdiff
Thu Aug 15 07:00:15 PM EDT 2024
authormiha-q <>
Thu, 15 Aug 2024 23:00:15 +0000 (19:00 -0400)
committermiha-q <>
Thu, 15 Aug 2024 23:00:15 +0000 (19:00 -0400)
src/context.c
src/hardware.c
src/hardware.h
src/qansel.h

index 916f02b3d80203332e6d4296493b60ca98559a13..b47c3b2bb9339f44ca681a8b7fc0e91943103461 100644 (file)
@@ -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)
index 25921f9cd0562b78cb68ee13dd899a5bb96160d3..6389566080771bb2dbe12e2cff4b88e4320e1cad 100644 (file)
@@ -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);
     }
index 7e2ae2a525ac65176c0cee5b0dada30dac3e3ee7..3ed9cfcc809a95d31eb0aeca96da435c1382720e 100644 (file)
@@ -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();
index 3059ddc19bbc758b3e529cb408a3e1deb0296228..5c245866bec3c68346ecc25b427a0c2f7b3b73f4 100644 (file)
@@ -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