From a7f409eb61751cc4126ec0fbe13403ce0643d692 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 1 Mar 2020 08:26:04 +0000 Subject: [PATCH] Fix VS 2015 build failure. Thanks to Pavel Kryukov's CI for pointing this out: VS 2015 doesn't support C99 hex floating-point literals. (VS 2017 does, and in general we're treating this as a C99-permitted code base these days. So I was tempted to just increase the minimum required compiler version and leave this code as it is. But since the use of that particular floating literal was so totally frivolous and unnecessary, I think I'll leave that for another day when it's more important!) --- sshdssg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sshdssg.c b/sshdssg.c index eba3c4e7..ccd377b2 100644 --- a/sshdssg.c +++ b/sshdssg.c @@ -28,8 +28,12 @@ int dsa_generate(struct dss_key *key, int bits, ProgressReceiver *prog) */ ProgressPhase phase_q = primegen_add_progress_phase(prog, 160); ProgressPhase phase_p = primegen_add_progress_phase(prog, bits); + double g_failure_probability = 1.0 + / (double)(1ULL << 53) + / (double)(1ULL << 53) + / (double)(1ULL << 53); ProgressPhase phase_g = progress_add_probabilistic( - prog, estimate_modexp_cost(bits), 1.0 - 0x1.0p-159); + prog, estimate_modexp_cost(bits), 1.0 - g_failure_probability); progress_ready(prog); PrimeCandidateSource *pcs;