diff options
| author | J08nY | 2025-03-20 16:22:28 +0100 |
|---|---|---|
| committer | J08nY | 2025-03-20 16:22:47 +0100 |
| commit | efa899bab078ef57d55ffbde9343d1320a9b08a0 (patch) | |
| tree | 0938d637fc389175c346e7e41057f71eb43638d6 /src/util/random.c | |
| parent | ce6f2ddbb6c1cd718f3e093e71eddb7ab4a69f07 (diff) | |
| download | ecgen-efa899bab078ef57d55ffbde9343d1320a9b08a0.tar.gz ecgen-efa899bab078ef57d55ffbde9343d1320a9b08a0.tar.zst ecgen-efa899bab078ef57d55ffbde9343d1320a9b08a0.zip | |
Fix discriminant iteration in CM with composite order.
The prime impl is still broken. The family gen is as well.
Diffstat (limited to 'src/util/random.c')
| -rw-r--r-- | src/util/random.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/random.c b/src/util/random.c index b88bb50..844e0f6 100644 --- a/src/util/random.c +++ b/src/util/random.c @@ -5,8 +5,8 @@ #define _POSIX_C_SOURCE 200809L #include "random.h" -#include <time.h> #include <stdint.h> +#include <time.h> void random_reseed(void) { pari_ulong seed = 0; @@ -15,7 +15,8 @@ void random_reseed(void) { if (rand) { size_t read = 0; while (read < sizeof(pari_ulong)) { - read += fread(((uint8_t*) &seed) + read, 1, sizeof(pari_ulong) - read, rand); + read += fread(((uint8_t *)&seed) + read, 1, + sizeof(pari_ulong) - read, rand); } fclose(rand); |
