]> foleosoft.com Git - QAnsel.git/commitdiff
Thu Aug 15 08:15:52 PM EDT 2024
authormiha-q <>
Fri, 16 Aug 2024 00:15:52 +0000 (20:15 -0400)
committermiha-q <>
Fri, 16 Aug 2024 00:15:52 +0000 (20:15 -0400)
src/hardware.c

index a2ef3289cdfe877fd7799c7d8baf3e6f01f0e317..20de04b236f5bea7ba5a2850f55a1f22739fa2e3 100644 (file)
@@ -135,10 +135,10 @@ void qansel_quantis_chunk(unsigned char** chunk)
     FILE* f = fopen("/dev/qrandom0", "r");
     unsigned char c = fgetc(f);
     while (c == 0x00) c = fgetc(f);
-    (*chunk)[0] = c & (unsigned char)((rand() & 0xFF));
+    (*chunk)[0] = c ^ rand();
     for (int i = 0; i < QANSEL_QUANTIS_CHUNK_SIZE - 1; i++)
     {
-        (*chunk)[i + 1] = fgetc(f) & (unsigned char)((rand() & 0xFF));
+        (*chunk)[i + 1] = fgetc(f) ^ rand();
     }
     fclose(f);
 }
\ No newline at end of file